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


-- | Library exposing some functionality of Haddock.
--   
--   Haddock is a documentation-generation tool for Haskell libraries.
--   These modules expose some functionality of it without pulling in the
--   GHC dependency. Please note that the API is likely to change so
--   specify upper bounds in your project. For interacting with Haddock
--   itself, see the <a>haddock package</a>.
@package haddock-library
@version 1.7.0


-- | Exposes documentation data types used for (some) of Haddock.
module Documentation.Haddock.Types

-- | With the advent of <a>Version</a>, we may want to start attaching more
--   meta-data to comments. We make a structure for this ahead of time so
--   we don't have to gut half the core each time we want to add such info.
data Meta
Meta :: Maybe Version -> Maybe Package -> Meta
[_version] :: Meta -> Maybe Version
[_package] :: Meta -> Maybe Package
data MetaDoc mod id
MetaDoc :: Meta -> DocH mod id -> MetaDoc mod id
[_meta] :: MetaDoc mod id -> Meta
[_doc] :: MetaDoc mod id -> DocH mod id
overDoc :: (DocH a b -> DocH c d) -> MetaDoc a b -> MetaDoc c d
overDocF :: Functor f => (DocH a b -> f (DocH c d)) -> MetaDoc a b -> f (MetaDoc c d)
type Version = [Int]
type Package = String
data Hyperlink
Hyperlink :: String -> Maybe String -> Hyperlink
[hyperlinkUrl] :: Hyperlink -> String
[hyperlinkLabel] :: Hyperlink -> Maybe String
data Picture
Picture :: String -> Maybe String -> Picture
[pictureUri] :: Picture -> String
[pictureTitle] :: Picture -> Maybe String
data Header id
Header :: Int -> id -> Header id
[headerLevel] :: Header id -> Int
[headerTitle] :: Header id -> id
data Example
Example :: String -> [String] -> Example
[exampleExpression] :: Example -> String
[exampleResult] :: Example -> [String]
data TableCell id
TableCell :: Int -> Int -> id -> TableCell id
[tableCellColspan] :: TableCell id -> Int
[tableCellRowspan] :: TableCell id -> Int
[tableCellContents] :: TableCell id -> id
newtype TableRow id
TableRow :: [TableCell id] -> TableRow id
[tableRowCells] :: TableRow id -> [TableCell id]
data Table id
Table :: [TableRow id] -> [TableRow id] -> Table id
[tableHeaderRows] :: Table id -> [TableRow id]
[tableBodyRows] :: Table id -> [TableRow id]
data DocH mod id
DocEmpty :: DocH mod id
DocAppend :: DocH mod id -> DocH mod id -> DocH mod id
DocString :: String -> DocH mod id
DocParagraph :: DocH mod id -> DocH mod id
DocIdentifier :: id -> DocH mod id

-- | A qualified identifier that couldn't be resolved.
DocIdentifierUnchecked :: mod -> DocH mod id
DocModule :: String -> DocH mod id

-- | This constructor has no counterpart in Haddock markup.
DocWarning :: DocH mod id -> DocH mod id
DocEmphasis :: DocH mod id -> DocH mod id
DocMonospaced :: DocH mod id -> DocH mod id
DocBold :: DocH mod id -> DocH mod id
DocUnorderedList :: [DocH mod id] -> DocH mod id
DocOrderedList :: [DocH mod id] -> DocH mod id
DocDefList :: [(DocH mod id, DocH mod id)] -> DocH mod id
DocCodeBlock :: DocH mod id -> DocH mod id
DocHyperlink :: Hyperlink -> DocH mod id
DocPic :: Picture -> DocH mod id
DocMathInline :: String -> DocH mod id
DocMathDisplay :: String -> DocH mod id

-- | A (HTML) anchor.
DocAName :: String -> DocH mod id
DocProperty :: String -> DocH mod id
DocExamples :: [Example] -> DocH mod id
DocHeader :: Header (DocH mod id) -> DocH mod id
DocTable :: Table (DocH mod id) -> DocH mod id

