packages feed

pretty-simple 4.1.1.0 → 4.1.2.0

raw patch · 5 files changed

+23/−6 lines, 5 files

Files

CHANGELOG.md view
@@ -1,4 +1,15 @@ +## 4.1.2.0++*   Fix a problem with the `pHPrint` function incorrectly+    outputting a trailing newline to stdout, instead of the+    handle you pass it.+    [#118](https://github.com/cdepillabout/pretty-simple/pull/118)+*   Add a [web app](https://cdepillabout.github.io/pretty-simple/) where you+    can play around with `pretty-simple` in your browser.+    [#116](https://github.com/cdepillabout/pretty-simple/pull/116).+    This took a lot of hard work by [@georgefst](https://github.com/georgefst)!+ ## 4.1.1.0  *   Make the pretty-printed output with `outputOptionsCompact` enabled a little
README.md view
@@ -39,6 +39,9 @@  ![example screenshot](https://raw.githubusercontent.com/cdepillabout/pretty-simple/master/img/pretty-simple-example-screenshot.png) +There's a [web app](https://cdepillabout.github.io/pretty-simple) compiled with+GHCJS where you can play around with `pretty-simple` running in your browser.+ ## Usage  `pretty-simple` can be easily used from `ghci` when debugging.
pretty-simple.cabal view
@@ -1,5 +1,5 @@ name:                pretty-simple-version:             4.1.1.0+version:             4.1.2.0 synopsis:            pretty printer for data types with a 'Show' instance. description:         Please see <https://github.com/cdepillabout/pretty-simple#readme README.md>. homepage:            https://github.com/cdepillabout/pretty-simple
src/Text/Pretty/Simple.hs view
@@ -120,7 +120,7 @@ import Prettyprinter.Render.Terminal       (Color (..), Intensity(Vivid,Dull), AnsiStyle,        renderLazy, renderIO)-import System.IO (Handle, stdout)+import System.IO (Handle, stdout, hPutStrLn)  import Text.Pretty.Simple.Internal        (ColorOptions(..), Style(..), CheckColorTty(..),@@ -526,7 +526,7 @@       NoCheckColorTty -> pure outputOptions   liftIO $ do     renderIO handle $ layoutStringAnsi realOutputOpts str-    putStrLn ""+    hPutStrLn handle ""  -- | Like 'pShow' but takes 'OutputOptions' to change how the -- pretty-printing is done.
src/Text/Pretty/Simple/Internal/Printer.hs view
@@ -195,9 +195,11 @@ -- suitable for passing to any /prettyprinter/ backend. -- Used by 'Simple.pString' etc. layoutString :: OutputOptions -> String -> SimpleDocStream Style-layoutString opts =-  annotateStyle opts-    . removeTrailingWhitespace+layoutString opts = annotateStyle opts . layoutStringAbstract opts++layoutStringAbstract :: OutputOptions -> String -> SimpleDocStream Annotation+layoutStringAbstract opts =+    removeTrailingWhitespace     . layoutSmart defaultLayoutOptions       {layoutPageWidth = AvailablePerLine (outputOptionsPageWidth opts) 1}     . indent (outputOptionsInitialIndent opts)@@ -302,6 +304,7 @@   | Quote   | String   | Num+  deriving (Eq, Show)  -- | Replace non-printable characters with hex escape sequences. --