-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Pretty-printing library -- -- This package contains John Hughes's pretty-printing library, heavily -- modified by Simon Peyton Jones. @package pretty @version 1.0.1.2 -- | John Hughes's and Simon Peyton Jones's Pretty Printer Combinators -- -- Based on The Design of a Pretty-printing Library in Advanced -- Functional Programming, Johan Jeuring and Erik Meijer (eds), LNCS 925 -- http://www.cs.chalmers.se/~rjmh/Papers/pretty.ps -- -- Heavily modified by Simon Peyton Jones, Dec 96 module Text.PrettyPrint.HughesPJ -- | The abstract type of documents. The Show instance is equivalent -- to using render. data Doc -- | A document of height and width 1, containing a literal character. char :: Char -> Doc -- | A document of height 1 containing a literal string. text -- satisfies the following laws: -- -- -- -- The side condition on the last law is necessary because -- text "" has height 1, while empty has no -- height. text :: String -> Doc -- | An obsolete function, now identical to text. ptext :: String -> Doc -- | Some text, but without any width. Use for non-printing text such as a -- HTML or Latex tags zeroWidthText :: String -> Doc -- |
--   int n = text (show n)
--   
int :: Int -> Doc -- |
--   integer n = text (show n)
--   
integer :: Integer -> Doc -- |
--   float n = text (show n)
--   
float :: Float -> Doc -- |
--   double n = text (show n)
--   
double :: Double -> Doc -- |
--   rational n = text (show n)
--   
rational :: Rational -> Doc -- | A ';' character semi :: Doc -- | A ',' character comma :: Doc -- | A : character colon :: Doc -- | A space character space :: Doc -- | A '=' character equals :: Doc -- | A '(' character lparen :: Doc -- | A ')' character rparen :: Doc -- | A '[' character lbrack :: Doc -- | A ']' character rbrack :: Doc -- | A '{' character lbrace :: Doc -- | A '}' character rbrace :: Doc -- | Wrap document in (...) parens :: Doc -> Doc -- | Wrap document in [...] brackets :: Doc -> Doc -- | Wrap document in {...} braces :: Doc -> Doc -- | Wrap document in '...' quotes :: Doc -> Doc -- | Wrap document in "..." doubleQuotes :: Doc -> Doc -- | The empty document, with no height and no width. empty is the -- identity for <>, <+>, $$ and -- $+$, and anywhere in the argument list for sep, -- hcat, hsep, vcat, fcat etc. empty :: Doc -- | Beside. <> is associative, with identity empty. (<>) :: Doc -> Doc -> Doc -- | Beside, separated by space, unless one of the arguments is -- empty. <+> is associative, with identity -- empty. (<+>) :: Doc -> Doc -> Doc -- | List version of <>. hcat :: [Doc] -> Doc -- | List version of <+>. hsep :: [Doc] -> Doc -- | Above, except that if the last line of the first argument stops at -- least one position before the first line of the second begins, these -- two lines are overlapped. For example: -- --
--   text "hi" $$ nest 5 (text "there")
--   
-- -- lays out as -- --
--   hi   there
--   
-- -- rather than -- --
--   hi
--        there
--   
-- -- $$ is associative, with identity empty, and also -- satisfies -- -- ($$) :: Doc -> Doc -> Doc -- | Above, with no overlapping. $+$ is associative, with identity -- empty. ($+$) :: Doc -> Doc -> Doc -- | List version of $$. vcat :: [Doc] -> Doc -- | Either hsep or vcat. sep :: [Doc] -> Doc -- | Either hcat or vcat. cat :: [Doc] -> Doc -- | "Paragraph fill" version of sep. fsep :: [Doc] -> Doc -- | "Paragraph fill" version of cat. fcat :: [Doc] -> Doc -- | Nest (or indent) a document by a given number of positions (which may -- also be negative). nest satisfies the laws: -- -- -- -- The side condition on the last law is needed because empty is a -- left identity for <>. nest :: Int -> Doc -> Doc -- |
--   hang d1 n d2 = sep [d1, nest n d2]
--   
hang :: Doc -> Int -> Doc -> Doc -- |
--   punctuate p [d1, ... dn] = [d1 <> p, d2 <> p, ... dn-1 <> p, dn]
--   
punctuate :: Doc -> [Doc] -> [Doc] -- | Returns True if the document is empty isEmpty :: Doc -> Bool -- | Renders the document as a string using the default style. render :: Doc -> String -- | A rendering style. data Style Style :: Mode -> Int -> Float -> Style -- | The rendering mode [mode] :: Style -> Mode -- | Length of line, in chars [lineLength] :: Style -> Int -- | Ratio of ribbon length to line length [ribbonsPerLine] :: Style -> Float -- | The default style (mode=PageMode, lineLength=100, -- ribbonsPerLine=1.5). style :: Style -- | Render the document as a string using a specified style. renderStyle :: Style -> Doc -> String -- | The general rendering interface. fullRender :: Mode -> Int -> Float -> (TextDetails -> a -> a) -> a -> Doc -> a -- | Rendering mode. data Mode -- | Normal PageMode :: Mode -- | With zig-zag cuts ZigZagMode :: Mode -- | No indentation, infinitely long lines LeftMode :: Mode -- | All on one line OneLineMode :: Mode data TextDetails Chr :: Char -> TextDetails Str :: String -> TextDetails PStr :: String -> TextDetails instance GHC.Show.Show Text.PrettyPrint.HughesPJ.Doc -- | Re-export of Text.PrettyPrint.HughesPJ to provide a default -- pretty-printing library. Marked experimental at the moment; the -- default library might change at a later date. module Text.PrettyPrint