ddc-base-0.4.1.1: Disciplined Disciple Compiler common utilities.

Safe HaskellNone

DDC.Base.Pretty

Contents

Description

Pretty printer utilities.

This is a re-export of Daan Leijen's pretty printer package (wl-pprint), but with a Pretty class that includes a pprPrec function.

Synopsis

Documentation

class Pretty a whereSource

Associated Types

data PrettyMode a Source

pprParen :: Bool -> Doc -> DocSource

Wrap a Doc in parens if the predicate is true.

Rendering

data RenderMode Source

How to pretty print a doc.

Constructors

RenderPlain

Render the doc with indenting.

RenderIndent

Render the doc without indenting.

render :: RenderMode -> Doc -> StringSource

Render a doc with the given mode.

renderPlain :: Doc -> StringSource

Convert a Doc to a string without indentation.

renderIndent :: Doc -> StringSource

Convert a Doc to a string with indentation

putDoc :: RenderMode -> Doc -> IO ()Source

Put a Doc to stdout using the given mode.

putDocLn :: RenderMode -> Doc -> IO ()Source

Put a Doc to stdout using the given mode.