| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | Henrique Ferreiro Garca David Castro Prez |
Language.CoreErlang.Pretty
Contents
Description
Pretty printer for CoreErlang.
- class Pretty a
- prettyPrintStyleMode :: Pretty a => Style -> PPMode -> a -> String
- prettyPrintWithMode :: Pretty a => PPMode -> a -> String
- prettyPrint :: Pretty a => a -> String
- data Style = Style {
- mode :: Mode
- lineLength :: Int
- ribbonsPerLine :: Float
- style :: Style
- data Mode
- = PageMode
- | ZigZagMode
- | LeftMode
- | OneLineMode
- data PPMode = PPMode {}
- type Indent = Int
- data PPLayout
- = PPDefault
- | PPNoLayout
- defaultMode :: PPMode
Pretty printing
Things that can be pretty-printed, including all the syntactic objects in Language.CoreErlang.Syntax.
prettyPrintStyleMode :: Pretty a => Style -> PPMode -> a -> StringSource
pretty-print with a given style and mode.
prettyPrintWithMode :: Pretty a => PPMode -> a -> StringSource
pretty-print with the default style and a given mode.
prettyPrint :: Pretty a => a -> StringSource
pretty-print with the default style and defaultMode.
Pretty-printing styles (from -- Text.PrettyPrint.HughesPJ)
data Style
A rendering style.
Constructors
| Style | |
Fields
| |
data Mode
Rendering mode.
Constructors
| PageMode | Normal |
| ZigZagMode | With zig-zag cuts |
| LeftMode | No indentation, infinitely long lines |
| OneLineMode | All on one line |
CoreErlang formatting modes
Pretty-printing parameters.
Constructors
| PPMode | |
Fields
| |
Varieties of layout we can use.
Constructors
| PPDefault | classical layout |
| PPNoLayout | everything on a single line |
The default mode: pretty-print using sensible defaults.