Safe Haskell | None |
---|---|
Language | Haskell98 |
Pretty printing functions.
Pretty class
While Show
is for rendering data in Haskell syntax,
Pretty
is for displaying data to the world, i.e., the
user and the environment.
Atomic data has no inner document structure, so just
implement pretty
as pretty a = text $ ... a ...
.
Nothing
prettyShow :: Pretty a => a -> String Source
Use instead of show
when printing to world.
Pretty instances
Doc
utilities
align :: Int -> [(String, Doc)] -> Doc Source
align max rows
lays out the elements of rows
in two columns,
with the second components aligned. The alignment column of the
second components is at most max
characters to the right of the
left-most column.
Precondition: max > 0
.
module Text.PrettyPrint