show-prettyprint-0.1.0.2: Robust prettyprinter for output of auto-generated Show instances

Safe HaskellNone
LanguageHaskell2010

Text.Show.Prettyprint

Contents

Description

Format a show-generated string to make it nicer to read.

>>> :{
(putStrLn . prettyShow . Data.Map.fromList)
    [("hello", Just True), ("world", Nothing), ("!", Just False)]
:}
fromList [("!",Just False)
         ,("hello",Just True)
         ,("world",Nothing)]

See the readme for some more examples.

Synopsis

Documentation

prettifyShow :: String -> String Source #

Prettyprint a string produced by show. On parse error, silently fall back to a non-prettyprinted version.

prettyShow :: Show a => a -> String Source #

prettifyShow with the show baked in.

Diagnostic functions

prettifyShowErr :: String -> String Source #

Attempt to prettify a string produced by show. Report error information on failure.

prettyShowErr :: Show a => a -> String Source #

prettifyShowErr with the show baked in.