language-python-0.4.0: Parsing and pretty printing of Python code.

Portabilityghc
Stabilityexperimental
Maintainerbjpop@csse.unimelb.edu.au
Safe HaskellSafe-Inferred

Language.Python.Common.Pretty

Description

Convenience class for pretty printing combinators.

Synopsis

Documentation

prettyText :: Pretty a => a -> StringSource

Transform values into strings.

prettyPrefix :: Pretty a => Int -> a -> DocSource

Print just the prefix of something

parensIf :: Pretty a => (a -> Bool) -> a -> DocSource

Conditionally wrap parentheses around an item.

perhaps :: Pretty a => Maybe a -> Doc -> DocSource

commaList :: Pretty a => [a] -> DocSource

A list of things separated by commas.