Documentation.Haddock.Types

haddock-library-1.4.2: Library exposing some functionality of Haddock.

Copyright | (c) Simon Marlow 2003-2006, David Waern 2006-2009, Mateusz Kowalczyk 2013
License | BSD-like
Maintainer | haddock@projects.haskellorg
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Documentation.Haddock.Types

Description

Exposes documentation data types used for (some) of Haddock.

Synopsis

- newtype Meta = Meta {
  - _version :: Maybe Version
  }
- data MetaDoc mod id = MetaDoc {
  - _meta :: Meta
  - _doc :: DocH mod id
  }
- overDoc :: (DocH a b -> DocH c d) -> MetaDoc a b -> MetaDoc c d
- type Version = [Int]
- data Hyperlink = Hyperlink {
  - hyperlinkUrl :: String
  - hyperlinkLabel :: Maybe String
  }
- data Picture = Picture {
  - pictureUri :: String
  - pictureTitle :: Maybe String
  }
- data Header id = Header {
  - headerLevel :: Int
  - headerTitle :: id
  }
- data Example = Example {
  - exampleExpression :: String
  - exampleResult :: [String]
  }
- data DocH mod id
  - = DocEmpty
  - | DocAppend (DocH mod id) (DocH mod id)
  - | DocString String
  - | DocParagraph (DocH mod id)
  - | DocIdentifier id
  - | DocIdentifierUnchecked mod
  - | DocModule String
  - | DocWarning (DocH mod id)
  - | DocEmphasis (DocH mod id)
  - | DocMonospaced (DocH mod id)
  - | DocBold (DocH mod id)
  - | DocUnorderedList [DocH mod id]
  - | DocOrderedList [DocH mod id]
  - | DocDefList [(DocH mod id, DocH mod id)]
  - | DocCodeBlock (DocH mod id)
  - | DocHyperlink Hyperlink
  - | DocPic Picture
  - | DocMathInline String
  - | DocMathDisplay String
  - | DocAName String
  - | DocProperty String
  - | DocExamples [Example]
  - | DocHeader (Header (DocH mod id))

# Documentation

newtype Meta #

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.

Constructors

Meta |
Fields _version :: Maybe Version

Instances

Eq Meta # |
Methods (==) :: Meta -> Meta -> Bool # (/=) :: Meta -> Meta -> Bool #
Show Meta # |
Methods showsPrec :: Int -> Meta -> ShowS # show :: Meta -> String # showList :: [Meta] -> ShowS #

data MetaDoc mod id #

Constructors

MetaDoc |
Fields _meta :: Meta _doc :: DocH mod id

Instances

Functor (MetaDoc mod) # |
Methods fmap :: (a -> b) -> MetaDoc mod a -> MetaDoc mod b # (<$) :: a -> MetaDoc mod b -> MetaDoc mod a #
Foldable (MetaDoc mod) # |
Methods fold :: Monoid m => MetaDoc mod m -> m # foldMap :: Monoid m => (a -> m) -> MetaDoc mod a -> m # foldr :: (a -> b -> b) -> b -> MetaDoc mod a -> b # foldr' :: (a -> b -> b) -> b -> MetaDoc mod a -> b # foldl :: (b -> a -> b) -> b -> MetaDoc mod a -> b # foldl' :: (b -> a -> b) -> b -> MetaDoc mod a -> b # foldr1 :: (a -> a -> a) -> MetaDoc mod a -> a # foldl1 :: (a -> a -> a) -> MetaDoc mod a -> a # toList :: MetaDoc mod a -> [a] # null :: MetaDoc mod a -> Bool # length :: MetaDoc mod a -> Int # elem :: Eq a => a -> MetaDoc mod a -> Bool # maximum :: Ord a => MetaDoc mod a -> a # minimum :: Ord a => MetaDoc mod a -> a # sum :: Num a => MetaDoc mod a -> a # product :: Num a => MetaDoc mod a -> a #
Traversable (MetaDoc mod) # |
Methods traverse :: Applicative f => (a -> f b) -> MetaDoc mod a -> f (MetaDoc mod b) # sequenceA :: Applicative f => MetaDoc mod (f a) -> f (MetaDoc mod a) # mapM :: Monad m => (a -> m b) -> MetaDoc mod a -> m (MetaDoc mod b) # sequence :: Monad m => MetaDoc mod (m a) -> m (MetaDoc mod a) #
(Eq mod, Eq id) => Eq (MetaDoc mod id) # |
Methods (==) :: MetaDoc mod id -> MetaDoc mod id -> Bool # (/=) :: MetaDoc mod id -> MetaDoc mod id -> Bool #
(Show mod, Show id) => Show (MetaDoc mod id) # |
Methods showsPrec :: Int -> MetaDoc mod id -> ShowS # show :: MetaDoc mod id -> String # showList :: [MetaDoc mod id] -> ShowS #

overDoc :: (DocH a b -> DocH c d) -> MetaDoc a b -> MetaDoc c d #

type Version = [Int] #

data Hyperlink #

Constructors

Hyperlink |
Fields hyperlinkUrl :: String hyperlinkLabel :: Maybe String

Instances

Eq Hyperlink # |
Methods (==) :: Hyperlink -> Hyperlink -> Bool # (/=) :: Hyperlink -> Hyperlink -> Bool #
Show Hyperlink # |
Methods showsPrec :: Int -> Hyperlink -> ShowS # show :: Hyperlink -> String # showList :: [Hyperlink] -> ShowS #

