uulib-0.9.15: Haskell Utrecht Tools Library

Safe Haskell | Safe-Inferred

UU.PPrint

Description

Synopsis

- data Doc
- class Pretty a where
  - pretty :: a -> Doc
- show :: Show a => a -> String
- putDoc :: Doc -> IO ()
- hPutDoc :: Handle -> Doc -> IO ()
- (<>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (</>) :: Doc -> Doc -> Doc
- (<//>) :: Doc -> Doc -> Doc
- (<$>) :: Doc -> Doc -> Doc
- (<$$>) :: Doc -> Doc -> Doc
- sep :: [Doc] -> Doc
- fillSep :: [Doc] -> Doc
- hsep :: [Doc] -> Doc
- vsep :: [Doc] -> Doc
- cat :: [Doc] -> Doc
- fillCat :: [Doc] -> Doc
- hcat :: [Doc] -> Doc
- vcat :: [Doc] -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- align :: Doc -> Doc
- hang :: Int -> Doc -> Doc
- indent :: Int -> Doc -> Doc
- fill :: Int -> Doc -> Doc
- fillBreak :: Int -> Doc -> Doc
- list :: [Doc] -> Doc
- tupled :: [Doc] -> Doc
- semiBraces :: [Doc] -> Doc
- encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
- angles :: Doc -> Doc
- langle :: Doc
- rangle :: Doc
- parens :: Doc -> Doc
- lparen :: Doc
- rparen :: Doc
- braces :: Doc -> Doc
- lbrace :: Doc
- rbrace :: Doc
- brackets :: Doc -> Doc
- lbracket :: Doc
- rbracket :: Doc
- dquotes :: Doc -> Doc
- dquote :: Doc
- squotes :: Doc -> Doc
- squote :: Doc
- comma :: Doc
- space :: Doc
- dot :: Doc
- backslash :: Doc
- semi :: Doc
- colon :: Doc
- equals :: Doc
- string :: [Char] -> Doc
- bool :: Bool -> Doc
- int :: Int -> Doc
- integer :: Integer -> Doc
- float :: Float -> Doc
- double :: Double -> Doc
- rational :: Rational -> Doc
- softline :: Doc
- softbreak :: Doc
- empty :: Doc
- char :: Char -> Doc
- text :: [Char] -> Doc
- line :: Doc
- linebreak :: Doc
- nest :: Int -> Doc -> Doc
- group :: Doc -> Doc
- column :: (Int -> Doc) -> Doc
- nesting :: (Int -> Doc) -> Doc
- width :: Doc -> (Int -> Doc) -> Doc
- data SimpleDoc
  - = SEmpty
  - | SChar Char SimpleDoc
  - | SText !Int String SimpleDoc
  - | SLine !Int SimpleDoc
- renderPretty :: Float -> Int -> Doc -> SimpleDoc
- renderCompact :: Doc -> SimpleDoc
- displayS :: SimpleDoc -> ShowS
- displayIO :: Handle -> SimpleDoc -> IO ()

# Documentation

data Doc Source

Instances

Show Doc |
Pretty Doc |

class Pretty a where Source

Methods

pretty :: a -> Doc Source

Instances

Pretty Bool |
Pretty Char |
Pretty Double |
Pretty Float |
Pretty Int |
Pretty Integer |
Pretty () |
Pretty Doc |
Pretty a => Pretty [a] |
Pretty a => Pretty (Maybe a) |
(Pretty a, Pretty b) => Pretty (a, b) |
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) |

show :: Show a => a -> String

A specialised variant of `showsPrec`, using precedence context zero, and returning an ordinary `String`.

putDoc :: Doc -> IO ()Source

hPutDoc :: Handle -> Doc -> IO ()Source

(<>) :: Doc -> Doc -> Doc Source

(<+>) :: Doc -> Doc -> Doc Source

(</>) :: Doc -> Doc -> Doc Source

(<//>) :: Doc -> Doc -> Doc Source

(<$>) :: Doc -> Doc -> Doc Source

(<$$>) :: Doc -> Doc -> Doc Source

sep :: [Doc] -> Doc Source

fillSep :: [Doc] -> Doc Source

hsep :: [Doc] -> Doc Source

vsep :: [Doc] -> Doc Source

cat :: [Doc] -> Doc Source

fillCat :: [Doc] -> Doc Source

hcat :: [Doc] -> Doc Source

vcat :: [Doc] -> Doc Source

punctuate :: Doc -> [Doc] -> [Doc]Source

align :: Doc -> Doc Source

hang :: Int -> Doc -> Doc Source

indent :: Int -> Doc -> Doc Source

fill :: Int -> Doc -> Doc Source

fillBreak :: Int -> Doc -> Doc Source

list :: [Doc] -> Doc Source

tupled :: [Doc] -> Doc Source

semiBraces :: [Doc] -> Doc Source

encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc Source

angles :: Doc -> Doc Source

langle :: Doc Source

rangle :: Doc Source

parens :: Doc -> Doc Source

lparen :: Doc Source

rparen :: Doc Source

braces :: Doc -> Doc Source

lbrace :: Doc Source

rbrace :: Doc Source

brackets :: Doc -> Doc Source

lbracket :: Doc Source

rbracket :: Doc Source

dquotes :: Doc -> Doc Source

dquote :: Doc Source

squotes :: Doc -> Doc Source

squote :: Doc Source

comma :: Doc Source

space :: Doc Source

dot :: Doc Source

backslash :: Doc Source

semi :: Doc Source

colon :: Doc Source

equals :: Doc Source

string :: [Char] -> Doc Source

bool :: Bool -> Doc Source

int :: Int -> Doc Source

integer :: Integer -> Doc Source

float :: Float -> Doc Source

double :: Double -> Doc Source

rational :: Rational -> Doc Source

softline :: Doc Source

softbreak :: Doc Source

empty :: Doc Source

char :: Char -> Doc Source

text :: [Char] -> Doc Source

line :: Doc Source

linebreak :: Doc Source

nest :: Int -> Doc -> Doc Source

group :: Doc -> Doc Source

column :: (Int -> Doc) -> Doc Source

nesting :: (Int -> Doc) -> Doc Source

width :: Doc -> (Int -> Doc) -> Doc Source

data SimpleDoc Source

Constructors

SEmpty |
SChar Char SimpleDoc |
SText !Int String SimpleDoc |
SLine !Int SimpleDoc |

renderPretty :: Float -> Int -> Doc -> SimpleDoc Source

renderCompact :: Doc -> SimpleDoc Source

displayS :: SimpleDoc -> ShowS Source

displayIO :: Handle -> SimpleDoc -> IO ()Source