| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Text.Show.Prettyprint
Description
Format a show-generated string to make it nicer to read.
For example, consider this nested data structure:
>>>:{let nestedExample = fromList [ ("hello", Left (Pair True ())) , ("world", Right (Record { r1 = ('c', -1.2e34), r2 = 123 })) , ("!" , Left (Pair False ())) ] :}
Applying show to the nested example results in the fairly dense representation
>>>print nestedExamplefromList [("!",Left (Pair False ())),("hello",Left (Pair True ())),("world",Right (Record {r1 = ('c',-1.2e34), r2 = 123}))]
With the functions defined in this module, we can make this output a bit more readable,
>>>prettyPrint nestedExamplefromList [("!",Left (Pair False ())) ,("hello",Left (Pair True ())) ,("world",Right (Record {r1 = ('c',-1.2e34),r2 = 123}))]
Synopsis
- prettifyShow :: String -> String
 - prettifyToDoc :: String -> Doc ann
 - prettyShow :: Show a => a -> String
 - prettyShowDoc :: Show a => a -> Doc ann
 - prettyPrint :: Show a => a -> IO ()
 
Documentation
prettifyShow :: String -> String Source #
Prettyprint a string produced by show. On parse error, silently fall back
 to a non-prettyprinted version.
prettifyToDoc :: String -> Doc ann Source #
Like prettifyShow, but maps to a Doc for easier interoperability with
 the prettyprinter package.
prettyShow :: Show a => a -> String Source #
prettifyShow with the show baked in.
prettyShowDoc :: Show a => a -> Doc ann Source #
prettifyToDoc with the show baked in.
prettyPrint :: Show a => a -> IO () Source #
prettifyShow with the show and the putStrLn baked in.