ipprint 0.4.2 → 0.5
raw patch · 2 files changed
+8/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ IPPrint: pprintWidth :: Show a => Int -> a -> IO ()
+ IPPrint: pshowWidth :: Show a => Int -> a -> String
Files
- IPPrint.hs +7/−5
- ipprint.cabal +1/−1
IPPrint.hs view
@@ -1,4 +1,4 @@-module IPPrint(pshow, pprint) where+module IPPrint(pshow, pshowWidth, pprint, pprintWidth) where import Extra.Terminal (getWidth) import Language.Haskell.Parser@@ -20,17 +20,19 @@ s = show v tidy x = case readPrec_to_S skipBoring 0 x of- [((), tail)] -> " " ++ tail- _ -> s+ [((), tail')] -> " " ++ tail'+ _ -> s +pprintWidth :: Show a => Int -> a -> IO ()+pprintWidth width = putStrLn . pshowWidth width pprint :: Show a => a -> IO () pprint v = do mw <- getWidth let width = maybe defaultLineWidth id mw- putStrLn $ pshowWidth width v+ pprintWidth width v skipBoring :: ReadPrec () skipBoring = do { Ident "value" <- lexP; Punc "=" <- lexP; return () } <++- do { lexP; skipBoring }+ do { _ <- lexP; skipBoring }
ipprint.cabal view
@@ -2,7 +2,7 @@ Cabal-version: >= 1.6 Build-type: Simple Category: Text-Version: 0.4.2+Version: 0.5 License: BSD3 License-file: LICENSE Author: Gleb Alexeyev