Portability | portable |
---|---|
Stability | experimental |
Maintainer | Alex Kropivny <alex.kropivny@gmail.com> |
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.
Style | |
|
data Mode
Rendering mode.
PageMode | Normal |
ZigZagMode | With zig-zag cuts |
LeftMode | No indentation, infinitely long lines |
OneLineMode | All on one line |
CoreErlang formatting modes
Pretty-printing parameters.
PPMode | |
|
Varieties of layout we can use.
PPDefault | classical layout |
PPNoLayout | everything on a single line |
The default mode: pretty-print using sensible defaults.