 | Haskell Hierarchical Libraries (haskell-src package) | Contents | Index |
|
| Language.Haskell.Pretty | | Portability | portable | | Stability | experimental | | Maintainer | libraries@haskell.org |
|
|
|
|
|
| Description |
| Pretty printer for Haskell.
|
|
| Synopsis |
|
|
|
|
| Pretty printing |
|
| class Pretty a |
|
|
| prettyPrintStyleMode :: Pretty a => Style -> PPHsMode -> a -> String |
| pretty-print with a given style and mode. |
|
| prettyPrintWithMode :: Pretty a => PPHsMode -> a -> String |
| pretty-print with the default style and a given mode. |
|
| prettyPrint :: Pretty a => a -> String |
| pretty-print with the default style and defaultMode. |
|
| Pretty-printing styles (from Text.PrettyPrint.HughesPJ) |
|
| Style (Style, mode, lineLength, ribbonsPerLine) |
|
| style |
|
| Mode (PageMode, ZigZagMode, LeftMode, OneLineMode) |
|
| Haskell formatting modes |
|
| data PPHsMode |
| Pretty-printing parameters. | | Constructors | | PPHsMode | | | classIndent :: Indent | indentation of a class or instance | | doIndent :: Indent | indentation of a do-expression | | caseIndent :: Indent | indentation of the body of a
case expression | | letIndent :: Indent | indentation of the declarations in a
let expression | | whereIndent :: Indent | indentation of the declarations in a
where clause | | onsideIndent :: Indent | indentation added for continuation
lines that would otherwise be offside | | spacing :: Bool | blank lines between statements? | | layout :: PPLayout | Pretty-printing style to use | | linePragmas :: Bool | add GHC-style LINE pragmas to output? | | comments :: Bool | not implemented yet |
|
|
|
|
| type Indent = Int |
|
| data PPLayout |
| Varieties of layout we can use. | | Constructors | | PPOffsideRule | classical layout | | PPSemiColon | classical layout made explicit | | PPInLine | inline decls, with newlines between them | | PPNoLayout | everything on a single line |
| | Instances | |
|
|
| defaultMode :: PPHsMode |
| The default mode: pretty-print using the offside rule and sensible
defaults. |
|
| Produced by Haddock version 0.6 |