Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- type PP_Doc = Doc
- class Show a => PP a where
- disp :: PP_Doc -> Int -> ShowS
- hPut :: Handle -> PP_Doc -> Int -> IO ()
- data Doc
- (>|<) :: (PP a, PP b) => a -> b -> PP_Doc
- (>-<) :: (PP a, PP b) => a -> b -> PP_Doc
- (>#<) :: (PP a, PP b) => a -> b -> PP_Doc
- hlist :: PP a => [a] -> PP_Doc
- hlistReverse :: PP a => [a] -> PP_Doc
- vlist :: PP a => [a] -> PP_Doc
- hv :: PP a => [a] -> PP_Doc
- fill :: PP a => [a] -> PP_Doc
- indent :: PP a => Int -> a -> PP_Doc
- empty :: PP_Doc
- text :: String -> PP_Doc
- isSingleLine :: PP_Doc -> Bool
- type PP_DocL = [PP_Doc]
- (>-|-<) :: (PP a, PP b) => a -> b -> PP_Doc
- (>-#-<) :: (PP a, PP b) => a -> b -> PP_Doc
- ppListSep :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc
- ppListSepV :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc
- ppListSepVV :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc
- ppCurlys :: PP p => p -> PP_Doc
- ppPacked :: (PP o, PP c, PP p) => o -> c -> p -> PP_Doc
- ppPackedWithStrings :: PP p => String -> String -> p -> PP_Doc
- ppParens :: PP p => p -> PP_Doc
- ppCurly :: PP p => p -> PP_Doc
- ppBrackets :: PP p => p -> PP_Doc
- ppVBar :: PP p => p -> PP_Doc
- ppBlock :: (PP ocs, PP a) => ocs -> ocs -> ocs -> [a] -> PP_Doc
- ppBlockH :: (PP ocs, PP a) => ocs -> ocs -> ocs -> [a] -> PP_Doc
- ppBlock' :: (PP ocs, PP a) => ocs -> ocs -> ocs -> ocs -> [a] -> [PP_Doc]
- ppBlockWithStrings :: PP a => String -> String -> String -> [a] -> PP_Doc
- ppBlockWithStrings' :: PP a => String -> String -> String -> [a] -> [PP_Doc]
- ppBlockWithStringsH :: PP a => String -> String -> String -> [a] -> PP_Doc
- ppParensCommasBlock :: PP a => [a] -> PP_Doc
- ppCurlysBlock :: PP a => [a] -> PP_Doc
- ppCurlysSemisBlock :: PP a => [a] -> PP_Doc
- ppCurlysCommasBlock :: PP a => [a] -> PP_Doc
- ppParensSemisBlock :: PP a => [a] -> PP_Doc
- ppBracketsCommasBlock :: PP a => [a] -> PP_Doc
- ppParensCommasBlockH :: PP a => [a] -> PP_Doc
- ppCurlysBlockH :: PP a => [a] -> PP_Doc
- ppCurlysSemisBlockH :: PP a => [a] -> PP_Doc
- ppCurlysCommasBlockH :: PP a => [a] -> PP_Doc
- ppParensSemisBlockH :: PP a => [a] -> PP_Doc
- ppBracketsCommasBlockH :: PP a => [a] -> PP_Doc
- ppBracketsCommasV :: PP a => [a] -> PP_Doc
- ppVertically :: [PP_Doc] -> PP_Doc
- ppCommas :: PP a => [a] -> PP_Doc
- ppCommas' :: PP a => [a] -> PP_Doc
- ppSemis :: PP a => [a] -> PP_Doc
- ppSemis' :: PP a => [a] -> PP_Doc
- ppSpaces :: PP a => [a] -> PP_Doc
- ppCurlysCommas :: PP a => [a] -> PP_Doc
- ppCurlysCommas' :: PP a => [a] -> PP_Doc
- ppCurlysCommasWith :: PP a => (a -> PP_Doc) -> [a] -> PP_Doc
- ppCurlysSemis :: PP a => [a] -> PP_Doc
- ppCurlysSemis' :: PP a => [a] -> PP_Doc
- ppParensSpaces :: PP a => [a] -> PP_Doc
- ppParensCommas :: PP a => [a] -> PP_Doc
- ppParensCommas' :: PP a => [a] -> PP_Doc
- ppBracketsCommas :: PP a => [a] -> PP_Doc
- ppBracketsCommas' :: PP a => [a] -> PP_Doc
- ppHorizontally :: [PP_Doc] -> PP_Doc
- ppListSepFill :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc
- ppMbPre :: (PP x, PP r) => (a -> x) -> Maybe a -> r -> PP_Doc
- ppMbPost :: (PP x, PP r) => (a -> x) -> Maybe a -> r -> PP_Doc
- ppListPre :: (PP x, PP r) => ([a] -> x) -> [a] -> r -> PP_Doc
- ppListPost :: (PP x, PP r) => ([a] -> x) -> [a] -> r -> PP_Doc
- ppDots :: PP a => [a] -> PP_Doc
- ppMb :: PP a => Maybe a -> PP_Doc
- ppUnless :: PP x => Bool -> x -> PP_Doc
- ppWhen :: PP x => Bool -> x -> PP_Doc
- showPP :: PP a => a -> String
- hPutWidthPPLn :: Handle -> Int -> PP_Doc -> IO ()
- putWidthPPLn :: Int -> PP_Doc -> IO ()
- hPutPPLn :: Handle -> PP_Doc -> IO ()
- putPPLn :: PP_Doc -> IO ()
- hPutPPFile :: Handle -> PP_Doc -> Int -> IO ()
- putPPFile :: String -> PP_Doc -> Int -> IO ()
Documentation
Doc structure
(>#<) :: (PP a, PP b) => a -> b -> PP_Doc infixr 3 Source #
PP horizontally aside with 1 blank in between
hlistReverse :: PP a => [a] -> PP_Doc Source #
PP list vertically reverse
Internal use only
isSingleLine :: PP_Doc -> Bool Source #
Is single line doc?
Choice combinators
(>-|-<) :: (PP a, PP b) => a -> b -> PP_Doc infixr 2 Source #
As (>|but doing (-<) when does not fit on single line
(>-#-<) :: (PP a, PP b) => a -> b -> PP_Doc infixr 2 Source #
As (>#but doing (-<) when does not fit on single line
General PP for list
ppListSep :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc Source #
PP list with open, separator, and close
ppListSepV :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc Source #
Deprecated: Use pp...Block variants
ppListSepVV :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc Source #
Deprecated: Use pp...Block variants
Pack PP around
ppBrackets :: PP p => p -> PP_Doc Source #
Block, horizontal/vertical as required
ppBlock :: (PP ocs, PP a) => ocs -> ocs -> ocs -> [a] -> PP_Doc Source #
PP list with open, separator, and close in a possibly multiline block structure
ppBlockH :: (PP ocs, PP a) => ocs -> ocs -> ocs -> [a] -> PP_Doc Source #
PP list with open, separator, and close in a possibly multiline block structure
ppBlock' :: (PP ocs, PP a) => ocs -> ocs -> ocs -> ocs -> [a] -> [PP_Doc] Source #
PP in a blocklike fashion, vertically
ppBlockWithStrings :: PP a => String -> String -> String -> [a] -> PP_Doc Source #
See ppBlock
, but with string delimiters aligned properly
ppBlockWithStrings' :: PP a => String -> String -> String -> [a] -> [PP_Doc] Source #
See ppBlock
, but with string delimiters aligned properly, yielding a list of elements
ppBlockWithStringsH :: PP a => String -> String -> String -> [a] -> PP_Doc Source #
See ppBlock
, but with string delimiters aligned properly, preferring single line horizontal placement
ppParensCommasBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "(", ",", and ")" in a possibly multiline block structure
ppCurlysBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", " ", and "}" in a possibly multiline block structure
ppCurlysSemisBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", ";", and "}" in a possibly multiline block structure
ppCurlysCommasBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", ",", and "}" in a possibly multiline block structure
ppParensSemisBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "(", ";", and ")" in a possibly multiline block structure
ppBracketsCommasBlock :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "[", ",", and "]" in a possibly multiline block structure
ppParensCommasBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "(", ",", and ")" in a possibly multiline block structure, preferring single line horizontal placement
ppCurlysBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", " ", and "}" in a possibly multiline block structure, preferring single line horizontal placement
ppCurlysSemisBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", ";", and "}" in a possibly multiline block structure, preferring single line horizontal placement
ppCurlysCommasBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "{", ",", and "}" in a possibly multiline block structure, preferring single line horizontal placement
ppParensSemisBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "(", ";", and ")" in a possibly multiline block structure, preferring single line horizontal placement
ppBracketsCommasBlockH :: PP a => [a] -> PP_Doc Source #
PP horizontally or vertically with "[", ",", and "]" in a possibly multiline block structure
ppBracketsCommasV :: PP a => [a] -> PP_Doc Source #
Deprecated: Use ppBracketsCommasBlock
PP horizontally or vertically with "[", ",", and "]" in a possibly multiline block structure
Vertical PP of list only
Horizontal PP of list only
ppSemis' :: PP a => [a] -> PP_Doc Source #
PP horizontally: list separated by semicolon + single blank
ppCurlysCommas :: PP a => [a] -> PP_Doc Source #
PP horizontally with "{", ",", and "}"
ppCurlysCommas' :: PP a => [a] -> PP_Doc Source #
PP horizontally with "{", ", ", and "}"
ppCurlysSemis :: PP a => [a] -> PP_Doc Source #
PP horizontally with "{", ";", and "}"
ppCurlysSemis' :: PP a => [a] -> PP_Doc Source #
PP horizontally with "{", "; ", and "}"
ppParensSpaces :: PP a => [a] -> PP_Doc Source #
PP horizontally with "(", " ", and ")"
ppParensCommas :: PP a => [a] -> PP_Doc Source #
PP horizontally with "(", ",", and ")"
ppParensCommas' :: PP a => [a] -> PP_Doc Source #
PP horizontally with "(", ", ", and ")"
ppBracketsCommas :: PP a => [a] -> PP_Doc Source #
PP horizontally with "[", ",", and "]"
ppBracketsCommas' :: PP a => [a] -> PP_Doc Source #
PP horizontally with "[", ", ", and "]"
ppListSepFill :: (PP s, PP c, PP o, PP a) => o -> c -> s -> [a] -> PP_Doc Source #
Deprecated: Use ppListSep
Conditional
ppListPre :: (PP x, PP r) => ([a] -> x) -> [a] -> r -> PP_Doc Source #
Only prefix with a list and extra space when non-empty
ppListPost :: (PP x, PP r) => ([a] -> x) -> [a] -> r -> PP_Doc Source #
Only suffix with a list and extra space when non-empty