Copyright | (c) 2013 - 2014 Björn Peemöller 2016 Finn Teegen |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module re-exports the well known pretty printing combinators
from Hughes and Peyton-Jones. In addition, it re-exports the type class
Pretty
for pretty printing arbitrary types.
- class Pretty a where
- prettyShow :: Pretty a => a -> String
- parenIf :: Bool -> Doc -> Doc
- ppIf :: Bool -> Doc -> Doc
- maybePP :: (a -> Doc) -> Maybe a -> Doc
- blankLine :: Doc
- ($++$) :: Doc -> Doc -> Doc
- ($-$) :: Doc -> Doc -> Doc
- sepByBlankLine :: [Doc] -> Doc
- dot :: Doc
- appPrec :: Int
- larrow :: Doc
- rarrow :: Doc
- darrow :: Doc
- backQuote :: Doc
- backsl :: Doc
- vbar :: Doc
- bquotes :: Doc -> Doc
- bquotesIf :: Bool -> Doc -> Doc
- list :: [Doc] -> Doc
- module Text.PrettyPrint
Documentation
Pretty printing class.
The precedence level is used in a similar way as in the Show
class.
Minimal complete definition is either pPrintPrec
or pPrint
.
Pretty-print something in isolation.
pPrintPrec :: Int -> a -> Doc Source #
Pretty-print something in a precedence context.
pPrintList :: [a] -> Doc Source #
Pretty-print a list.
($++$) :: Doc -> Doc -> Doc Source #
Above with a blank line in between. If one of the documents is empty, then the other document is returned.
($-$) :: Doc -> Doc -> Doc Source #
Above with overlapping, but with a space in between. If one of the documents is empty, then the other document is returned.
module Text.PrettyPrint