-- 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 be
--   sure to specify upper bounds in your projects. For interacting with
--   Haddock itself, see the haddock package.
@package haddock-library
@version 1.11.0

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

-- | With the advent of Version, 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 id
Hyperlink :: String -> Maybe id -> Hyperlink id
[hyperlinkUrl] :: Hyperlink id -> String
[hyperlinkLabel] :: Hyperlink id -> Maybe id
data ModLink id
ModLink :: String -> Maybe id -> ModLink id
[modLinkName] :: ModLink id -> String
[modLinkLabel] :: ModLink id -> Maybe id
data Picture
Picture :: String -> Maybe String -> Picture
[pictureUri] :: Picture -> String
[pictureTitle] :: Picture -> Maybe String
data Header id
Header :: Int -> id -> Header id

-- | between 1 and 6 inclusive
[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

-- | A link to a module, with an optional label.
DocModule :: ModLink (DocH mod id) -> 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 :: [(Int, 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) -> DocH mod id
DocPic :: Picture -> DocH mod id
DocMathInline :: String -> DocH mod id
DocMathDisplay :: String -> DocH mod id

-- | A (HTML) anchor. It must not contain any spaces.
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

-- | The namespace qualification for an identifier.
data Namespace
Value :: Namespace
Type :: Namespace
None :: Namespace

-- | Render the a namespace into the same format it was initially parsed.
renderNs :: Namespace -> String

-- | DocMarkupH is a set of instructions for marking up
--   documentation. In fact, it's really just a mapping from Doc
--   to some other type [a], where [a] is usually the type of the output
--   (HTML, say). Use markup to apply a DocMarkupH to a
--   DocH.
data DocMarkupH mod id a
Markup :: a -> (String -> a) -> (a -> a) -> (a -> a -> a) -> (id -> a) -> (mod -> a) -> (ModLink a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> ([a] -> a) -> ([(Int, a)] -> a) -> ([(a, a)] -> a) -> (a -> a) -> (Hyperlink a -> 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 -> ModLink a -> 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 -> [(Int, a)] -> a
[markupDefList] :: DocMarkupH mod id a -> [(a, a)] -> a
[markupCodeBlock] :: DocMarkupH mod id a -> a -> a
[markupHyperlink] :: DocMarkupH mod id a -> Hyperlink a -> 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.Bifoldable.Bifoldable Documentation.Haddock.Types.DocH
instance Data.Bifoldable.Bifoldable Documentation.Haddock.Types.MetaDoc
instance Data.Bifunctor.Bifunctor Documentation.Haddock.Types.DocH
instance Data.Bifunctor.Bifunctor Documentation.Haddock.Types.MetaDoc
instance Data.Bitraversable.Bitraversable Documentation.Haddock.Types.DocH
instance Data.Bitraversable.Bitraversable Documentation.Haddock.Types.MetaDoc
instance GHC.Internal.Enum.Enum Documentation.Haddock.Types.Namespace
instance (GHC.Classes.Eq id, GHC.Classes.Eq mod) => GHC.Classes.Eq (Documentation.Haddock.Types.DocH mod id)
instance GHC.Classes.Eq Documentation.Haddock.Types.Example
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.Header id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.Hyperlink id)
instance GHC.Classes.Eq Documentation.Haddock.Types.Meta
instance (GHC.Classes.Eq id, GHC.Classes.Eq mod) => GHC.Classes.Eq (Documentation.Haddock.Types.MetaDoc mod id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.ModLink id)
instance GHC.Classes.Eq Documentation.Haddock.Types.Namespace
instance GHC.Classes.Eq Documentation.Haddock.Types.Picture
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.Table id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.TableCell id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Documentation.Haddock.Types.TableRow id)
instance GHC.Internal.Data.Foldable.Foldable (Documentation.Haddock.Types.DocH mod)
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.Header
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.Hyperlink
instance GHC.Internal.Data.Foldable.Foldable (Documentation.Haddock.Types.MetaDoc mod)
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.ModLink
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.Table
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.TableCell
instance GHC.Internal.Data.Foldable.Foldable Documentation.Haddock.Types.TableRow
instance GHC.Internal.Base.Functor (Documentation.Haddock.Types.DocH mod)
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.Header
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.Hyperlink
instance GHC.Internal.Base.Functor (Documentation.Haddock.Types.MetaDoc mod)
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.ModLink
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.Table
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.TableCell
instance GHC.Internal.Base.Functor Documentation.Haddock.Types.TableRow
instance GHC.Classes.Ord Documentation.Haddock.Types.Namespace
instance (GHC.Internal.Show.Show id, GHC.Internal.Show.Show mod) => GHC.Internal.Show.Show (Documentation.Haddock.Types.DocH mod id)
instance GHC.Internal.Show.Show Documentation.Haddock.Types.Example
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.Header id)
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.Hyperlink id)
instance GHC.Internal.Show.Show Documentation.Haddock.Types.Meta
instance (GHC.Internal.Show.Show id, GHC.Internal.Show.Show mod) => GHC.Internal.Show.Show (Documentation.Haddock.Types.MetaDoc mod id)
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.ModLink id)
instance GHC.Internal.Show.Show Documentation.Haddock.Types.Namespace
instance GHC.Internal.Show.Show Documentation.Haddock.Types.Picture
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.Table id)
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.TableCell id)
instance GHC.Internal.Show.Show id => GHC.Internal.Show.Show (Documentation.Haddock.Types.TableRow id)
instance GHC.Internal.Data.Traversable.Traversable (Documentation.Haddock.Types.DocH mod)
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.Header
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.Hyperlink
instance GHC.Internal.Data.Traversable.Traversable (Documentation.Haddock.Types.MetaDoc mod)
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.ModLink
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.Table
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.TableCell
instance GHC.Internal.Data.Traversable.Traversable Documentation.Haddock.Types.TableRow

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

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

-- | Map a DocH into a best estimate of an alternate string. The
--   idea is to strip away any formatting while preserving as much of the
--   actual text as possible.
plainMarkup :: (mod -> String) -> (id -> String) -> DocMarkupH mod id String

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 docConcat but also joins the Meta 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 <|> for the
--   _version and _package.
metaAppend :: Meta -> Meta -> Meta

-- | Concat using metaAppend.
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
--   
--   
--   toRegular . _doc . parseParas
--   
module Documentation.Haddock.Parser

-- | Variant of parseText for String instead of Text
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 DocIdentifiers over String 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 :: (Namespace -> String -> Maybe a) -> DocH mod Identifier -> DocH mod a

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

-- | Identifier string surrounded with namespace, opening, and closing
--   quotes/backticks.
data Identifier
instance GHC.Internal.Show.Show Documentation.Haddock.Parser.TC
