adding docs.

This commit is contained in:
Kazu Yamamoto 2014-03-26 12:09:02 +09:00
parent 5c79376ca7
commit 782da60d0c
4 changed files with 8 additions and 5 deletions

View File

@ -133,6 +133,7 @@ showOutputable dflag = unwords . lines . showUnqualifiedPage dflag . ppr
---------------------------------------------------------------- ----------------------------------------------------------------
-- | Browsing all functions in all system/user modules.
browseAll :: DynFlags -> Ghc [(String,String)] browseAll :: DynFlags -> Ghc [(String,String)]
browseAll dflag = do browseAll dflag = do
ms <- packageDbModules True ms <- packageDbModules True

View File

@ -58,6 +58,7 @@ setLogger True df ls = do
---------------------------------------------------------------- ----------------------------------------------------------------
-- | Converting 'SourceError' to 'String'.
handleErrMsg :: LineSeparator -> SourceError -> Ghc [String] handleErrMsg :: LineSeparator -> SourceError -> Ghc [String]
handleErrMsg ls err = do handleErrMsg ls err = do
dflag <- getSessionDynFlags dflag <- getSessionDynFlags

View File

@ -31,6 +31,7 @@ import System.Process
---------------------------------------------------------------- ----------------------------------------------------------------
-- | Obtaining the directory for system libraries.
getSystemLibDir :: IO (Maybe FilePath) getSystemLibDir :: IO (Maybe FilePath)
getSystemLibDir = do getSystemLibDir = do
res <- readProcess "ghc" ["--print-libdir"] [] res <- readProcess "ghc" ["--print-libdir"] []
@ -159,6 +160,7 @@ setTargetFiles files = do
targets <- forM files $ \file -> guessTarget file Nothing targets <- forM files $ \file -> guessTarget file Nothing
setTargets targets setTargets targets
-- | Adding the files to the targets.
addTargetFiles :: (GhcMonad m) => [FilePath] -> m () addTargetFiles :: (GhcMonad m) => [FilePath] -> m ()
addTargetFiles [] = error "ghc-mod: addTargetFiles: No target files given" addTargetFiles [] = error "ghc-mod: addTargetFiles: No target files given"
addTargetFiles files = do addTargetFiles files = do

View File

@ -14,24 +14,23 @@ module Language.Haskell.GhcMod.Internal (
, cabalDependPackages , cabalDependPackages
, cabalSourceDirs , cabalSourceDirs
, cabalAllTargets , cabalAllTargets
-- * Getting 'DynFlags' -- * IO
, getSystemLibDir
, getDynamicFlags , getDynamicFlags
-- * Initializing 'DynFlags' -- * Initializing 'DynFlags'
, initializeFlags , initializeFlags
, initializeFlagsWithCradle , initializeFlagsWithCradle
-- * 'GhcMonad' -- * 'Ghc' Monad
, setTargetFiles , setTargetFiles
, addTargetFiles , addTargetFiles
, handleErrMsg , handleErrMsg
, browseAll
-- * 'Ghc' Choice -- * 'Ghc' Choice
, (||>) , (||>)
, goNext , goNext
, runAnyOne , runAnyOne
-- * 'GhcMonad' Choice -- * 'GhcMonad' Choice
, (|||>) , (|||>)
-- * GHC
, getSystemLibDir
, browseAll
) where ) where
import Language.Haskell.GhcMod.Browse import Language.Haskell.GhcMod.Browse