shower-0.2.0.3: Clean up the formatting of 'show' output
Safe HaskellSafe-Inferred
LanguageHaskell2010

Shower

Description

Pretty-print Show output and JSON.

Synopsis

Documentation

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

A drop-in replacement for show that has nice layout. NB: does not handle infinite data structures at the moment.

printer :: Show a => a -> IO () Source #

A drop-in replacement for print that has nice layout. Use it in GHCi with -interactive-print=Shower.printer:

ghci> :set -interactive-print=Shower.printer
ghci> ([1..15], [a..z])
([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
 "abcdefghijklmnopqrstuvwxyz")

NB: does not handle infinite data structures at the moment.

showerString :: String -> Either String String Source #

Parse and pretty-print show output or JSON.