data Picture #

Constructors

Picture |
Fields pictureUri :: String pictureTitle :: Maybe String

Instances

Eq Picture # |
Methods (==) :: Picture -> Picture -> Bool # (/=) :: Picture -> Picture -> Bool #
Show Picture # |
Methods showsPrec :: Int -> Picture -> ShowS # show :: Picture -> String # showList :: [Picture] -> ShowS #

data Header id #

Constructors

Header |
Fields headerLevel :: Int headerTitle :: id

Instances

Functor Header # |
Methods fmap :: (a -> b) -> Header a -> Header b # (<$) :: a -> Header b -> Header a #
Foldable Header # |
Methods fold :: Monoid m => Header m -> m # foldMap :: Monoid m => (a -> m) -> Header a -> m # foldr :: (a -> b -> b) -> b -> Header a -> b # foldr' :: (a -> b -> b) -> b -> Header a -> b # foldl :: (b -> a -> b) -> b -> Header a -> b # foldl' :: (b -> a -> b) -> b -> Header a -> b # foldr1 :: (a -> a -> a) -> Header a -> a # foldl1 :: (a -> a -> a) -> Header a -> a # toList :: Header a -> [a] # null :: Header a -> Bool # length :: Header a -> Int # elem :: Eq a => a -> Header a -> Bool # maximum :: Ord a => Header a -> a # minimum :: Ord a => Header a -> a # sum :: Num a => Header a -> a # product :: Num a => Header a -> a #
Traversable Header # |
Methods traverse :: Applicative f => (a -> f b) -> Header a -> f (Header b) # sequenceA :: Applicative f => Header (f a) -> f (Header a) # mapM :: Monad m => (a -> m b) -> Header a -> m (Header b) # sequence :: Monad m => Header (m a) -> m (Header a) #
Eq id => Eq (Header id) # |
Methods (==) :: Header id -> Header id -> Bool # (/=) :: Header id -> Header id -> Bool #
Show id => Show (Header id) # |
Methods showsPrec :: Int -> Header id -> ShowS # show :: Header id -> String # showList :: [Header id] -> ShowS #

data Example #

Constructors

Example |
Fields exampleExpression :: String exampleResult :: [String]

Instances

Eq Example # |
Methods (==) :: Example -> Example -> Bool # (/=) :: Example -> Example -> Bool #
Show Example # |
Methods showsPrec :: Int -> Example -> ShowS # show :: Example -> String # showList :: [Example] -> ShowS #

data DocH mod id #

Constructors

DocEmpty |
DocAppend (DocH mod id) (DocH mod id) |
DocString String |
DocParagraph (DocH mod id) |
DocIdentifier id |
DocIdentifierUnchecked mod |
DocModule String |
DocWarning (DocH mod id) |
DocEmphasis (DocH mod id) |
DocMonospaced (DocH mod id) |
DocBold (DocH mod id) |
DocUnorderedList [DocH mod id] |
DocOrderedList [DocH mod id] |
DocDefList [(DocH mod id, DocH mod id)] |
DocCodeBlock (DocH mod id) |
DocHyperlink Hyperlink |
DocPic Picture |
DocMathInline String |
DocMathDisplay String |
DocAName String |
DocProperty String |
DocExamples [Example] |
DocHeader (Header (DocH mod id)) |

Instances

Functor (DocH mod) # |
Methods fmap :: (a -> b) -> DocH mod a -> DocH mod b # (<$) :: a -> DocH mod b -> DocH mod a #
Foldable (DocH mod) # |
Methods fold :: Monoid m => DocH mod m -> m # foldMap :: Monoid m => (a -> m) -> DocH mod a -> m # foldr :: (a -> b -> b) -> b -> DocH mod a -> b # foldr' :: (a -> b -> b) -> b -> DocH mod a -> b # foldl :: (b -> a -> b) -> b -> DocH mod a -> b # foldl' :: (b -> a -> b) -> b -> DocH mod a -> b # foldr1 :: (a -> a -> a) -> DocH mod a -> a # foldl1 :: (a -> a -> a) -> DocH mod a -> a # toList :: DocH mod a -> [a] # null :: DocH mod a -> Bool # length :: DocH mod a -> Int # elem :: Eq a => a -> DocH mod a -> Bool # maximum :: Ord a => DocH mod a -> a # minimum :: Ord a => DocH mod a -> a # sum :: Num a => DocH mod a -> a # product :: Num a => DocH mod a -> a #
Traversable (DocH mod) # |
Methods traverse :: Applicative f => (a -> f b) -> DocH mod a -> f (DocH mod b) # sequenceA :: Applicative f => DocH mod (f a) -> f (DocH mod a) # mapM :: Monad m => (a -> m b) -> DocH mod a -> m (DocH mod b) # sequence :: Monad m => DocH mod (m a) -> m (DocH mod a) #
(Eq mod, Eq id) => Eq (DocH mod id) # |
Methods (==) :: DocH mod id -> DocH mod id -> Bool # (/=) :: DocH mod id -> DocH mod id -> Bool #
(Show mod, Show id) => Show (DocH mod id) # |
Methods showsPrec :: Int -> DocH mod id -> ShowS # show :: DocH mod id -> String # showList :: [DocH mod id] -> ShowS #