Safe Haskell | None |
---|---|
Language | Haskell98 |
Common pretty-printing utility functions
- parens :: String -> String
- newtype PrinterState = PrinterState {}
- blockIndent :: Int
- withIndent :: StateT PrinterState Maybe String -> StateT PrinterState Maybe String
- currentIndent :: StateT PrinterState Maybe String
- prettyPrintMany :: (a -> StateT PrinterState Maybe String) -> [a] -> StateT PrinterState Maybe String
- prettyPrintObjectKey :: String -> String
- before :: Box -> Box -> Box
- beforeWithSpace :: Box -> Box -> Box
Documentation
newtype PrinterState Source
blockIndent :: Int Source
Number of characters per identation level
withIndent :: StateT PrinterState Maybe String -> StateT PrinterState Maybe String Source
Pretty print with a new indentation level
currentIndent :: StateT PrinterState Maybe String Source
Get the current indentation level
prettyPrintMany :: (a -> StateT PrinterState Maybe String) -> [a] -> StateT PrinterState Maybe String Source
Print many lines
prettyPrintObjectKey :: String -> String Source
Prints an object key, escaping reserved names.
before :: Box -> Box -> Box Source
Place a box before another, vertically when the first box takes up multiple lines.
beforeWithSpace :: Box -> Box -> Box Source