ipprint 0.2 → 0.3
raw patch · 2 files changed
+27/−21 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ IPPrint: pshow :: (Show a) => a -> String
Files
- IPPrint.hs +26/−20
- ipprint.cabal +1/−1
IPPrint.hs view
@@ -1,20 +1,26 @@-module IPPrint(pprint) where - -import Language.Haskell.Parser -import Language.Haskell.Pretty -import Text.Read - -pprint :: Show a => a -> IO () -pprint v = putStrLn $ - case parseModule ("value = "++s) of - ParseOk m -> tidy $ prettyPrint m - ParseFailed _ _ -> s - where s = show v - tidy x = case readPrec_to_S skipBoring 0 x of - [((), tail)] -> " " ++ tail - _ -> s - -skipBoring :: ReadPrec () -skipBoring = - do { Ident "value" <- lexP; Punc "=" <- lexP; return () } <++ - do { lexP; skipBoring } +module IPPrint(pshow, pprint) where++import Language.Haskell.Parser+import Language.Haskell.Pretty+import Text.Read++pshow :: Show a => a -> String+pshow v =+ case parseModule ("value = "++s) of+ ParseOk m -> tidy $ prettyPrint m+ ParseFailed _ _ -> s+ where+ s = show v+ tidy x =+ case readPrec_to_S skipBoring 0 x of+ [((), tail)] -> " " ++ tail+ _ -> s+++pprint :: Show a => a -> IO ()+pprint = putStrLn . pshow++skipBoring :: ReadPrec ()+skipBoring =+ do { Ident "value" <- lexP; Punc "=" <- lexP; return () } <+++ do { lexP; skipBoring }
ipprint.cabal view
@@ -1,6 +1,6 @@ Name: ipprint Category: Text-Version: 0.2+Version: 0.3 License: BSD3 License-file: LICENSE Author: Gleb Alexeyev