-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A program to find and display the docs of a name from a given module. -- -- Given a module name and a name, it will find and display the -- documentation of that name. -- -- EXAMPLE USAGE -- --
--   $ haskell-docs Data.List.Split split
--   split :: forall a. Splitter a -> [a] -> [[a]]
--   Split a list according to the given splitting strategy. This is
--    how to "run" a Splitter that has been built using the other
--    combinators.
--   
-- -- INSTALLATION -- -- You should ensure that you have -- --
--   documentation: True
--   
-- -- in your .cabal/config so that the necessary .haddock files are -- generated. -- -- Haddock is very sensitive to the GHC version. This program tries not -- to be. If you cannot install this package due to a version problem, -- open a Github issue. If the versions match up but the build fails, -- open a Github issue. Neither case should arise. -- -- USING WITH GHCI -- --
--   > :def doc \input -> return (":!haskell-docs " ++ input)
--   > :doc System.IO getContents base
--   The getContents operation returns all user input as a single string,
--    which is read lazily as it is needed
--    (same as hGetContents stdin).
--   
-- -- Add the above :def to your user .ghci to have it on start-up. -- -- CONTRIBUTION AND ISSUES -- -- Issues/ideas/contributions please make a Github issue: -- http://github.com/chrisdone/haskell-docs/issues @package haskell-docs @version 4.1.2 -- | All types. module Haskell.Docs.Types -- | Identier documentation along with argument docs and identifiers. data IdentDoc IdentDoc :: !PackageIdentifier -> !(Doc String) -> !(Maybe Id) -> !(Maybe [(Int, Doc String)]) -> IdentDoc identDocPackageName :: IdentDoc -> !PackageIdentifier identDocDocs :: IdentDoc -> !(Doc String) identDocIdent :: IdentDoc -> !(Maybe Id) identDocArgDocs :: IdentDoc -> !(Maybe [(Int, Doc String)]) -- | An exception when doing lookups. data DocsException NoFindModule :: DocsException NoModulePackageCombo :: DocsException NoInterfaceFiles :: DocsException NoParseInterfaceFiles :: [DocsException] -> DocsException NoFindNameInExports :: DocsException NoFindNameInInterface :: DocsException NoReadInterfaceFile :: String -> DocsException -- | An identifier. newtype Identifier Identifier :: String -> Identifier unIdentifier :: Identifier -> String -- | An package name. newtype PackageName PackageName :: String -> PackageName instance Typeable DocsException instance Show Identifier instance Eq Identifier instance Show PackageName instance Eq PackageName instance Show DocsException instance Exception DocsException instance Eq IdentDoc -- | Ghc compatibility layer. module Haskell.Docs.Ghc -- | Run an action with an initialized GHC package set. withInitializedPackages :: [String] -> Ghc a -> IO a -- | Get the type of the given identifier from the given module. findIdentifier :: ModuleName -> Identifier -> Ghc (Maybe Id) -- | Make a module name. makeModuleName :: String -> ModuleName -- | Run the given GHC action. run :: Ghc a -> IO a -- | Pretty print something to string. showppr :: Outputable a => DynFlags -> a -> String -- | Wraps showSDocForUser. showSDocForUser :: DynFlags -> PrintUnqualified -> SDoc -> String -- | Set the import context. setImportContext :: ModuleName -> Ghc () -- | Show the package name e.g. base. showPackageName :: PackageIdentifier -> String -- | Cabal. module Haskell.Docs.Cabal -- | Get all installed packages, filtering out the given package. getAllPackages :: IO [PackageConfig] -- | Version-portable version of allPackagesByName. packagesByName :: PackageIndex -> [[InstalledPackageInfo]] -- | Convert a Cabal module name to a GHC module name. convModule :: ModuleName -> ModuleName -- | Because no Functor instance is available. imap :: (a -> m) -> InstalledPackageInfo_ a -> InstalledPackageInfo_ m -- | Haddock compatibilty layer and query functions. module Haskell.Docs.Haddock -- | Search a name in the given module. searchIdent :: Maybe PackageConfig -> Identifier -> Ghc (Either DocsException [IdentDoc]) -- | Search a name in the given module. searchModuleIdent :: Maybe PackageConfig -> ModuleName -> Identifier -> Ghc (Either DocsException [IdentDoc]) -- | Search a name in the given module from the given package. searchPackageModuleIdent :: Maybe PackageConfig -> PackageName -> ModuleName -> Identifier -> Ghc (Either DocsException [IdentDoc]) filterPrevious :: Maybe (InstalledPackageInfo_ m) -> [InstalledPackageInfo_ m] -> [InstalledPackageInfo_ m] -- | Search for the identifier in a module in any of the given packages. searchInPackages :: [PackageConfig] -> Maybe ModuleName -> Identifier -> Ghc (Either a [IdentDoc]) -- | Search for the given identifier in the given package. searchWithPackage :: PackageConfig -> Maybe ModuleName -> Identifier -> Ghc (Either DocsException [IdentDoc]) -- | Search for the given identifier in the interface. searchWithInterface :: PackageConfig -> Identifier -> InstalledInterface -> Ghc (Either DocsException [IdentDoc]) -- | Get a mapping from names to doc string of that name from a Haddock -- interface. interfaceNameMap :: InstalledInterface -> Map String (Doc String) -- | Get a mapping from names to doc string of that name from a Haddock -- interface. interfaceArgMap :: InstalledInterface -> Map String (Map Int (Doc Name)) -- | Find arguments documentation for the identifier. lookupArgsDocs :: InstalledInterface -> Identifier -> Ghc (Maybe [(Int, Doc String)]) -- | Search for a module's package, returning suggestions if not found. -- Filters out the given value. getPackagesByModule :: ModuleName -> Ghc [PackageConfig] -- | Get the Haddock interfaces of the given package. getHaddockInterfacesByPackage :: PackageConfig -> Ghc [Either DocsException InterfaceFile] -- | The module symbol doesn't actually exist in the module we intended, so -- we descend into the module that it does exist in and restart our -- search process. descendSearch :: PackageConfig -> Identifier -> Name -> Ghc (Either DocsException [IdentDoc]) -- | Formatting of Haddock documentation. module Haskell.Docs.Formatting -- | Print an identifier' documentation. printIdentDoc :: Bool -> Bool -> Bool -> IdentDoc -> Ghc () -- | Format some documentation to plain text. formatDoc :: Doc String -> String -- | Render the doc. doc :: Doc String -> String -- | Strip redundant whitespace. normalize :: [Char] -> [Char] -- | Trim either side of a string. trim :: [Char] -> [Char] -- | Format an example to plain text. formatExample :: Example -> String -- | Format an argument. formatArg :: Show a => a -> Doc String -> String -- | Indent after the first line. indentAfter :: Int -> String -> String -- | Lookup the documentation of a name in a module (and in a specific -- package in the case of ambiguity). module Haskell.Docs searchAndPrintDoc :: Bool -> Maybe PackageName -> Maybe ModuleName -> Identifier -> Ghc () -- | An identifier. newtype Identifier Identifier :: String -> Identifier unIdentifier :: Identifier -> String -- | An package name. newtype PackageName PackageName :: String -> PackageName