haddock

Portability | portable
Stability | experimental
Maintainer | haddock@projects.haskell.org
Safe Haskell | Safe-Infered

Haddock.Utils

Contents

- Misc utilities
- Filename utilities
- Anchor and URL utilities
- Miscellaneous utilities
- HTML cross reference mapping
- Doc markup
- List utilities
- MTL stuff
- Logging
- System tools

Description

Synopsis

- restrictTo :: [Name] -> LHsDecl Name -> LHsDecl Name
- toDescription :: Interface -> Maybe (Doc Name)
- toInstalledDescription :: InstalledInterface -> Maybe (Doc Name)
- moduleHtmlFile :: Module -> FilePath
- moduleHtmlFile' :: ModuleName -> FilePath
- contentsHtmlFile, indexHtmlFile :: String
- frameIndexHtmlFile :: String
- moduleIndexFrameName, synopsisFrameName, mainFrameName :: String
- subIndexHtmlFile :: String -> String
- jsFile, framesFile :: String
- moduleNameUrl :: Module -> OccName -> String
- moduleNameUrl' :: ModuleName -> OccName -> String
- moduleUrl :: Module -> String
- nameAnchorId :: OccName -> String
- makeAnchorId :: String -> String
- getProgramName :: IO String
- bye :: String -> IO a
- die :: String -> IO a
- dieMsg :: String -> IO a
- noDieMsg :: String -> IO ()
- mapSnd :: (b -> c) -> [(a, b)] -> [(a, c)]
- mapMaybeM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
- escapeStr :: String -> String
- html_xrefs_ref :: IORef (Map Module FilePath)
- html_xrefs_ref' :: IORef (Map ModuleName FilePath)
- markup :: DocMarkup id a -> Doc id -> a
- idMarkup :: DocMarkup a (Doc a)
- replace :: Eq a => a -> a -> [a] -> [a]
- spanWith :: (a -> Maybe b) -> [a] -> ([b], [a])
- class Monad m => MonadIO m where
  - liftIO :: IO a -> m a
- parseVerbosity :: String -> Either String Verbosity
- out :: MonadIO m => Verbosity -> Verbosity -> String -> m ()
- getProcessID :: IO Int

# Misc utilities

restrictTo :: [Name] -> LHsDecl Name -> LHsDecl Name

toDescription :: Interface -> Maybe (Doc Name)

Extract a module's short description.

toInstalledDescription :: InstalledInterface -> Maybe (Doc Name)

Extract a module's short description.

# Filename utilities

moduleHtmlFile :: Module -> FilePath

moduleHtmlFile' :: ModuleName -> FilePath

contentsHtmlFile, indexHtmlFile :: String

frameIndexHtmlFile :: String

The name of the module index file to be displayed inside a frame. Modules are display in full, but without indentation. Clicking opens in the main window.

moduleIndexFrameName, synopsisFrameName, mainFrameName :: String

subIndexHtmlFile :: String -> String

jsFile, framesFile :: String

# Anchor and URL utilities

moduleNameUrl :: Module -> OccName -> String

moduleNameUrl' :: ModuleName -> OccName -> String

moduleUrl :: Module -> String

nameAnchorId :: OccName -> String

makeAnchorId :: String -> String

Takes an arbitrary string and makes it a valid anchor ID. The mapping is identity preserving.

# Miscellaneous utilities

getProgramName :: IO String

bye :: String -> IO a

die :: String -> IO a

dieMsg :: String -> IO a

noDieMsg :: String -> IO ()

mapSnd :: (b -> c) -> [(a, b)] -> [(a, c)]

mapMaybeM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)

escapeStr :: String -> String

# HTML cross reference mapping

html_xrefs_ref :: IORef (Map Module FilePath)

html_xrefs_ref' :: IORef (Map ModuleName FilePath)

# Doc markup

markup :: DocMarkup id a -> Doc id -> a

idMarkup :: DocMarkup a (Doc a)

The identity markup

# List utilities

replace :: Eq a => a -> a -> [a] -> [a]

spanWith :: (a -> Maybe b) -> [a] -> ([b], [a])

# MTL stuff

class Monad m => MonadIO m where

Methods

liftIO :: IO a -> m a

Instances

MonadIO IO |
MonadIO Ghc |
MonadIO m => MonadIO (GhcT m) |

# Logging

parseVerbosity :: String -> Either String Verbosity

out

Arguments

:: MonadIO m |
=> Verbosity | program verbosity
-> Verbosity | message verbosity
-> String |
-> m () |

Print a message to stdout, if it is not too verbose

# System tools

getProcessID :: IO Int