haskell-groom-utils

Pretty printing for well-behaved Show instances

Description

Automatically derived Show instances are an easy way to inspect data in your program. However, for large data-structures, the resulting output lacks whitespace, making it unreadable. Groom offers an replacement to `show' called `groom' which attempts to pretty-print the output of `show'. For example:

> let x = parseExp "foobar 1 [1,2]" > in do > putStrLn (show x) > putStrLn (groom x)

results in:

> ParseOk (App (App (Var (UnQual (Ident "foobar"))) (Lit (Int 1))) (List [Lit (Int 1),Lit (Int 2)])) > ParseOk > (App (App (Var (UnQual (Ident "foobar"))) (Lit (Int 1))) > (List [Lit (Int 1), Lit (Int 2)]))

Groom works only on Show instances that output valid Haskell code; if Groom can't understand its input, it will not make any changes.

Upload more screenshots

Please help extend the collection of screenshots. Just make a screenshot and upload it here. You don't need to register or anything.

Upload a screenshot

Hint: upload an image here from your clipboard with Ctrl-V


Homepage

https://hackage.haskell.org/package/groom


Install this software package

If the package is available for the distribution you are currently using on your computer then install the software by clicking on…

Install haskell-groom-utils