pretty-show 1.8 → 1.8.1
raw patch · 3 files changed
+41/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Text/Show/Parser.y +20/−3
- dist/build/Text/Show/Parser.hs +19/−3
- pretty-show.cabal +2/−1
Text/Show/Parser.y view
@@ -130,7 +130,7 @@ mkValue (InfixCons v xs : Neg x : more) = mkValue (mkInfixCons v (xs ++ [("-",x)]) : more) mkValue (v : Neg x : more) = mkValue (mkInfixCons v [("-",x)] : more)-mkValue vs = Con "" vs+mkValue vs = mkFakeCon vs {- When we see a sequence of thins: 1 2 3 + x + y@@ -148,7 +148,24 @@ mkInfixCons :: Value -> [(Name,Value)] -> Value mkInfixCons (Con "" as) bs | not (null as) =- Con "" (init as ++ [InfixCons (last as) bs])-mkInfixCons a bs = InfixCons a bs+ mkFakeCon (init as ++ [mkInfixConsLast (last as) bs])+mkInfixCons a bs = mkInfixConsLast a bs++mkInfixConsLast :: Value -> [(Name,Value)] -> Value+mkInfixConsLast v [] = v+mkInfixConsLast v vs = mk [] vs+ where+ inf xs = InfixCons v (reverse xs)++ mk ps [(x,Con "" (a:as))] = mkFakeCon (inf ((x,a):ps) : as)+ mk ps [x] = inf (x:ps)+ mk ps (x : xs) = mk (x : ps) xs+ mk _ [] = error "impossible"++mkFakeCon :: [Value] -> Value+mkFakeCon vs = Con "" (concatMap expand vs)+ where expand (Con "" vs) = vs+ expand v = [v]+ }
dist/build/Text/Show/Parser.hs view
@@ -961,7 +961,7 @@ mkValue (InfixCons v xs : Neg x : more) = mkValue (mkInfixCons v (xs ++ [("-",x)]) : more) mkValue (v : Neg x : more) = mkValue (mkInfixCons v [("-",x)] : more)-mkValue vs = Con "" vs+mkValue vs = mkFakeCon vs {- When we see a sequence of thins: 1 2 3 + x + y@@ -979,8 +979,24 @@ mkInfixCons :: Value -> [(Name,Value)] -> Value mkInfixCons (Con "" as) bs | not (null as) =- Con "" (init as ++ [InfixCons (last as) bs])-mkInfixCons a bs = InfixCons a bs+ mkFakeCon (init as ++ [mkInfixConsLast (last as) bs])+mkInfixCons a bs = mkInfixConsLast a bs++mkInfixConsLast :: Value -> [(Name,Value)] -> Value+mkInfixConsLast v [] = v+mkInfixConsLast v vs = mk [] vs+ where+ inf xs = InfixCons v (reverse xs)++ mk ps [(x,Con "" (a:as))] = mkFakeCon (inf ((x,a):ps) : as)+ mk ps [x] = inf (x:ps)+ mk ps (x : xs) = mk (x : ps) xs+ mk _ [] = error "impossible"++mkFakeCon :: [Value] -> Value+mkFakeCon vs = Con "" (concatMap expand vs)+ where expand (Con "" vs) = vs+ expand v = [v] {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-}
pretty-show.cabal view
@@ -1,5 +1,5 @@ name: pretty-show-version: 1.8+version: 1.8.1 category: Text synopsis: Tools for working with derived `Show` instances and generic@@ -25,6 +25,7 @@ tested-with: GHC == 7.10.3 GHC == 8.0.2 GHC == 8.2.2+ GHC == 8.4.3 data-files: style/jquery.js