Haddock documentation

This commit is contained in:
Nikolay Yakimov 2015-12-07 19:57:33 +03:00
parent 01e1a83c25
commit cdaf586941
4 changed files with 18 additions and 8 deletions

View File

@ -27,12 +27,10 @@ import Prelude
----------------------------------------------------------------
-- | Getting functions, classes, etc from a module.
-- If 'detailed' is 'True', their types are also obtained.
-- If 'operators' is 'True', operators are also returned.
browse :: forall m. IOish m
=> BrowseOpts
-> String -- ^ A module name. (e.g. \"Data.List\", "base:Prelude")
-> GhcModT m String
=> BrowseOpts -- ^ Configuration parameters
-> String -- ^ A module name. (e.g. \"Data.List\", "base:Prelude")
-> GhcModT m String
browse opts pkgmdl = do
convert' . sort =<< go
where

View File

@ -15,7 +15,7 @@ import Data.List (stripPrefix)
-- | Checking syntax of a target file using hlint.
-- Warnings and errors are returned.
lint :: IOish m
=> LintOpts
=> LintOpts -- ^ Configuration parameters
-> FilePath -- ^ A target file.
-> GhcModT m String
lint opt file =

View File

@ -14,7 +14,9 @@ import qualified GHC as G
----------------------------------------------------------------
-- | Listing installed modules.
modules :: (IOish m, Gm m) => Bool -> m String
modules :: (IOish m, Gm m)
=> Bool -- ^ 'detailed', if 'True', also prints packages that modules belong to.
-> m String
modules detailed = do
df <- runGmPkgGhc G.getSessionDynFlags
let mns = listVisibleModuleNames df

View File

@ -373,17 +373,27 @@ instance Binary ChEntrypoint where
put = ggput . from
get = to `fmap` ggget
data LintOpts = LintOpts { optLintHlintOpts :: [String] }
-- | Options for "lintWith" function
data LintOpts = LintOpts {
optLintHlintOpts :: [String]
-- ^ options that will be passed to hlint executable
}
-- | Default "LintOpts" instance
defaultLintOpts :: LintOpts
defaultLintOpts = LintOpts []
-- | Options for "browseWith" function
data BrowseOpts = BrowseOpts {
optBrowseOperators :: Bool
-- ^ If 'True', "browseWith" also returns operators.
, optBrowseDetailed :: Bool
-- ^ If 'True', "browseWith" also returns types.
, optBrowseQualified :: Bool
-- ^ If 'True', "browseWith" will return fully qualified name
}
-- | Default "BrowseOpts" instance
defaultBrowseOpts :: BrowseOpts
defaultBrowseOpts = BrowseOpts False False False