-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A pretty-print library that employs a dynamic programming algorithm for optimal rendering.
--
@package dynamic-pp
@version 0.2.0
-- | A pretty printer implementation, based loosely on the Wadler-Leijin
-- pretty printer, but redesigned to facilitate a dynamic programming
-- optimal layout algorithm.
--
-- This pretty printer module trades some of the generality of the
-- Wadler-Leijin scheme in order to facilitate an efficient optimizing
-- layout engine. The nesting, column, and width combinators are removed.
module Text.Format
data Doc
-- | Graphics options for ANSI terminals. All options are wrapped in the
-- Maybe datatype, with Nothing meaning "leave this option
-- as-is".
data Graphics
-- | Set options on the terminal, or keep the current setting in the case
-- of Nothing.
Options :: !(Maybe ConsoleIntensity) -> !(Maybe Underlining) -> !(Maybe BlinkSpeed) -> !(Maybe (Color, ColorIntensity)) -> !(Maybe (Color, ColorIntensity)) -> !(Maybe Bool) -> Graphics
-- | Console intensity.
consoleIntensity :: Graphics -> !(Maybe ConsoleIntensity)
-- | Underlining.
underlining :: Graphics -> !(Maybe Underlining)
-- | Blinking speed.
blinkSpeed :: Graphics -> !(Maybe BlinkSpeed)
-- | Foreground color and intensity.
foreground :: Graphics -> !(Maybe (Color, ColorIntensity))
-- | Background color and intensity.
background :: Graphics -> !(Maybe (Color, ColorIntensity))
-- | Whether or not to swap the foreground and background.
swapForegroundBackground :: Graphics -> !(Maybe Bool)
-- | Reset the terminal in this mode.
Default :: Graphics
-- | A class representing datatypes that can be formatted as Docs.
class Format item where formatList = list . map format
format :: Format item => item -> Doc
formatList :: Format item => [item] -> Doc
-- | A class representing datatypes that can be formatted as Docs
-- inside a monad.
class Monad m => FormatM m item where formatListM = liftM list . mapM formatM
formatM :: FormatM m item => item -> m Doc
formatListM :: FormatM m item => [item] -> m Doc
-- | An empty Doc.
empty :: Doc
-- | A Doc consisting of a linebreak, that is not turned into a
-- space when erased by a group.
line :: Doc
-- | A Doc consisting of a linebreak, that is turned into a space
-- when erased by a group.
linebreak :: Doc
-- | A Doc consisting of a linebreak that cannot be erased by a
-- group.
hardline :: Doc
-- | A Doc consisting of a space character, that can be turned into
-- a linebreak in order to break lines that are too long.
softline :: Doc
-- | An empty Doc that can be turned into a linebreak in order to
-- break lines that are too long.
softbreak :: Doc
-- | A Doc containing a single character.
char :: Char -> Doc
-- | Create a Doc containing a string.
string :: String -> Doc
-- | Create a Doc containing a bytestring.
bytestring :: ByteString -> Doc
-- | Create a Doc containing a lazy bytestring
lazyBytestring :: ByteString -> Doc
-- | The character (
lparen :: Doc
-- | The character )
rparen :: Doc
-- | The character [
lbrack :: Doc
-- | The character ]
rbrack :: Doc
-- | The character {
lbrace :: Doc
-- | The character }
rbrace :: Doc
-- | The character <
langle :: Doc
-- | The character >
rangle :: Doc
-- | The character '
squote :: Doc
-- | The character "
dquote :: Doc
-- | The character `
backquote :: Doc
-- | The character ,
comma :: Doc
-- | The character ;
semi :: Doc
-- | The character :
colon :: Doc
-- | The character .
dot :: Doc
-- | The character \
backslash :: Doc
-- | The character =
equals :: Doc
-- | A space character.
space :: Doc
-- | Increase the indentation level of a document by some amount.
nest :: Int -> Doc -> Doc
-- | Increase the indentation level of a document by some amount.
indent :: Int -> Doc -> Doc
-- | Set the indentation level to the current column.
align :: Doc -> Doc
-- | Enclose a Doc in single quotes
squoted :: Doc -> Doc
-- | Enclose a Doc in double quotes
dquoted :: Doc -> Doc
-- | Enclose a Doc in paretheses
parens :: Doc -> Doc
-- | Enclose a Doc in brackets
brackets :: Doc -> Doc
-- | Enclose a Doc in braces
braces :: Doc -> Doc
-- | Enclose a Doc in angles
angles :: Doc -> Doc
-- | Render a list, enclosed in brackets and separated by commas.
list :: [Doc] -> Doc
-- | Set the graphics mode on a document.
graphics :: Graphics -> Doc -> Doc
-- | Color a Doc dull white.
dullWhite :: Doc -> Doc
-- | Color a Doc dull red.
dullRed :: Doc -> Doc
-- | Color a Doc dull yellow.
dullYellow :: Doc -> Doc
-- | Color a Doc dull green.
dullGreen :: Doc -> Doc
-- | Color a Doc dull blue.
dullBlue :: Doc -> Doc
-- | Color a Doc dull cyan.
dullCyan :: Doc -> Doc
-- | Color a Doc dull magenta.
dullMagenta :: Doc -> Doc
-- | Color a Doc dull black.
dullBlack :: Doc -> Doc
-- | Color a Doc vivid white.
vividWhite :: Doc -> Doc
-- | Color a Doc vivid red.
vividRed :: Doc -> Doc
-- | Color a Doc vivid yellow.
vividYellow :: Doc -> Doc
-- | Color a Doc vivid green.
vividGreen :: Doc -> Doc
-- | Color a Doc vivid blue.
vividBlue :: Doc -> Doc
-- | Color a Doc vivid cyan.
vividCyan :: Doc -> Doc
-- | Color a Doc vivid magenta.
vividMagenta :: Doc -> Doc
-- | Color a Doc vivid black.
vividBlack :: Doc -> Doc
-- | Color a Docs background dull white.
dullWhiteBackground :: Doc -> Doc
-- | Color a Docs background dull red.
dullRedBackground :: Doc -> Doc
-- | Color a Docs background dull yellow.
dullYellowBackground :: Doc -> Doc
-- | Color a Docs background dull green.
dullGreenBackground :: Doc -> Doc
-- | Color a Docs background dull blue.
dullBlueBackground :: Doc -> Doc
-- | Color a Docs background dull cyan.
dullCyanBackground :: Doc -> Doc
-- | Color a Docs background dull magenta.
dullMagentaBackground :: Doc -> Doc
-- | Color a Docs background dull black.
dullBlackBackground :: Doc -> Doc
-- | Color a Docs background vivid white.
vividWhiteBackground :: Doc -> Doc
-- | Color a Docs background vivid red.
vividRedBackground :: Doc -> Doc
-- | Color a Docs background vivid yellow.
vividYellowBackground :: Doc -> Doc
-- | Color a Docs background vivid green.
vividGreenBackground :: Doc -> Doc
-- | Color a Docs background vivid blue.
vividBlueBackground :: Doc -> Doc
-- | Color a Docs background vivid cyan.
vividCyanBackground :: Doc -> Doc
-- | Color a Docs background vivid magenta.
vividMagentaBackground :: Doc -> Doc
-- | Color a Docs background vivid black.
vividBlackBackground :: Doc -> Doc
-- | Joun Docs with no space in between them.
beside :: Doc -> Doc -> Doc
-- | Concatenate a list of Docs. This is generally more efficient
-- than repeatedly using beside or <>.
concat :: [Doc] -> Doc
-- | A choice of several options. Only one of these will be chosen and used
-- to render the final document.
choose :: [Doc] -> Doc
-- | Join two Docs with no space in between.
(<>) :: Doc -> Doc -> Doc
-- | Join two Docs with a space in between them.
(<+>) :: Doc -> Doc -> Doc
-- | Join two Docs with a hardline in between them.
() :: Doc -> Doc -> Doc
-- | Join two Docs with a line in between them.
(<$>) :: Doc -> Doc -> Doc
-- | Join two Docs with a linebreak in between them.
(<$$>) :: Doc -> Doc -> Doc
-- | Join two Docs with a softline in between them.
(>) :: Doc -> Doc -> Doc
-- | Join two Docs with a softbreak in between them.
(/>) :: Doc -> Doc -> Doc
-- | Join a list of Docs with spaces in between each. This is
-- generally more efficient than repeatedly using <+>.
hsep :: [Doc] -> Doc
-- | Concatenate a list of Docs. This is generally more efficient
-- than repeatedly using beside or <>.
hcat :: [Doc] -> Doc
-- | Join a list of Docs with lines in between each. This is
-- generally more efficient than repeatedly using <$$>.
vsep :: [Doc] -> Doc
-- | Join a list of Docs with linebreaks in between each.
-- This is generally more efficient than repeatedly using
-- <$>.
vcat :: [Doc] -> Doc
-- | Join a list of Docs using either hsep or vsep.
sep :: [Doc] -> Doc
-- | Join a list of Docs using either hcat or vcat.
cat :: [Doc] -> Doc
-- | Join a list of Docs with softlines in between each. This
-- is generally more efficient than repeatedly using </>.
fillSep :: [Doc] -> Doc
-- | Join a list of Docs with softbreaks in between each.
-- This is generally more efficient than repeatedly using
-- <//>.
fillCat :: [Doc] -> Doc
-- | Enclose a Doc within two other Docs
enclose :: Doc -> Doc -> Doc -> Doc
-- | Concatenate a list of Docs into a single doc, with each element
-- separated from the others by a given Doc representing
-- punctuation.
punctuate :: Doc -> [Doc] -> [Doc]
-- | Enclose a list of Docs, separated by punctuation, and align
-- nesting of the contents to the end of the left enclosing Doc
encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
-- | Erase all linebreaks in a Doc and replace them with either
-- spaces or nothing, depending on the kind of linebreak.
flatten :: Doc -> Maybe Doc
-- | A Doc that chooses between the unmodified argument, or
-- the flattened version of the argument.
group :: Doc -> Doc
-- | Render the entire Doc to one line. Good for output that will be
-- read only by a machine, where newlines are not important at all
renderOneLine :: Doc -> ByteString
-- | Produce a Builder that renders the Doc to one line.
buildOneLine :: Doc -> Builder
-- | Output the entire Doc, as rendered by renderOneLine to
-- the given Handle.
putOneLine :: Handle -> Doc -> IO ()
-- | Render the entire Doc, preserving newlines, but without any
-- indentation. Good for output that will be read only by machine, but
-- where newlines matter.
renderFast :: Doc -> ByteString
-- | Produce a Builder that renders the Doc quickly.
buildFast :: Doc -> Builder
-- | Output the entire Doc, as rendered by renderFast to the
-- given Handle.
putFast :: Handle -> Doc -> IO ()
-- | Render a Doc as a lazy bytestring using an optimal layout
-- rendering engine. The engine will render the document in the fewest
-- number of lines possible without exceeding the maximum column width.
renderOptimal :: Int -> Bool -> Doc -> ByteString
-- | Produce a Builder that renders the Doc using the optimal
-- layout engine.
buildOptimal :: Int -> Bool -> Doc -> Builder
-- | Output the entire Doc, as rendered by renderOptimal to
-- the given Handle.
putOptimal :: Handle -> Int -> Bool -> Doc -> IO ()
instance Ord LineKind
instance Eq LineKind
instance Enum LineKind
instance Ord Graphics
instance Eq Graphics
instance Eq Doc
instance Show Column
instance Show Indent
instance Format Double
instance Format Float
instance Format Word
instance Format Integer
instance Format Int
instance Format ByteString
instance Format ByteString
instance Format String
instance Format Doc
instance Format a => Format [a]
instance Eq Column
instance Ord Column
instance Hashable Column
instance Hashable Graphics
instance Hashable Doc
instance Hashable LineKind
instance Ord Doc