| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Fmt.Functor
Contents
Description
Pattern functor for document trees.
Doc m ann is the base functor for pretty-printer documents,
parametric over content type m and annotation type ann.
Changes from prettyprinter's DocF:
Char/Textmerged intoLeaf m(parametric content)WithPageWidthdropped (recoverable viaColumn/Nesting)Failretained for lazy failure propagation throughColumn/Nesting
Pattern functor
One layer of a document tree.
r marks recursive positions. m is the content type
(e.g. Text, Builder).
ann is the annotation type (e.g. ANSI styles, HTML tags).
Constructors
| Fail | Layout failure. Produced by |
| Empty | Empty document. |
| Leaf !Int !m | Literal content with cached display width. |
| Cat r r | Concatenation. |
| Line | Hard line break. Cannot be flattened (becomes |
| FlatAlt r r |
|
| Nest !Int r |
|
| Union r r |
|
| Ann ann r | Annotated document. |
| Column (Int -> r) | React to the current column position. |
| Nesting (Int -> r) | React to the current nesting level. |