Copyright | (c) 2013 - 2014 Björn Peemöller |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Curry.Base.Pretty
Description
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
- maybePP :: (a -> Doc) -> Maybe a -> Doc
- blankLine :: Doc
- ($++$) :: Doc -> Doc -> Doc
- sepByBlankLine :: [Doc] -> Doc
- dot :: Doc
- appPrec :: Int
- larrow :: Doc
- rarrow :: 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
.
Minimal complete definition
Methods
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.
Instances
Pretty Bool Source # | Instance for |
Pretty Char Source # | Instance for |
Pretty Double Source # | Instance for |
Pretty Float Source # | Instance for |
Pretty Int Source # | Instance for |
Pretty Integer Source # | Instance for |
Pretty Ordering Source # | Instance for |
Pretty () Source # | Instance for '()' |
Pretty SrcRef Source # | |
Pretty Position Source # | |
Pretty Span Source # | |
Pretty Message Source # | |
Pretty QualIdent Source # | |
Pretty Ident Source # | |
Pretty ModuleIdent Source # | |
Pretty a => Pretty [a] Source # | Instance for '[]' |
Pretty a => Pretty (Maybe a) Source # | Instance for |
(Pretty a, Pretty b) => Pretty (Either a b) Source # | Instance for |
(Pretty a, Pretty b) => Pretty (a, b) Source # | Instance for '(,)' |
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) Source # | Instance for '(,,)' |
(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d) Source # | Instance for '(,,,)' |
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e) => Pretty (a, b, c, d, e) Source # | Instance for '(,,,,)' |
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f) => Pretty (a, b, c, d, e, f) Source # | Instance for '(,,,,,)' |
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g) => Pretty (a, b, c, d, e, f, g) Source # | Instance for '(,,,,,,)' |
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h) => Pretty (a, b, c, d, e, f, g, h) Source # | Instance for '(,,,,,,,)' |
($++$) :: Doc -> Doc -> Doc Source #
Above with a blank line in between. If one of the documents is empty, then the other document is returned.
module Text.PrettyPrint