Pretty

ghc-7.8.2: The GHC API

Safe Haskell | None
Language | Haskell98

Pretty

Synopsis

- data Doc
- data Mode
  - = PageMode
  - | ZigZagMode
  - | LeftMode
  - | OneLineMode
- data TextDetails
  - = Chr !Char
  - | Str String
  - | PStr FastString
  - | ZStr FastZString
  - | LStr !LitString FastInt
- empty :: Doc
- isEmpty :: Doc -> Bool
- nest :: Int -> Doc -> Doc
- char :: Char -> Doc
- text :: String -> Doc
- ftext :: FastString -> Doc
- ptext :: LitString -> Doc
- ztext :: FastZString -> Doc
- zeroWidthText :: String -> Doc
- int :: Int -> Doc
- integer :: Integer -> Doc
- float :: Float -> Doc
- double :: Double -> Doc
- rational :: Rational -> Doc
- parens :: Doc -> Doc
- brackets :: Doc -> Doc
- braces :: Doc -> Doc
- quotes :: Doc -> Doc
- quote :: Doc -> Doc
- doubleQuotes :: Doc -> Doc
- semi :: Doc
- comma :: Doc
- colon :: Doc
- space :: Doc
- equals :: Doc
- lparen :: Doc
- rparen :: Doc
- lbrack :: Doc
- rbrack :: Doc
- lbrace :: Doc
- rbrace :: Doc
- cparen :: Bool -> Doc -> Doc
- (<>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- hcat :: [Doc] -> Doc
- hsep :: [Doc] -> Doc
- ($$) :: Doc -> Doc -> Doc
- ($+$) :: Doc -> Doc -> Doc
- vcat :: [Doc] -> Doc
- sep :: [Doc] -> Doc
- cat :: [Doc] -> Doc
- fsep :: [Doc] -> Doc
- fcat :: [Doc] -> Doc
- hang :: Doc -> Int -> Doc -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- fullRender :: Mode -> Int -> Float -> (TextDetails -> a -> a) -> a -> Doc -> a
- printDoc :: Mode -> Int -> Handle -> Doc -> IO ()
- printDoc_ :: Mode -> Int -> Handle -> Doc -> IO ()
- showDoc :: Mode -> Int -> Doc -> String
- bufLeftRender :: BufHandle -> Doc -> IO ()

# Documentation

data Doc Source

Instances

Show Doc |

data Mode Source

Constructors

PageMode |
ZigZagMode |
LeftMode |
OneLineMode |

data TextDetails Source

Constructors

Chr !Char |
Str String |
PStr FastString |
ZStr FastZString |
LStr !LitString FastInt |

empty :: Doc Source

isEmpty :: Doc -> Bool Source

nest :: Int -> Doc -> Doc Source

char :: Char -> Doc Source

text :: String -> Doc Source

ftext :: FastString -> Doc Source

ptext :: LitString -> Doc Source

ztext :: FastZString -> Doc Source

zeroWidthText :: String -> Doc Source

Some text, but without any width. Use for non-printing text such as a HTML or Latex tags

int :: Int -> Doc Source

integer :: Integer -> Doc Source

float :: Float -> Doc Source

double :: Double -> Doc Source

rational :: Rational -> Doc Source

parens :: Doc -> Doc Source

brackets :: Doc -> Doc Source

braces :: Doc -> Doc Source

quotes :: Doc -> Doc Source

quote :: Doc -> Doc Source

doubleQuotes :: Doc -> Doc Source

semi :: Doc Source

comma :: Doc Source

colon :: Doc Source

space :: Doc Source

equals :: Doc Source

lparen :: Doc Source

rparen :: Doc Source

lbrack :: Doc Source

rbrack :: Doc Source

lbrace :: Doc Source

rbrace :: Doc Source

cparen :: Bool -> Doc -> Doc Source

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

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

hcat :: [Doc] -> Doc Source

hsep :: [Doc] -> Doc Source

($$) :: Doc -> Doc -> Doc infixl 5 Source

($+$) :: Doc -> Doc -> Doc infixl 5 Source

vcat :: [Doc] -> Doc Source

sep :: [Doc] -> Doc Source

cat :: [Doc] -> Doc Source

fsep :: [Doc] -> Doc Source

fcat :: [Doc] -> Doc Source

hang :: Doc -> Int -> Doc -> Doc Source

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

fullRender :: Mode -> Int -> Float -> (TextDetails -> a -> a) -> a -> Doc -> a Source

printDoc :: Mode -> Int -> Handle -> Doc -> IO () Source

printDoc_ :: Mode -> Int -> Handle -> Doc -> IO () Source

showDoc :: Mode -> Int -> Doc -> String Source

bufLeftRender :: BufHandle -> Doc -> IO () Source