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


-- | A prettyprinting library for laying out text documents.
--   
--   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.4


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

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

-- | 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

-- | 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.
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 -> [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

-- | 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
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]
instance GHC.Generics.Generic (Text.DocLayout.Doc a)
instance Data.Data.Data a => Data.Data.Data (Text.DocLayout.Doc a)
instance Data.Traversable.Traversable Text.DocLayout.Doc
instance Data.Foldable.Foldable Text.DocLayout.Doc
instance GHC.Base.Functor Text.DocLayout.Doc
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.DocLayout.Doc a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.DocLayout.Doc a)
instance GHC.Read.Read a => GHC.Read.Read (Text.DocLayout.Doc a)
instance GHC.Show.Show a => GHC.Show.Show (Text.DocLayout.Doc a)
instance GHC.Show.Show Text.DocLayout.MatchState
instance GHC.Classes.Eq Text.DocLayout.UnicodeWidth
instance GHC.Show.Show Text.DocLayout.UnicodeWidth
instance GHC.Show.Show Text.DocLayout.EmojiInfo
instance GHC.Classes.Eq Text.DocLayout.EmojiInfo
instance GHC.Base.Semigroup Text.DocLayout.EmojiInfo
instance GHC.Base.Semigroup (Text.DocLayout.Doc a)
instance GHC.Base.Monoid (Text.DocLayout.Doc a)
instance Text.DocLayout.HasChars a => Data.String.IsString (Text.DocLayout.Doc a)
instance Text.DocLayout.HasChars Data.Text.Internal.Text
instance Text.DocLayout.HasChars GHC.Base.String
instance Text.DocLayout.HasChars Data.Text.Internal.Lazy.Text
