-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | doclayout is a prettyprinting library for laying out text documents,
--   with several features not present in prettyprinting libraries designed
--   for code. It was designed for use in pandoc.
@package doclayout
@version 0.5.0.1


-- | A prettyprinting library for the production of text documents,
--   including wrapped text, indentation and other prefixes, and blocks for
--   tables.
module Text.DocLayout

-- | Synonym for <a>renderPlain</a>.
render :: HasChars a => Maybe Int -> Doc a -> a

-- | Render a <a>Doc</a> without using ANSI escapes. <tt>renderPlain (Just
--   n)</tt> will use a line length of <tt>n</tt> to reflow text on
--   breakable spaces. <tt>renderPlain Nothing</tt> will not reflow text.
renderPlain :: HasChars a => Maybe Int -> Doc a -> a

-- | Render a <a>Doc</a> with ANSI escapes. <tt>renderANSI (Just n)</tt>
--   will use a line length of <tt>n</tt> to reflow text on breakable
--   spaces. <tt>renderANSI Nothing</tt> will not reflow text.
renderANSI :: HasChars a => Maybe Int -> Doc a -> Text

-- | A carriage return. Does nothing if we're at the beginning of a line;
--   otherwise inserts a newline.
cr :: Doc a

-- | Inserts a blank line unless one exists already. (<tt>blankline
--   &lt;&gt; blankline</tt> has the same effect as <tt>blankline</tt>.
blankline :: Doc a

-- | Inserts blank lines unless they exist already. (<tt>blanklines m
--   &lt;&gt; blanklines n</tt> has the same effect as <tt>blanklines (max
--   m n)</tt>.
blanklines :: Int -> Doc a

-- | A breaking (reflowable) space.
space :: Doc a

-- | Create a <a>Doc</a> from a stringlike value.
literal :: HasChars a => a -> Doc a

-- | A literal string. (Like <a>literal</a>, but restricted to String.)
text :: HasChars a => String -> Doc a

-- | A character.
char :: HasChars a => Char -> Doc a

-- | Uses the specified string as a prefix for every line of the inside
--   document (except the first, if not at the beginning of the line).
prefixed :: IsString a => String -> Doc a -> Doc a

-- | Makes a <a>Doc</a> flush against the left margin.
flush :: Doc a -> Doc a

-- | Indents a <a>Doc</a> by the specified number of spaces.
nest :: IsString a => Int -> Doc a -> Doc a

-- | A hanging indent. <tt>hang ind start doc</tt> prints <tt>start</tt>,
--   then <tt>doc</tt>, leaving an indent of <tt>ind</tt> spaces on every
--   line but the first.
hang :: IsString a => Int -> Doc a -> Doc a -> Doc a

-- | <tt>beforeNonBlank d</tt> conditionally includes <tt>d</tt> unless it
--   is followed by blank space.
beforeNonBlank :: Doc a -> Doc a

-- | Makes a <a>Doc</a> non-reflowable.
nowrap :: IsString a => Doc a -> Doc a

-- | Content to print only if it comes at the beginning of a line, to be
--   used e.g. for escaping line-initial <a>.</a> in roff man.
afterBreak :: Text -> Doc a

-- | <tt>lblock n d</tt> is a block of width <tt>n</tt> characters, with
--   text derived from <tt>d</tt> and aligned to the left.
lblock :: HasChars a => Int -> Doc a -> Doc a

-- | Like <a>lblock</a> but aligned centered.
cblock :: HasChars a => Int -> Doc a -> Doc a

-- | Like <a>lblock</a> but aligned to the right.
rblock :: HasChars a => Int -> Doc a -> Doc a

-- | An expandable border that, when placed next to a box, expands to the
--   height of the box. Strings cycle through the list provided.
vfill :: HasChars a => a -> Doc a

-- | Removes leading blank lines from a <a>Doc</a>.
nestle :: Doc a -> Doc a

-- | Chomps trailing blank space off of a <a>Doc</a>.
chomp :: Doc a -> Doc a

-- | Encloses a <a>Doc</a> inside a start and end <a>Doc</a>.
inside :: Doc a -> Doc a -> Doc a -> Doc a

-- | Puts a <a>Doc</a> in curly braces.
braces :: HasChars a => Doc a -> Doc a

-- | Puts a <a>Doc</a> in square brackets.
brackets :: HasChars a => Doc a -> Doc a

-- | Puts a <a>Doc</a> in parentheses.
parens :: HasChars a => Doc a -> Doc a

-- | Wraps a <a>Doc</a> in single quotes.
quotes :: HasChars a => Doc a -> Doc a

-- | Wraps a <a>Doc</a> in double quotes.
doubleQuotes :: HasChars a => Doc a -> Doc a

-- | Puts a <a>Doc</a> in boldface.
bold :: HasChars a => Doc a -> Doc a

-- | Puts a <a>Doc</a> in italics.
italic :: HasChars a => Doc a -> Doc a

-- | Underlines a <a>Doc</a>.
underlined :: HasChars a => Doc a -> Doc a

-- | Puts a line through a <a>Doc</a>.
strikeout :: HasChars a => Doc a -> Doc a

-- | Set foreground color.
fg :: HasChars a => Color -> Doc a -> Doc a

-- | Set background color.
bg :: HasChars a => Color -> Doc a -> Doc a
type Color = Color8
black :: Color
red :: Color
green :: Color
yellow :: Color
blue :: Color
magenta :: Color
cyan :: Color
white :: Color

-- | Make Doc a hyperlink.
link :: HasChars a => Text -> Doc a -> Doc a

-- | The empty document.
empty :: Doc a

-- | Concatenate a list of <a>Doc</a>s, putting breakable spaces between
--   them.
(<+>) :: Doc a -> Doc a -> Doc a
infixr 6 <+>

-- | <tt>a $$ b</tt> puts <tt>a</tt> above <tt>b</tt>.
($$) :: Doc a -> Doc a -> Doc a
infixr 5 $$

-- | <tt>a $+$ b</tt> puts <tt>a</tt> above <tt>b</tt>, with a blank line
--   between.
($+$) :: Doc a -> Doc a -> Doc a
infixr 5 $+$

-- | Concatenate documents horizontally.
hcat :: [Doc a] -> Doc a

-- | Same as <a>hcat</a>, but putting breakable spaces between the
--   <a>Doc</a>s.
hsep :: [Doc a] -> Doc a

-- | List version of <a>$$</a>.
vcat :: [Doc a] -> Doc a

-- | List version of <a>$+$</a>.
vsep :: [Doc a] -> Doc a

-- | True if the document is empty.
isEmpty :: Doc a -> Bool

-- | Returns the width of a <a>Doc</a>.
offset :: (IsString a, HasChars a) => Doc a -> Int

-- | Returns the minimal width of a <a>Doc</a> when reflowed at breakable
--   spaces.
minOffset :: HasChars a => Doc a -> Int

-- | Returns the column that would be occupied by the last laid out
--   character (assuming no wrapping).
updateColumn :: HasChars a => Doc a -> Int -> Int

-- | Returns the height of a block or other <a>Doc</a>.
height :: HasChars a => Doc a -> Int

-- | Returns width of a character in a monospace font: 0 for a combining
--   character, 1 for a regular character, 2 for an East Asian wide
--   character. Ambiguous characters are treated as width 1.
charWidth :: Char -> Int

-- | Get real length of string, taking into account combining and
--   double-wide characters. Ambiguous characters are treated as width 1.
realLength :: HasChars a => a -> Int

-- | Get the real length of a string, taking into account combining and
--   double-wide characters. Ambiguous characters are treated as width 1.
realLengthNarrowContext :: HasChars a => a -> Int

-- | Get the real length of a string, taking into account combining and
--   double-wide characters. Ambiguous characters are treated as width 2.
realLengthWideContext :: HasChars a => a -> Int

-- | Like <a>realLengthNarrowContext</a>, but avoids optimizations
--   (shortcuts). This is exposed for testing, to ensure that the
--   optimizations are safe.
realLengthNarrowContextNoShortcut :: HasChars a => a -> Int

-- | Like <a>realLengthWideContext</a>, but avoids optimizations
--   (shortcuts). This is exposed for testing, to ensure that the
--   optimizations are safe.
realLengthWideContextNoShortcut :: HasChars a => a -> Int

-- | Checks whether a character is a skin tone modifier.
isSkinToneModifier :: Char -> Bool

-- | Checks whether a character is an emoji variation modifier.
isEmojiVariation :: Char -> Bool

-- | Checks whether a character is a zero-width joiner.
isZWJ :: Char -> Bool

-- | Unfold a <a>Doc</a> into a flat list.

-- | <i>Deprecated: unfoldD will be removed from the API.</i>
unfoldD :: Doc a -> [Doc a]

-- | Document, including structure relevant for layout.
data Doc a

-- | Text with specified width.
Text :: Int -> a -> Doc a

-- | A block with a width and lines.
Block :: Int -> [Attributed a] -> Doc a

-- | A vertically expandable block; when concatenated with a block, expands
--   to height of block, with each line containing the specified text.
VFill :: Int -> a -> Doc a

-- | Text which doesn't need further cooking
CookedText :: Int -> Attributed a -> Doc a

-- | Doc with each line prefixed with text. Note that trailing blanks are
--   omitted from the prefix when the line after it is empty.
Prefixed :: Text -> Doc a -> Doc a

-- | Doc that renders only before nonblank.
BeforeNonBlank :: Doc a -> Doc a

-- | Doc laid out flush to left margin.
Flush :: Doc a -> Doc a

-- | A space or line break, in context.
BreakingSpace :: Doc a

-- | Text printed only at start of line.
AfterBreak :: Text -> Doc a

-- | Newline unless we're at start of line.
CarriageReturn :: Doc a

-- | newline.
NewLine :: Doc a

-- | Ensure a number of blank lines.
BlankLines :: Int -> Doc a

-- | Two documents concatenated.
Concat :: Doc a -> Doc a -> Doc a
Styled :: StyleReq -> Doc a -> Doc a

-- | A hyperlink
Linked :: Text -> Doc a -> Doc a
Empty :: Doc a

-- | Class abstracting over various string types that can fold over
--   characters. Minimal definition is <a>foldrChar</a> and
--   <a>foldlChar</a>, but defining the other methods can give better
--   performance.
class (IsString a, Semigroup a, Monoid a, Show a) => HasChars a
foldrChar :: HasChars a => (Char -> b -> b) -> b -> a -> b
foldlChar :: HasChars a => (b -> Char -> b) -> b -> a -> b
replicateChar :: HasChars a => Int -> Char -> a
isNull :: HasChars a => a -> Bool
splitLines :: HasChars a => a -> [a]
build :: HasChars a => a -> Builder

-- | A sequence of strings with font attributes.
data Attributed a
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Text.DocLayout.Doc a)
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Text.DocLayout.FlatDoc a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.DocLayout.Doc a)
instance GHC.Classes.Eq Text.DocLayout.EmojiInfo
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.DocLayout.FlatDoc a)
instance GHC.Classes.Eq Text.DocLayout.UnicodeWidth
instance GHC.Internal.Data.Foldable.Foldable Text.DocLayout.Doc
instance GHC.Internal.Data.Foldable.Foldable Text.DocLayout.FlatDoc
instance GHC.Internal.Base.Functor Text.DocLayout.Doc
instance GHC.Internal.Base.Functor Text.DocLayout.FlatDoc
instance GHC.Internal.Generics.Generic (Text.DocLayout.Doc a)
instance GHC.Internal.Generics.Generic (Text.DocLayout.FlatDoc a)
instance Text.DocLayout.HasChars.HasChars a => GHC.Internal.Data.String.IsString (Text.DocLayout.Doc a)
instance GHC.Internal.Base.Monoid (Text.DocLayout.Doc a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.DocLayout.Doc a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.DocLayout.FlatDoc a)
instance GHC.Internal.Read.Read a => GHC.Internal.Read.Read (Text.DocLayout.Doc a)
instance GHC.Internal.Read.Read a => GHC.Internal.Read.Read (Text.DocLayout.FlatDoc a)
instance GHC.Internal.Base.Semigroup (Text.DocLayout.Doc a)
instance GHC.Internal.Base.Semigroup Text.DocLayout.EmojiInfo
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.DocLayout.Doc a)
instance GHC.Internal.Show.Show Text.DocLayout.EmojiInfo
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.DocLayout.FlatDoc a)
instance GHC.Internal.Show.Show Text.DocLayout.MatchState
instance GHC.Internal.Show.Show Text.DocLayout.UnicodeWidth
instance GHC.Internal.Data.Traversable.Traversable Text.DocLayout.Doc
instance GHC.Internal.Data.Traversable.Traversable Text.DocLayout.FlatDoc