-- | <a>DocMarkupH</a> is a set of instructions for marking up
--   documentation. In fact, it's really just a mapping from <tt>Doc</tt>
--   to some other type [a], where [a] is usually the type of the output
--   (HTML, say). Use <a>markup</a> to apply a <a>DocMarkupH</a> to a
--   <a>DocH</a>.
data DocMarkupH mod id a
Markup :: a -> (String -> a) -> (a -> a) -> (a -> a -> a) -> (id -> a) -> (mod -> a) -> (String -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> ([a] -> a) -> ([a] -> a) -> ([(a, a)] -> a) -> (a -> a) -> (Hyperlink -> a) -> (String -> a) -> (Picture -> a) -> (String -> a) -> (String -> a) -> (String -> a) -> ([Example] -> a) -> (Header a -> a) -> (Table a -> a) -> DocMarkupH mod id a
[markupEmpty] :: DocMarkupH mod id a -> a
[markupString] :: DocMarkupH mod id a -> String -> a
[markupParagraph] :: DocMarkupH mod id a -> a -> a
[markupAppend] :: DocMarkupH mod id a -> a -> a -> a
[markupIdentifier] :: DocMarkupH mod id a -> id -> a
[markupIdentifierUnchecked] :: DocMarkupH mod id a -> mod -> a
[markupModule] :: DocMarkupH mod id a -> String -> a
[markupWarning] :: DocMarkupH mod id a -> a -> a
[markupEmphasis] :: DocMarkupH mod id a -> a -> a
[markupBold] :: DocMarkupH mod id a -> a -> a
[markupMonospaced] :: DocMarkupH mod id a -> a -> a
[markupUnorderedList] :: DocMarkupH mod id a -> [a] -> a
[markupOrderedList] :: DocMarkupH mod id a -> [a] -> a
[markupDefList] :: DocMarkupH mod id a -> [(a, a)] -> a
[markupCodeBlock] :: DocMarkupH mod id a -> a -> a
[markupHyperlink] :: DocMarkupH mod id a -> Hyperlink -> a
[markupAName] :: DocMarkupH mod id a -> String -> a
[markupPic] :: DocMarkupH mod id a -> Picture -> a
[markupMathInline] :: DocMarkupH mod id a -> String -> a
[markupMathDisplay] :: DocMarkupH mod id a -> String -> a
[markupProperty] :: DocMarkupH mod id a -> String -> a
[markupExample] :: DocMarkupH mod id a -> [Example] -> a
[markupHeader] :: DocMarkupH mod id a -> Header a -> a
[markupTable] :: DocMarkupH mod id a -> Table a -> a
instance Data.Traversable.Traversable (Documentation.Haddock.Types.MetaDoc mod)
instance Data.Foldable.Foldable (Documentation.Haddock.Types.MetaDoc mod)
instance GHC.Base.Functor (Documentation.Haddock.Types.MetaDoc mod)
instance (GHC.Show.Show id, GHC.Show.Show mod) => GHC.Show.Show (Documentation.Haddock.Types.MetaDoc mod id)
instance (GHC.Classes.Eq id, GHC.Classes.Eq mod) => GHC.Classes.Eq (Documentation.Haddock.Types.MetaDoc mod id)
instance Data.Traversable.Traversable (Documentation.Haddock.Types.DocH mod)
instance Data.Foldable.Foldable (Documentation.Haddock.Types.DocH mod)
instance GHC.Base.Functor (Documentation.Haddock.Types.DocH mod)
instance (GHC.Show.Show id, GHC.Show.Show mod) => GHC.Show.Show (Documentation.Haddock.Types.DocH mod id)
instance (GHC.Classes.Eq id, GHC.Classes.Eq mod) => GHC.Classes.Eq (Documentation.Haddock.Types.DocH mod id)
instance Data.Traversable.Traversable Documentation.Haddock.Types.Table
instance Data.Foldable.Foldable Documentation.Haddock.Types.Table
instance GHC.Base.Functor Documentation.Haddock.Types.Table
instance GHC.Show.Show id => GHC.Show.Show (Documentation.Haddock.Types.Table id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.Table id)
instance Data.Traversable.Traversable Documentation.Haddock.Types.TableRow
instance Data.Foldable.Foldable Documentation.Haddock.Types.TableRow
instance GHC.Base.Functor Documentation.Haddock.Types.TableRow
instance GHC.Show.Show id => GHC.Show.Show (Documentation.Haddock.Types.TableRow id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.TableRow id)
instance Data.Traversable.Traversable Documentation.Haddock.Types.TableCell
instance Data.Foldable.Foldable Documentation.Haddock.Types.TableCell
instance GHC.Base.Functor Documentation.Haddock.Types.TableCell
instance GHC.Show.Show id => GHC.Show.Show (Documentation.Haddock.Types.TableCell id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.TableCell id)
instance GHC.Show.Show Documentation.Haddock.Types.Example
instance GHC.Classes.Eq Documentation.Haddock.Types.Example
instance Data.Traversable.Traversable Documentation.Haddock.Types.Header
instance Data.Foldable.Foldable Documentation.Haddock.Types.Header
instance GHC.Base.Functor Documentation.Haddock.Types.Header
instance GHC.Show.Show id => GHC.Show.Show (Documentation.Haddock.Types.Header id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.Header id)
instance GHC.Show.Show Documentation.Haddock.Types.Picture
instance GHC.Classes.Eq Documentation.Haddock.Types.Picture
instance GHC.Show.Show Documentation.Haddock.Types.Hyperlink
instance GHC.Classes.Eq Documentation.Haddock.Types.Hyperlink
instance GHC.Show.Show Documentation.Haddock.Types.Meta
instance GHC.Classes.Eq Documentation.Haddock.Types.Meta
instance Data.Bifunctor.Bifunctor Documentation.Haddock.Types.MetaDoc
instance Data.Bifoldable.Bifoldable Documentation.Haddock.Types.MetaDoc
instance Data.Bitraversable.Bitraversable Documentation.Haddock.Types.MetaDoc
instance Data.Bifunctor.Bifunctor Documentation.Haddock.Types.DocH
instance Data.Bifoldable.Bifoldable Documentation.Haddock.Types.DocH
instance Data.Bitraversable.Bitraversable Documentation.Haddock.Types.DocH


module Documentation.Haddock.Markup
markup :: DocMarkupH mod id a -> DocH mod id -> a

-- | The identity markup
idMarkup :: DocMarkupH mod id (DocH mod id)

module Documentation.Haddock.Doc
docParagraph :: DocH mod id -> DocH mod id
docAppend :: DocH mod id -> DocH mod id -> DocH mod id
docConcat :: [DocH mod id] -> DocH mod id

-- | Like <a>docConcat</a> but also joins the <a>Meta</a> info.
metaDocConcat :: [MetaDoc mod id] -> MetaDoc mod id

-- | We do something perhaps unexpected here and join the meta info in
--   ‘reverse’: this results in the metadata from the ‘latest’ paragraphs
--   taking precedence.
metaDocAppend :: MetaDoc mod id -> MetaDoc mod id -> MetaDoc mod id
emptyMetaDoc :: MetaDoc mod id

-- | This is not a monoidal append, it uses <a>&lt;|&gt;</a> for the
--   <a>_version</a> and <a>_package</a>.
metaAppend :: Meta -> Meta -> Meta

-- | Concat using <a>metaAppend</a>.
metaConcat :: [Meta] -> Meta


-- | Parser used for Haddock comments. For external users of this library,
--   the most commonly used combination of functions is going to be
--   
--   <pre>
--   <a>toRegular</a> . <a>_doc</a> . <a>parseParas</a>
--   </pre>
module Documentation.Haddock.Parser

-- | Variant of <a>parseText</a> for <a>String</a> instead of <a>Text</a>
parseString :: String -> DocH mod Identifier

-- | Main entry point to the parser. Appends the newline character to the
--   input string.
parseParas :: Maybe Package -> String -> MetaDoc mod Identifier

-- | Maps over <a>DocIdentifier</a>s over <a>String</a> with potentially
--   failing conversion using user-supplied function. If the conversion
--   fails, the identifier is deemed to not be valid and is treated as a
--   regular string.
overIdentifier :: (String -> Maybe a) -> DocH mod Identifier -> DocH mod a

-- | Drops the quotes/backticks around all identifiers, as if they were
--   valid but still <a>String</a>s.
toRegular :: DocH mod Identifier -> DocH mod String

-- | Identifier string surrounded with opening and closing
--   quotes/backticks.
type Identifier = (Char, String, Char)
instance GHC.Show.Show Documentation.Haddock.Parser.TC

module Documentation.Haddock.Utf8

-- | Helper that encodes and packs a <a>String</a> into a <a>ByteString</a>
encodeUtf8 :: String -> ByteString

-- | Helper that unpacks and decodes a <a>ByteString</a> into a
--   <a>String</a>
decodeUtf8 :: ByteString -> String
