| Copyright | (c) David Waern 2010 |
|---|---|
| License | BSD-like |
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
The Haddock API: A rudimentary, highly experimental API exposing some of the internals of Haddock. Don't expect it to be stable.
Interface holds all information used to render a single Haddock page. It represents the interface of a module. The core business of Haddock lies in creating this structure. Note that the record contains some fields that are only used to create the final record, and that are not used by the backends.
| Interface | |
Fields
| |
data InstalledInterface Source
A subset of the fields of Interface that we store in the interface files.
| InstalledInterface | |
Fields
| |
| Binary InstalledInterface Source | |
Defined in Haddock.InterfaceFile Methodsput_ :: WriteBinHandle -> InstalledInterface -> IO () Source put :: WriteBinHandle -> InstalledInterface -> IO (Bin InstalledInterface) Source | |
toInstalledIface :: Interface -> InstalledInterface Source
Convert an Interface to an InstalledInterface
| :: [Flag] | A list of command-line flags |
| -> [String] | File or module names |
| -> IO [Interface] | Resulting list of interfaces |
Create Interface structures from a given list of Haddock command-line flags and file or module names (as accepted by haddock executable). Flags that control documentation generation or show help or version information are ignored.
| :: Verbosity | Verbosity of logging to |
| -> [String] | A list of file or module names sorted by module topology |
| -> [Flag] | Command-line flags |
| -> [InterfaceFile] | Interface files of package dependencies |
| -> Ghc ([Interface], LinkEnv) | Resulting list of interfaces and renaming environment |
Create Interfaces and a link environment by typechecking the list of modules using the GHC API and processing the resulting syntax trees.
data ExportItem name Source
| ExportDecl (XExportDecl name) | An exported declaration. |
| ExportNoDecl | An exported entity for which we have no documentation (perhaps because it resides in another package). |
Fields
| |
| ExportGroup | A section heading. |
Fields
| |
| ExportDoc !(MDoc (IdP name)) | Some documentation. |
| ExportModule !Module | A cross-reference to another module. |
type DocForDecl name = (Documentation name, FnArgsDoc name) Source
type FnArgsDoc name = Map Int (MDoc name) Source
Arguments and result are indexed by Int, zero-based from the left, because that's the easiest to use when recursing over types.
type LinkEnv = Map Name Module Source
Type of environment used to cross-reference identifiers in the syntax.
Extends Name with cross-reference information.
| Documented Name Module | This thing is part of the (existing or resulting) documentation. The |
| Undocumented Name | This thing is not part of the (existing or resulting) documentation, as far as Haddock knows. |
| NamedThing DocName Source | |
Defined in Haddock.Types | |
| HasOccName DocName Source | |
Defined in Haddock.Types | |
| Binary DocName Source | |
Defined in Haddock.InterfaceFile | |
| Outputable DocName Source | Useful for debugging |
Defined in Haddock.Types | |
| OutputableBndr DocName Source | |
Defined in Haddock.Types MethodspprBndr :: BindingSite -> DocName -> SDoc Source pprPrefixOcc :: DocName -> SDoc Source pprInfixOcc :: DocName -> SDoc Source | |
| Data DocName Source | |
Defined in Haddock.Types Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DocName -> c DocName gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DocName dataTypeOf :: DocName -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DocName) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocName) gmapT :: (forall b. Data b => b -> b) -> DocName -> DocName gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DocName -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DocName -> r gmapQ :: (forall d. Data d => d -> u) -> DocName -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> DocName -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> DocName -> m DocName gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DocName -> m DocName gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DocName -> m DocName | |
| Eq DocName Source | |
| type Anno DocName Source | |
Defined in Haddock.Types | |
type DocInstance name = (InstHead name, Maybe (MDoc (IdP name)), Located (IdP name), Maybe Module) Source
An instance head that may have documentation and a source location.
The head of an instance. Consists of a class name, a list of type parameters (which may be annotated with kinds), and an instance type
type Doc id = DocH (Wrap (ModuleName, OccName)) (Wrap id) Source
type MDoc id = MetaDoc (Wrap (ModuleName, OccName)) (Wrap id) Source
| DocEmpty | |
| DocAppend (DocH mod id) (DocH mod id) | |
| DocString String | |
| DocParagraph (DocH mod id) | |
| DocIdentifier id | |
| DocIdentifierUnchecked mod | A qualified identifier that couldn't be resolved. |
| DocModule (ModLink (DocH mod id)) | A link to a module, with an optional label. |
| DocWarning (DocH mod id) | This constructor has no counterpart in Haddock markup. |
| DocEmphasis (DocH mod id) | |
| DocMonospaced (DocH mod id) | |
| DocBold (DocH mod id) | |
| DocUnorderedList [DocH mod id] | |
| DocOrderedList [(Int, DocH mod id)] | |
| DocDefList [(DocH mod id, DocH mod id)] | |
| DocCodeBlock (DocH mod id) | |
| DocHyperlink (Hyperlink (DocH mod id)) | |
| DocPic Picture | |
| DocMathInline String | |
| DocMathDisplay String | |
| DocAName String | A (HTML) anchor. It must not contain any spaces. |
| DocProperty String | |
| DocExamples [Example] | |
| DocHeader (Header (DocH mod id)) | |
| DocTable (Table (DocH mod id)) |
| Bifoldable DocH Source | |
Defined in Documentation.Haddock.Types | |
| Bifunctor DocH Source | |
| Bitraversable DocH Source | |
Defined in Documentation.Haddock.Types Methodsbitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> DocH a b -> f (DocH c d) Source | |
| Functor (DocH mod) Source | |
| Foldable (DocH mod) Source | |
Defined in Documentation.Haddock.Types Methodsfold :: Monoid m => DocH mod m -> m foldMap :: Monoid m => (a -> m) -> DocH mod a -> 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 elem :: Eq a => a -> DocH mod a -> Bool maximum :: Ord a => DocH mod a -> a minimum :: Ord a => DocH mod a -> a | |
| Traversable (DocH mod) Source | |
| (NFData a, NFData mod) => NFData (DocH mod a) Source | |
Defined in Haddock.Types | |
| (Binary mod, Binary id) => Binary (DocH mod id) Source | |
Defined in Haddock.InterfaceFile | |
| (Show id, Show mod) => Show (DocH mod id) Source | |
| (Eq id, Eq mod) => Eq (DocH mod id) Source | |
| Example | |
Fields
| |
| Hyperlink | |
Fields
| |
| Functor Hyperlink Source | |
| Foldable Hyperlink Source | |
Defined in Documentation.Haddock.Types Methodsfold :: Monoid m => Hyperlink m -> m foldMap :: Monoid m => (a -> m) -> Hyperlink a -> m foldMap' :: Monoid m => (a -> m) -> Hyperlink a -> m foldr :: (a -> b -> b) -> b -> Hyperlink a -> b foldr' :: (a -> b -> b) -> b -> Hyperlink a -> b foldl :: (b -> a -> b) -> b -> Hyperlink a -> b foldl' :: (b -> a -> b) -> b -> Hyperlink a -> b foldr1 :: (a -> a -> a) -> Hyperlink a -> a foldl1 :: (a -> a -> a) -> Hyperlink a -> a elem :: Eq a => a -> Hyperlink a -> Bool maximum :: Ord a => Hyperlink a -> a minimum :: Ord a => Hyperlink a -> a | |
| Traversable Hyperlink Source | |
Defined in Documentation.Haddock.Types | |
| NFData id => NFData (Hyperlink id) Source | |
Defined in Haddock.Types | |
| Binary a => Binary (Hyperlink a) Source | |
Defined in Haddock.InterfaceFile | |
| Show id => Show (Hyperlink id) Source | |
| Eq id => Eq (Hyperlink id) Source | |
type DocMarkup id a = DocMarkupH (Wrap (ModuleName, OccName)) id a Source
data DocMarkupH mod id a Source
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.
Since: haddock-library-1.4.5
| Markup | |
Fields
| |
data Documentation name Source
| Documentation | |
Fields
| |
| Functor Documentation Source | |
Defined in Haddock.Types Methodsfmap :: (a -> b) -> Documentation a -> Documentation b (<$) :: a -> Documentation b -> Documentation a | |
| NFData name => NFData (Documentation name) Source | |
Defined in Haddock.Types Methodsrnf :: Documentation name -> () Source | |
type ArgMap a = Map Name (Map Int (MDoc a)) Source
type WarningMap = Map Name (Doc Name) Source
type DocMap a = Map Name (MDoc a) Source
data HaddockModInfo name Source
| HaddockModInfo | |
Fields
| |
| NFData name => NFData (HaddockModInfo name) Source | |
Defined in Haddock.Types Methodsrnf :: HaddockModInfo name -> () Source | |
| Binary name => Binary (HaddockModInfo name) Source | |
Defined in Haddock.InterfaceFile Methodsput_ :: WriteBinHandle -> HaddockModInfo name -> IO () Source put :: WriteBinHandle -> HaddockModInfo name -> IO (Bin (HaddockModInfo name)) Source get :: ReadBinHandle -> IO (HaddockModInfo name) Source | |
markup :: DocMarkupH mod id a -> DocH mod id -> a Source
data InterfaceFile Source
| InterfaceFile | |
Fields
| |
| Binary InterfaceFile Source | |
Defined in Haddock.InterfaceFile Methodsput_ :: WriteBinHandle -> InterfaceFile -> IO () Source put :: WriteBinHandle -> InterfaceFile -> IO (Bin InterfaceFile) Source get :: ReadBinHandle -> IO InterfaceFile Source | |
| :: NameCache | |
| -> FilePath | |
| -> Bool | Disable version check. Can cause runtime crash. |
| -> IO (Either String InterfaceFile) |
Read a Haddock (.haddock) interface file. Return either an InterfaceFile or an error message.
This function can be called in two ways. Within a GHC session it will update the use and update the session's name cache. Outside a GHC session a new empty name cache is used.
freshNameCache :: IO NameCache Source
Source-level options for controlling the documentation.
| OptHide | This module should not appear in the docs. |
| OptPrune | |
| OptIgnoreExports | Pretend everything is exported. |
| OptNotHome | Not the best place to get docs for things exported by this module. |
| OptShowExtensions | Render enabled extensions for this module. |
| OptPrintRuntimeRep | Render runtime reps for this module (see the GHC |
data HaddockException Source
Haddock's own exception type.
| HaddockException String | |
| WithContext [String] SomeException |
| Exception HaddockException Source | |
Defined in Haddock.Types MethodstoException :: HaddockException -> SomeException fromException :: SomeException -> Maybe HaddockException | |
| Show HaddockException Source | |
Defined in Haddock.Types MethodsshowsPrec :: Int -> HaddockException -> ShowS show :: HaddockException -> String showList :: [HaddockException] -> ShowS | |
haddock :: [String] -> IO () Source
Run Haddock with given list of arguments.
Haddock's own main function is defined in terms of this:
main = getArgs >>= haddock
haddockWithGhc :: (forall a. [Flag] -> Ghc a -> IO a) -> [String] -> IO () Source
getGhcDirs :: [Flag] -> IO (Maybe FilePath, Maybe FilePath) Source
Find the lib directory for GHC and the path to ghc
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/haddock-api-2.30.0-754a/Documentation-Haddock.html