uulib-0.9.24: Haskell Utrecht Tools Library

Safe Haskell | Safe-Inferred
Language | Haskell98

UU.PPrint

Description

Synopsis

- data Doc
- class Pretty a
- pretty :: Pretty a => 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 :: String -> 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

Instances details

Show Doc Source # |
Instance details Defined in UU.PPrint Methods showsPrec :: Int -> Doc -> ShowS Source # show :: Doc -> String Source # showList :: [Doc] -> ShowS Source #
Pretty Doc Source # |
Instance details Defined in UU.PPrint Methods pretty :: Doc -> Doc Source # prettyList :: [Doc] -> Doc

class Pretty a Source #

Minimal complete definition

pretty

#### Instances

Instances details

Pretty Doc Source # |
Instance details Defined in UU.PPrint Methods pretty :: Doc -> Doc Source # prettyList :: [Doc] -> Doc
Pretty Integer Source # |
Instance details Defined in UU.PPrint Methods pretty :: Integer -> Doc Source # prettyList :: [Integer] -> Doc
Pretty () Source # |
Instance details Defined in UU.PPrint Methods pretty :: () -> Doc Source # prettyList :: [()] -> Doc
Pretty Bool Source # |
Instance details Defined in UU.PPrint Methods pretty :: Bool -> Doc Source # prettyList :: [Bool] -> Doc
Pretty Char Source # |
Instance details Defined in UU.PPrint Methods pretty :: Char -> Doc Source # prettyList :: [Char] -> Doc
Pretty Double Source # |
Instance details Defined in UU.PPrint Methods pretty :: Double -> Doc Source # prettyList :: [Double] -> Doc
Pretty Float Source # |
Instance details Defined in UU.PPrint Methods pretty :: Float -> Doc Source # prettyList :: [Float] -> Doc
Pretty Int Source # |
Instance details Defined in UU.PPrint Methods pretty :: Int -> Doc Source # prettyList :: [Int] -> Doc
Pretty a => Pretty (Maybe a) Source # |
Instance details Defined in UU.PPrint Methods pretty :: Maybe a -> Doc Source # prettyList :: [Maybe a] -> Doc
Pretty a => Pretty [a] Source # |
Instance details Defined in UU.PPrint Methods pretty :: [a] -> Doc Source # prettyList :: [[a]] -> Doc
(Pretty a, Pretty b) => Pretty (a, b) Source # |
Instance details Defined in UU.PPrint Methods pretty :: (a, b) -> Doc Source # prettyList :: [(a, b)] -> Doc
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) Source # |
Instance details Defined in UU.PPrint Methods pretty :: (a, b, c) -> Doc Source # prettyList :: [(a, b, c)] -> Doc

pretty :: Pretty a => a -> Doc Source #

show :: Show a => a -> String Source #

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 infixr 6 Source #

(<+>) :: Doc -> Doc -> Doc infixr 6 Source #

(</>) :: Doc -> Doc -> Doc infixr 5 Source #

(<//>) :: Doc -> Doc -> Doc infixr 5 Source #

(<$>) :: Doc -> Doc -> Doc infixr 5 Source #

(<$$>) :: Doc -> Doc -> Doc infixr 5 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 :: String -> 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 #