-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Happy Haskell Hacking
--   
--   ghc-mod is a backend program to enrich Haskell programming in editors.
--   It strives to offer most of the features one has come to expect from
--   modern IDEs in any editor. ghc-mod provides a library for other
--   haskell programs to use as well as a standalone program for easy
--   editor integration. All of the fundamental functionality of the
--   frontend program can be accessed through the library however many
--   implementation details are hidden and if you want to significantly
--   extend ghc-mod you should submit these changes upstream instead of
--   implementing them on top of the library.
@package ghc-mod
@version 5.8.0.0

module Language.Haskell.GhcMod.Read
readEither :: Read a => String -> Either String a
readMaybe :: Read a => String -> Maybe a

module Language.Haskell.GhcMod.Options.Help
newtype MyDocM s a
MyDoc :: State s a -> MyDocM s a
[unwrapState] :: MyDocM s a -> State s a
type MyDoc = MyDocM (Maybe Doc) ()
para :: String -> Doc
append :: Doc -> MyDocM (Maybe Doc) a
(\\) :: MyDoc -> MyDoc -> MyDoc
infixr 7 \\
doc :: MyDoc -> Doc
help' :: MyDoc -> Mod f a
desc :: MyDoc -> InfoMod a
code :: MyDoc -> MyDoc
progDesc' :: MyDoc -> InfoMod a
indent :: Int -> MyDoc -> MyDoc
int' :: Int -> MyDoc
para' :: String -> MyDoc
instance Control.Monad.State.Class.MonadState s (Language.Haskell.GhcMod.Options.Help.MyDocM s)
instance GHC.Base.Applicative (Language.Haskell.GhcMod.Options.Help.MyDocM s)
instance GHC.Base.Functor (Language.Haskell.GhcMod.Options.Help.MyDocM s)
instance GHC.Base.Monad (Language.Haskell.GhcMod.Options.Help.MyDocM s)
instance Data.String.IsString (Language.Haskell.GhcMod.Options.Help.MyDocM (GHC.Base.Maybe Text.PrettyPrint.ANSI.Leijen.Internal.Doc) a)
instance GHC.Base.Monoid (Language.Haskell.GhcMod.Options.Help.MyDocM (GHC.Base.Maybe Text.PrettyPrint.ANSI.Leijen.Internal.Doc) ())

module Language.Haskell.GhcMod.Options.DocUtils
($$) :: (a -> b) -> a -> b
infixr 7 $$
($$$) :: (a -> b) -> a -> b
infixr 9 $$$
(<=>) :: Monoid m => m -> m -> m
infixr 8 <=>
(<$$>) :: Functor f => (a -> b) -> f a -> f b
infixr 7 <$$>
(<||>) :: Alternative a => a b -> a b -> a b
infixl 6 <||>

module Language.Haskell.GhcMod.DynFlagsTH
deriveEqDynFlags :: Q [Dec] -> Q [Dec]

module Language.Haskell.GhcMod.Caching.Types
type CacheContents d a = Maybe (ModTime, [FilePath], d, a)
type CacheLens s d a = s :-> CacheContents d a
data Cached m s d a
Cached :: FilePath -> Maybe (CacheLens s d a) -> (TimedCacheFiles -> d -> Maybe a -> m ([FilePath], a)) -> Cached m s d a
[cacheFile] :: Cached m s d a -> FilePath
[cacheLens] :: Cached m s d a -> Maybe (CacheLens s d a)

-- | <pre>
--   cachedAction tcf data ma
--   </pre>
--   
--   <ul>
--   <li><tt>tcf</tt>: Input file timestamps. Not technically necessary,
--   just an optimizazion when knowing which input files changed can make
--   updating the cache faster</li>
--   <li><tt>data</tt>: Arbitrary static input data to cache action. Can be
--   used to invalidate the cache using something other than file
--   timestamps i.e. environment tool version numbers</li>
--   <li><tt>ma</tt>: Cached data if it existed</li>
--   </ul>
--   
--   Returns:
--   
--   <ul>
--   <li><tt>fst</tt>: Input files used in generating the cache</li>
--   <li><tt>snd</tt>: Cache data, will be stored alongside the static
--   input data in the <a>cacheFile</a></li>
--   </ul>
--   
--   The cached action, will only run if one of the following is true:
--   
--   <ul>
--   <li><a>cacheFile</a> doesn't exist yet</li>
--   <li><a>cacheFile</a> exists and <tt>inputData</tt> changed</li>
--   <li>any files returned by the cached action changed</li>
--   </ul>
[cachedAction] :: Cached m s d a -> TimedCacheFiles -> d -> Maybe a -> m ([FilePath], a)
data TimedCacheFiles
TimedCacheFiles :: ModTime -> [TimedFile] -> TimedCacheFiles

-- | <a>cacheFile</a> timestamp
[tcCreated] :: TimedCacheFiles -> ModTime

-- | Timestamped files returned by the cached action
[tcFiles] :: TimedCacheFiles -> [TimedFile]
type ChCacheData = (Programs, FilePath, (String, String))
instance GHC.Classes.Ord Language.Haskell.GhcMod.Caching.Types.TimedCacheFiles
instance GHC.Classes.Eq Language.Haskell.GhcMod.Caching.Types.TimedCacheFiles

module Language.Haskell.GhcMod.Types

-- | A constraint alias (-XConstraintKinds) to make functions dealing with
--   <tt>GhcModT</tt> somewhat cleaner.
--   
--   Basicially an <tt>IOish m =&gt; m</tt> is a <a>Monad</a> supporting
--   arbitrary <a>IO</a> and exception handling. Usually this will simply
--   be <a>IO</a> but we parametrise it in the exported API so users have
--   the option to use a custom inner monad.
type IOish m = (Functor m, MonadIO m, MonadBaseControl IO m, ExceptionMonad m)
type MonadIOC m = MonadIO m
class MonadIOC m => MonadIO m
liftIO :: MonadIO m => IO a -> m a

-- | Output style.
data OutputStyle

-- | S expression style.
LispStyle :: OutputStyle

-- | Plain textstyle.
PlainStyle :: OutputStyle

-- | The type for line separator. Historically, a Null string is used.
newtype LineSeparator
LineSeparator :: String -> LineSeparator
data FileMapping
FileMapping :: FilePath -> Bool -> FileMapping
[fmPath] :: FileMapping -> FilePath
[fmTemp] :: FileMapping -> Bool
type FileMappingMap = Map FilePath FileMapping
data ProgramSource
ProgramSourceUser :: ProgramSource
ProgramSourceStack :: ProgramSource
data Programs
Programs :: FilePath -> FilePath -> FilePath -> FilePath -> Programs

-- | <tt>ghc</tt> program name.
[ghcProgram] :: Programs -> FilePath

-- | <tt>ghc-pkg</tt> program name.
[ghcPkgProgram] :: Programs -> FilePath

-- | <tt>cabal</tt> program name.
[cabalProgram] :: Programs -> FilePath

-- | <tt>stack</tt> program name.
[stackProgram] :: Programs -> FilePath
data OutputOpts
OutputOpts :: GmLogLevel -> OutputStyle -> LineSeparator -> Maybe (String, String) -> OutputOpts

-- | Verbosity
[ooptLogLevel] :: OutputOpts -> GmLogLevel
[ooptStyle] :: OutputOpts -> OutputStyle

-- | Line separator string.
[ooptLineSeparator] :: OutputOpts -> LineSeparator

-- | Stdout/err line multiplexing using prefix encoding. <tt>fst</tt> is
--   stdout, <tt>snd</tt> is stderr prefix.
[ooptLinePrefix] :: OutputOpts -> Maybe (String, String)
data Options
Options :: OutputOpts -> Programs -> [GHCOption] -> [(FilePath, Maybe FilePath)] -> String -> Bool -> Options
[optOutput] :: Options -> OutputOpts
[optPrograms] :: Options -> Programs

-- | GHC command line options set on the <tt>ghc-mod</tt> command line
[optGhcUserOptions] :: Options -> [GHCOption]
[optFileMappings] :: Options -> [(FilePath, Maybe FilePath)]
[optEncoding] :: Options -> String
[optStackBuildDeps] :: Options -> Bool

-- | A default <a>Options</a>.
defaultOptions :: Options
data Project
CabalProject :: Project
SandboxProject :: Project
PlainProject :: Project
StackProject :: StackEnv -> Project
isCabalHelperProject :: Project -> Bool
data StackEnv
StackEnv :: FilePath -> [FilePath] -> FilePath -> FilePath -> StackEnv
[seDistDir] :: StackEnv -> FilePath
[seBinPath] :: StackEnv -> [FilePath]
[seSnapshotPkgDb] :: StackEnv -> FilePath
[seLocalPkgDb] :: StackEnv -> FilePath

-- | The environment where this library is used.
data Cradle
Cradle :: Project -> FilePath -> FilePath -> FilePath -> Maybe FilePath -> FilePath -> Cradle
[cradleProject] :: Cradle -> Project

-- | The directory where this library is executed.
[cradleCurrentDir] :: Cradle -> FilePath

-- | The project root directory.
[cradleRootDir] :: Cradle -> FilePath

-- | Per-Project temporary directory
[cradleTempDir] :: Cradle -> FilePath

-- | The file name of the found cabal file.
[cradleCabalFile] :: Cradle -> Maybe FilePath

-- | The build info directory.
[cradleDistDir] :: Cradle -> FilePath
data GmStream
GmOutStream :: GmStream
GmErrStream :: GmStream
data GhcModEnv
GhcModEnv :: Options -> Cradle -> GhcModEnv
[gmOptions] :: GhcModEnv -> Options
[gmCradle] :: GhcModEnv -> Cradle
data GhcModOut
GhcModOut :: OutputOpts -> Chan (Either (MVar ()) (GmStream, String)) -> GhcModOut
[gmoOptions] :: GhcModOut -> OutputOpts
[gmoChan] :: GhcModOut -> Chan (Either (MVar ()) (GmStream, String))
data GhcModLog
GhcModLog :: Maybe GmLogLevel -> Last Bool -> [(GmLogLevel, String, Doc)] -> GhcModLog
[gmLogLevel] :: GhcModLog -> Maybe GmLogLevel
[gmLogVomitDump] :: GhcModLog -> Last Bool
[gmLogMessages] :: GhcModLog -> [(GmLogLevel, String, Doc)]
data GmGhcSession
GmGhcSession :: !(IORef HscEnv) -> GmGhcSession
[gmgsSession] :: GmGhcSession -> !(IORef HscEnv)
data GhcModCaches
GhcModCaches :: CacheContents ChCacheData [GhcPkgDb] -> CacheContents ChCacheData [GHCOption] -> CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint] -> CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath))) -> GhcModCaches
[gmcPackageDbStack] :: GhcModCaches -> CacheContents ChCacheData [GhcPkgDb]
[gmcMergedPkgOptions] :: GhcModCaches -> CacheContents ChCacheData [GHCOption]
[gmcComponents] :: GhcModCaches -> CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint]
[gmcResolvedComponents] :: GhcModCaches -> CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))
data GhcModState
GhcModState :: !(Maybe GmGhcSession) -> !GhcModCaches -> !FileMappingMap -> GhcModState
[gmGhcSession] :: GhcModState -> !(Maybe GmGhcSession)
[gmCaches] :: GhcModState -> !GhcModCaches
[gmMMappedFiles] :: GhcModState -> !FileMappingMap
defaultGhcModState :: GhcModState

-- | GHC package database flags.
data GhcPkgDb
GlobalDb :: GhcPkgDb
UserDb :: GhcPkgDb
PackageDb :: String -> GhcPkgDb

-- | A single GHC command line option.
type GHCOption = String

-- | An include directory for modules.
type IncludeDir = FilePath

-- | Haskell expression.
newtype Expression
Expression :: String -> Expression
[getExpression] :: Expression -> String

-- | Module name.
newtype ModuleString
ModuleString :: String -> ModuleString
[getModuleString] :: ModuleString -> String
data GmLogLevel
GmSilent :: GmLogLevel
GmPanic :: GmLogLevel
GmException :: GmLogLevel
GmError :: GmLogLevel
GmWarning :: GmLogLevel
GmInfo :: GmLogLevel
GmDebug :: GmLogLevel
GmVomit :: GmLogLevel
data GmModuleGraph
GmModuleGraph :: Map ModulePath (Set ModulePath) -> GmModuleGraph
[gmgGraph] :: GmModuleGraph -> Map ModulePath (Set ModulePath)
data GmComponentType
GMCRaw :: GmComponentType
GMCResolved :: GmComponentType
data GmComponent (t :: GmComponentType) eps
GmComponent :: GmModuleGraph -> ChComponentName -> [GHCOption] -> [GHCOption] -> [GHCOption] -> [GHCOption] -> ChEntrypoint -> eps -> [FilePath] -> GmComponent eps
[gmcHomeModuleGraph] :: GmComponent eps -> GmModuleGraph
[gmcName] :: GmComponent eps -> ChComponentName
[gmcGhcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcPkgOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcSrcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcLangOpts] :: GmComponent eps -> [GHCOption]
[gmcRawEntrypoints] :: GmComponent eps -> ChEntrypoint
[gmcEntrypoints] :: GmComponent eps -> eps
[gmcSourceDirs] :: GmComponent eps -> [FilePath]
data ModulePath
ModulePath :: ModuleName -> FilePath -> ModulePath
[mpModule] :: ModulePath -> ModuleName
[mpPath] :: ModulePath -> FilePath
data GhcModError

-- | Unknown error
GMENoMsg :: GhcModError

-- | Some Error with a message. These are produced mostly by <a>fail</a>
--   calls on GhcModT.
GMEString :: String -> GhcModError

-- | Configuring a cabal project failed.
GMECabalConfigure :: GhcModError -> GhcModError

-- | Configuring a stack project failed.
GMEStackConfigure :: GhcModError -> GhcModError

-- | Bootstrapping <tt>stack</tt> environment failed (process exited with
--   failure)
GMEStackBootstrap :: GhcModError -> GhcModError

-- | Could not find a consistent component assignment for modules
GMECabalCompAssignment :: [(Either FilePath ModuleName, Set ChComponentName)] -> GhcModError

-- | Launching an operating system process failed. Fields in order:
--   function, command, arguments, (stdout, stderr, exitcode)
GMEProcess :: String -> String -> [String] -> (Either Int GhcModError) -> GhcModError

-- | No cabal file found.
GMENoCabalFile :: GhcModError

-- | Too many cabal files found.
GMETooManyCabalFiles :: [FilePath] -> GhcModError

-- | Options for "lintWith" function
data LintOpts
LintOpts :: [String] -> LintOpts

-- | options that will be passed to hlint executable
[optLintHlintOpts] :: LintOpts -> [String]

-- | Default <a>LintOpts</a> instance
defaultLintOpts :: LintOpts

-- | Options for "browseWith" function
data BrowseOpts
BrowseOpts :: Bool -> Bool -> Bool -> Bool -> BrowseOpts

-- | If <a>True</a>, "browseWith" also returns operators.
[optBrowseOperators] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" also returns types.
[optBrowseDetailed] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" also returns parents.
[optBrowseParents] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" will return fully qualified name
[optBrowseQualified] :: BrowseOpts -> Bool

-- | Default <a>BrowseOpts</a> instance
defaultBrowseOpts :: BrowseOpts
lGmcResolvedComponents :: forall cat. ArrowApply cat => Lens cat GhcModCaches (CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath))))
lGmcPackageDbStack :: forall cat. ArrowApply cat => Lens cat GhcModCaches (CacheContents ChCacheData [GhcPkgDb])
lGmcMergedPkgOptions :: forall cat. ArrowApply cat => Lens cat GhcModCaches (CacheContents ChCacheData [GHCOption])
lGmcComponents :: forall cat. ArrowApply cat => Lens cat GhcModCaches (CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint])
lGmMMappedFiles :: forall cat. ArrowApply cat => Lens cat GhcModState FileMappingMap
lGmGhcSession :: forall cat. ArrowApply cat => Lens cat GhcModState (Maybe GmGhcSession)
lGmCaches :: forall cat. ArrowApply cat => Lens cat GhcModState GhcModCaches
lOptStackBuildDeps :: forall cat. ArrowApply cat => Lens cat Options Bool
lOptPrograms :: forall cat. ArrowApply cat => Lens cat Options Programs
lOptOutput :: forall cat. ArrowApply cat => Lens cat Options OutputOpts
lOptGhcUserOptions :: forall cat. ArrowApply cat => Lens cat Options [GHCOption]
lOptFileMappings :: forall cat. ArrowApply cat => Lens cat Options [(FilePath, Maybe FilePath)]
lOptEncoding :: forall cat. ArrowApply cat => Lens cat Options String
lOoptStyle :: forall cat. ArrowApply cat => Lens cat OutputOpts OutputStyle
lOoptLogLevel :: forall cat. ArrowApply cat => Lens cat OutputOpts GmLogLevel
lOoptLineSeparator :: forall cat. ArrowApply cat => Lens cat OutputOpts LineSeparator
lOoptLinePrefix :: forall cat. ArrowApply cat => Lens cat OutputOpts (Maybe (String, String))
lStackProgram :: forall cat. ArrowApply cat => Lens cat Programs FilePath
lGhcProgram :: forall cat. ArrowApply cat => Lens cat Programs FilePath
lGhcPkgProgram :: forall cat. ArrowApply cat => Lens cat Programs FilePath
lCabalProgram :: forall cat. ArrowApply cat => Lens cat Programs FilePath

-- | A ModuleName is essentially a simple string, e.g. <tt>Data.List</tt>.
data ModuleName :: *
mkModuleName :: String -> ModuleName
moduleNameString :: ModuleName -> String
instance GHC.Show.Show Language.Haskell.GhcMod.Types.BrowseOpts
instance GHC.Show.Show Language.Haskell.GhcMod.Types.LintOpts
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GhcModError
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.GhcModError
instance GHC.Base.Functor (Language.Haskell.GhcMod.Types.GmComponent t)
instance GHC.Generics.Generic (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance GHC.Read.Read eps => GHC.Read.Read (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance GHC.Show.Show eps => GHC.Show.Show (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance GHC.Classes.Ord eps => GHC.Classes.Ord (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance GHC.Classes.Eq eps => GHC.Classes.Eq (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance GHC.Generics.Generic Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Read.Read Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Generics.Generic Language.Haskell.GhcMod.Types.ModulePath
instance GHC.Read.Read Language.Haskell.GhcMod.Types.ModulePath
instance GHC.Show.Show Language.Haskell.GhcMod.Types.ModulePath
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.ModulePath
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.ModulePath
instance GHC.Show.Show Language.Haskell.GhcMod.Types.Options
instance GHC.Show.Show Language.Haskell.GhcMod.Types.OutputOpts
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GhcModLog
instance GHC.Read.Read Language.Haskell.GhcMod.Types.GmLogLevel
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GmLogLevel
instance GHC.Enum.Bounded Language.Haskell.GhcMod.Types.GmLogLevel
instance GHC.Enum.Enum Language.Haskell.GhcMod.Types.GmLogLevel
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.GmLogLevel
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.GmLogLevel
instance Control.DeepSeq.NFData Language.Haskell.GhcMod.Types.ModuleString
instance Data.Binary.Class.Binary Language.Haskell.GhcMod.Types.ModuleString
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.ModuleString
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.ModuleString
instance GHC.Show.Show Language.Haskell.GhcMod.Types.ModuleString
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.Expression
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.Expression
instance GHC.Show.Show Language.Haskell.GhcMod.Types.Expression
instance GHC.Generics.Generic Language.Haskell.GhcMod.Types.GhcPkgDb
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GhcPkgDb
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.GhcPkgDb
instance GHC.Show.Show Language.Haskell.GhcMod.Types.GmStream
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.Cradle
instance GHC.Show.Show Language.Haskell.GhcMod.Types.Cradle
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.Cradle
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.Project
instance GHC.Show.Show Language.Haskell.GhcMod.Types.Project
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.Project
instance GHC.Classes.Ord Language.Haskell.GhcMod.Types.StackEnv
instance GHC.Show.Show Language.Haskell.GhcMod.Types.StackEnv
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.StackEnv
instance GHC.Show.Show Language.Haskell.GhcMod.Types.Programs
instance GHC.Show.Show Language.Haskell.GhcMod.Types.FileMapping
instance GHC.Classes.Eq Language.Haskell.GhcMod.Types.FileMapping
instance GHC.Show.Show Language.Haskell.GhcMod.Types.LineSeparator
instance GHC.Show.Show Language.Haskell.GhcMod.Types.OutputStyle
instance GHC.Base.Monoid Language.Haskell.GhcMod.Types.GhcModLog
instance Data.Binary.Class.Binary Language.Haskell.GhcMod.Types.GhcPkgDb
instance Data.Binary.Class.Binary Language.Haskell.GhcMod.Types.GmModuleGraph
instance GHC.Base.Monoid Language.Haskell.GhcMod.Types.GmModuleGraph
instance Data.Binary.Class.Binary eps => Data.Binary.Class.Binary (Language.Haskell.GhcMod.Types.GmComponent t eps)
instance Data.Binary.Class.Binary Language.Haskell.GhcMod.Types.ModulePath
instance Data.Binary.Class.Binary Module.ModuleName
instance GHC.Show.Show Module.ModuleName
instance GHC.Read.Read Module.ModuleName
instance Control.Monad.Trans.Error.Error Language.Haskell.GhcMod.Types.GhcModError
instance GHC.Exception.Exception Language.Haskell.GhcMod.Types.GhcModError
instance Data.Binary.Class.Binary Distribution.Helper.Programs
instance Data.Binary.Class.Binary CabalHelper.Types.ChModuleName
instance Data.Binary.Class.Binary CabalHelper.Types.ChComponentName
instance Data.Binary.Class.Binary CabalHelper.Types.ChEntrypoint

module Language.Haskell.GhcMod.Gap
type ClsInst = ClsInst
mkTarget :: TargetId -> Bool -> Maybe (StringBuffer, UTCTime) -> Target
withStyle :: DynFlags -> PprStyle -> SDoc -> Doc
type GmLogAction = WarnReason -> DynFlags -> Severity -> SrcSpan -> PprStyle -> MsgDoc -> IO ()
setLogAction :: DynFlags -> GmLogAction -> DynFlags
getSrcSpan :: SrcSpan -> Maybe (Int, Int, Int, Int)
getSrcFile :: SrcSpan -> Maybe String
withInteractiveContext :: GhcMonad m => m a -> m a
ghcCmdOptions :: [String]
toStringBuffer :: GhcMonad m => [String] -> m StringBuffer
showSeverityCaption :: Severity -> String
setCabalPkg :: DynFlags -> DynFlags
setHideAllPackages :: DynFlags -> DynFlags
setDeferTypeErrors :: DynFlags -> DynFlags
setDeferTypedHoles :: DynFlags -> DynFlags
setWarnTypedHoles :: DynFlags -> DynFlags
setDumpSplices :: DynFlags -> DynFlags

-- | Set <a>DynFlags</a> equivalent to "-fno-max-relevant-bindings".
setNoMaxRelevantBindings :: DynFlags -> DynFlags
isDumpSplices :: DynFlags -> Bool
filterOutChildren :: (a -> TyThing) -> [a] -> [a]
infoThing :: GhcMonad m => (FilePath -> FilePath) -> Expression -> m SDoc
pprInfo :: (FilePath -> FilePath) -> Bool -> (TyThing, Fixity, [ClsInst], [FamInst]) -> SDoc
class HasType a
getType :: (HasType a, GhcMonad m) => TypecheckedModule -> a -> m (Maybe (SrcSpan, Type))
errorMsgSpan :: ErrMsg -> SrcSpan
setErrorMsgSpan :: ErrMsg -> SrcSpan -> ErrMsg
typeForUser :: Type -> SDoc
nameForUser :: Name -> SDoc
occNameForUser :: OccName -> SDoc
deSugar :: TypecheckedModule -> LHsExpr Id -> HscEnv -> IO (Maybe CoreExpr)
showDocWith :: DynFlags -> Mode -> Doc -> String
renderGm :: Doc -> String
data GapThing
GtA :: Type -> GapThing
GtT :: TyCon -> GapThing
GtN :: GapThing
GtPatSyn :: PatSyn -> GapThing
fromTyThing :: TyThing -> GapThing
fileModSummary :: GhcMonad m => FilePath -> m ModSummary
type WarnFlags = IntSet
emptyWarnFlags :: WarnFlags
type GLMatch = LMatch RdrName (LHsExpr RdrName)
type GLMatchI = LMatch Id (LHsExpr Id)
getClass :: [LInstDecl Name] -> Maybe (Name, SrcSpan)
occName :: HasOccName name => name -> OccName
listVisibleModuleNames :: DynFlags -> [ModuleName]
listVisibleModules :: DynFlags -> [Module]
lookupModulePackageInAllPackages :: DynFlags -> ModuleName -> [String]
isSynTyCon :: TyCon -> Bool
parseModuleHeader :: String -> DynFlags -> FilePath -> Either ErrorMessages (WarningMessages, Located (HsModule RdrName))
mkErrStyle' :: DynFlags -> PrintUnqualified -> PprStyle

-- | Like <tt>everything</tt>, but avoid known potholes, based on the
--   <a>Stage</a> that generated the Ast.
everythingStagedWithContext :: Stage -> s -> (r -> r -> r) -> r -> GenericQ (s -> (r, s)) -> GenericQ r
withCleanupSession :: GhcMonad m => m a -> m a
instance Language.Haskell.GhcMod.Gap.HasType (HsBinds.LHsBind Var.Id)

module Language.Haskell.GhcMod.Doc
showPage :: DynFlags -> PprStyle -> SDoc -> String
showOneLine :: DynFlags -> PprStyle -> SDoc -> String
getStyle :: GhcMonad m => m PprStyle
styleUnqualified :: PprStyle

module Language.Haskell.GhcMod.SrcUtils

-- | Stores mapping from monomorphic to polymorphic types
type CstGenQS = Map Var Type

-- | Generic type to simplify SYB definition
type CstGenQT a = forall m. GhcMonad m => a Id -> CstGenQS -> (m [(SrcSpan, Type)], CstGenQS)
collectSpansTypes :: (GhcMonad m) => Bool -> TypecheckedModule -> (Int, Int) -> m [(SrcSpan, Type)]
listifySpans :: Typeable a => TypecheckedSource -> (Int, Int) -> [Located a]
listifyParsedSpans :: Typeable a => ParsedSource -> (Int, Int) -> [Located a]
listifyRenamedSpans :: Typeable a => RenamedSource -> (Int, Int) -> [Located a]
listifyStaged :: Typeable r => Stage -> (r -> Bool) -> GenericQ [r]
cmp :: SrcSpan -> SrcSpan -> Ordering
toTup :: DynFlags -> PprStyle -> (SrcSpan, Type) -> ((Int, Int, Int, Int), String)
fourInts :: SrcSpan -> (Int, Int, Int, Int)
fourIntsHE :: SrcSpan -> (Int, Int, Int, Int)
typeSigInRangeHE :: Int -> Int -> Decl SrcSpanInfo -> Bool
pretty :: DynFlags -> PprStyle -> Type -> String
showName :: DynFlags -> PprStyle -> Name -> String
showOccName :: DynFlags -> PprStyle -> OccName -> String
instance Language.Haskell.GhcMod.Gap.HasType (HsExpr.LHsExpr Var.Id)
instance Language.Haskell.GhcMod.Gap.HasType (HsPat.LPat Var.Id)

module Language.Haskell.GhcMod.Monad.Newtypes
type GhcModT m = GmT (GmOutT m)
newtype GmOutT m a
GmOutT :: ReaderT GhcModOut m a -> GmOutT m a
[unGmOutT] :: GmOutT m a -> ReaderT GhcModOut m a
newtype GmT m a
GmT :: StateT GhcModState (ErrorT GhcModError (JournalT GhcModLog (ReaderT GhcModEnv m))) a -> GmT m a
[unGmT] :: GmT m a -> StateT GhcModState (ErrorT GhcModError (JournalT GhcModLog (ReaderT GhcModEnv m))) a
newtype GmlT m a
GmlT :: GhcModT m a -> GmlT m a
[unGmlT] :: GmlT m a -> GhcModT m a
newtype LightGhc a
LightGhc :: ReaderT (IORef HscEnv) IO a -> LightGhc a
[unLightGhc] :: LightGhc a -> ReaderT (IORef HscEnv) IO a
gmLiftInner :: Monad m => m a -> GmT m a
gmLiftWithInner :: (MonadTransControl t, Monad m, Monad (t m)) => (Run t -> m (StT t a)) -> t m a
instance GHC.Base.Monad Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance GHC.Base.Applicative Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance GHC.Base.Functor Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance GHC.Base.Monad m => Control.Monad.Error.Class.MonadError Language.Haskell.GhcMod.Types.GhcModError (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => GHC.Base.MonadPlus (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => GHC.Base.Monad (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => GHC.Base.Alternative (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Functor m => GHC.Base.Functor (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => Control.Monad.Error.Class.MonadError Language.Haskell.GhcMod.Types.GhcModError (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Monad m => GHC.Base.MonadPlus (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Monad m => GHC.Base.Monad (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Monad m => GHC.Base.Alternative (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Functor m => GHC.Base.Functor (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.Trans.Class.MonadTrans Language.Haskell.GhcMod.Monad.Newtypes.GmOutT
instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance GHC.Base.Monad m => GHC.Base.Monad (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance GHC.Base.Alternative m => GHC.Base.Alternative (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance GHC.Base.Applicative m => GHC.Base.Applicative (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance GHC.Base.Functor m => GHC.Base.Functor (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Base.MonadBase GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Control.Monad.Trans.Control.MonadTransControl Language.Haskell.GhcMod.Monad.Newtypes.GmOutT
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Base.MonadBase GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Control.Monad.Trans.Control.MonadTransControl Language.Haskell.GhcMod.Monad.Newtypes.GmlT
instance Control.Monad.Trans.Class.MonadTrans Language.Haskell.GhcMod.Monad.Newtypes.GmlT
instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance GHC.Base.Monad m => Control.Monad.Journal.Class.MonadJournal Language.Haskell.GhcMod.Types.GhcModLog (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Base.MonadBase GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m => Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.Trans.Control.MonadTransControl Language.Haskell.GhcMod.Monad.Newtypes.GmT
instance Control.Monad.Trans.Class.MonadTrans Language.Haskell.GhcMod.Monad.Newtypes.GmT

module Language.Haskell.GhcMod.Monad.Env
class Monad m => GmEnv m where gmeAsk = gmeReader id gmeReader f = f `liftM` gmeAsk
gmeAsk :: GmEnv m => m GhcModEnv
gmeReader :: GmEnv m => (GhcModEnv -> a) -> m a
gmeLocal :: GmEnv m => (GhcModEnv -> GhcModEnv) -> m a -> m a
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Env.GmEnv (Language.Haskell.GhcMod.Monad.Newtypes.GhcModT m)) => Language.Haskell.GhcMod.Monad.Env.GmEnv (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Env.GmEnv (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Language.Haskell.GhcMod.Monad.Env.GmEnv m => Language.Haskell.GhcMod.Monad.Env.GmEnv (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Language.Haskell.GhcMod.Monad.Env.GmEnv m => Language.Haskell.GhcMod.Monad.Env.GmEnv (Control.Monad.Trans.State.Strict.StateT s m)
instance Language.Haskell.GhcMod.Monad.Env.GmEnv m => Language.Haskell.GhcMod.Monad.Env.GmEnv (Control.Monad.Trans.Journal.JournalT Language.Haskell.GhcMod.Types.GhcModLog m)
instance Language.Haskell.GhcMod.Monad.Env.GmEnv m => Language.Haskell.GhcMod.Monad.Env.GmEnv (Control.Monad.Trans.Error.ErrorT Language.Haskell.GhcMod.Types.GhcModError m)

module Language.Haskell.GhcMod.Monad.Log
class Monad m => GmLog m
gmlJournal :: GmLog m => GhcModLog -> m ()
gmlHistory :: GmLog m => m GhcModLog
gmlClear :: GmLog m => m ()
instance Language.Haskell.GhcMod.Monad.Log.GmLog m => Language.Haskell.GhcMod.Monad.Log.GmLog (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Log.GmLog (Language.Haskell.GhcMod.Monad.Newtypes.GhcModT m)) => Language.Haskell.GhcMod.Monad.Log.GmLog (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Log.GmLog (Control.Monad.Trans.Journal.JournalT Language.Haskell.GhcMod.Types.GhcModLog m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Log.GmLog (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Log.GmLog m) => Language.Haskell.GhcMod.Monad.Log.GmLog (Control.Monad.Trans.Reader.ReaderT r m)
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Log.GmLog m) => Language.Haskell.GhcMod.Monad.Log.GmLog (Control.Monad.Trans.State.Strict.StateT s m)
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Log.GmLog m, Control.Monad.Trans.Error.Error e) => Language.Haskell.GhcMod.Monad.Log.GmLog (Control.Monad.Trans.Error.ErrorT e m)
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.Log.GmLog m) => Language.Haskell.GhcMod.Monad.Log.GmLog (Control.Monad.Trans.Maybe.MaybeT m)

module Language.Haskell.GhcMod.Monad.Orphans
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Control.Monad.IO.Class.MonadIO Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance Language.Haskell.GhcMod.Types.MonadIO GHC.Types.IO
instance Language.Haskell.GhcMod.Types.MonadIO m => Language.Haskell.GhcMod.Types.MonadIO (Control.Monad.Trans.Reader.ReaderT x m)
instance Language.Haskell.GhcMod.Types.MonadIO m => Language.Haskell.GhcMod.Types.MonadIO (Control.Monad.Trans.State.Strict.StateT x m)
instance (Control.Monad.Trans.Error.Error e, Language.Haskell.GhcMod.Types.MonadIO m) => Language.Haskell.GhcMod.Types.MonadIO (Control.Monad.Trans.Error.ErrorT e m)
instance Language.Haskell.GhcMod.Types.MonadIO m => Language.Haskell.GhcMod.Types.MonadIO (Control.Monad.Trans.Journal.JournalT x m)
instance Language.Haskell.GhcMod.Types.MonadIO m => Language.Haskell.GhcMod.Types.MonadIO (Control.Monad.Trans.Maybe.MaybeT m)
instance Language.Haskell.GhcMod.Types.MonadIOC m => Language.Haskell.GhcMod.Types.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance Language.Haskell.GhcMod.Types.MonadIOC m => Language.Haskell.GhcMod.Types.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Language.Haskell.GhcMod.Types.MonadIOC m => Language.Haskell.GhcMod.Types.MonadIO (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Language.Haskell.GhcMod.Types.MonadIO Language.Haskell.GhcMod.Monad.Newtypes.LightGhc

module Language.Haskell.GhcMod.Monad.Out
class Monad m => GmOut m
gmoAsk :: GmOut m => m GhcModOut
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Out.GmOut (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Out.GmOut (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Language.Haskell.GhcMod.Monad.Out.GmOut m => Language.Haskell.GhcMod.Monad.Out.GmOut (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Language.Haskell.GhcMod.Monad.Out.GmOut m => Language.Haskell.GhcMod.Monad.Out.GmOut (Control.Monad.Trans.State.Strict.StateT s m)
instance Language.Haskell.GhcMod.Monad.Out.GmOut m => Language.Haskell.GhcMod.Monad.Out.GmOut (Control.Monad.Trans.Journal.JournalT w m)
instance Language.Haskell.GhcMod.Monad.Out.GmOut m => Language.Haskell.GhcMod.Monad.Out.GmOut (Control.Monad.Trans.Maybe.MaybeT m)

module Language.Haskell.GhcMod.Monad.State
class Monad m => GmState m where gmsGet = gmsState (\ s -> (s, s)) gmsPut s = gmsState (\ _ -> ((), s)) gmsState f = do { s <- gmsGet; let ~(a, s') = f s; gmsPut s'; return a }
gmsGet :: GmState m => m GhcModState
gmsPut :: GmState m => GhcModState -> m ()
gmsState :: GmState m => (GhcModState -> (a, GhcModState)) -> m a
instance (GHC.Base.Monad m, Language.Haskell.GhcMod.Monad.State.GmState (Language.Haskell.GhcMod.Monad.Newtypes.GhcModT m)) => Language.Haskell.GhcMod.Monad.State.GmState (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Language.Haskell.GhcMod.Monad.State.GmState m => Language.Haskell.GhcMod.Monad.State.GmState (Control.Monad.Trans.State.Strict.StateT s m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.State.GmState (Control.Monad.Trans.State.Strict.StateT Language.Haskell.GhcMod.Types.GhcModState m)
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.State.GmState (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance Language.Haskell.GhcMod.Monad.State.GmState m => Language.Haskell.GhcMod.Monad.State.GmState (Control.Monad.Trans.Maybe.MaybeT m)

module Language.Haskell.GhcMod.Monad.Types
type GhcModT m = GmT (GmOutT m)
newtype GmOutT m a
GmOutT :: ReaderT GhcModOut m a -> GmOutT m a
[unGmOutT] :: GmOutT m a -> ReaderT GhcModOut m a
newtype GmT m a
GmT :: StateT GhcModState (ErrorT GhcModError (JournalT GhcModLog (ReaderT GhcModEnv m))) a -> GmT m a
[unGmT] :: GmT m a -> StateT GhcModState (ErrorT GhcModError (JournalT GhcModLog (ReaderT GhcModEnv m))) a
newtype GmlT m a
GmlT :: GhcModT m a -> GmlT m a
[unGmlT] :: GmlT m a -> GhcModT m a
newtype LightGhc a
LightGhc :: ReaderT (IORef HscEnv) IO a -> LightGhc a
[unLightGhc] :: LightGhc a -> ReaderT (IORef HscEnv) IO a
type GmGhc m = (IOish m, GhcMonad m)

-- | A constraint alias (-XConstraintKinds) to make functions dealing with
--   <tt>GhcModT</tt> somewhat cleaner.
--   
--   Basicially an <tt>IOish m =&gt; m</tt> is a <a>Monad</a> supporting
--   arbitrary <a>IO</a> and exception handling. Usually this will simply
--   be <a>IO</a> but we parametrise it in the exported API so users have
--   the option to use a custom inner monad.
type IOish m = (Functor m, MonadIO m, MonadBaseControl IO m, ExceptionMonad m)
data GhcModEnv
GhcModEnv :: Options -> Cradle -> GhcModEnv
[gmOptions] :: GhcModEnv -> Options
[gmCradle] :: GhcModEnv -> Cradle
data GhcModState
GhcModState :: !(Maybe GmGhcSession) -> !GhcModCaches -> !FileMappingMap -> GhcModState
[gmGhcSession] :: GhcModState -> !(Maybe GmGhcSession)
[gmCaches] :: GhcModState -> !GhcModCaches
[gmMMappedFiles] :: GhcModState -> !FileMappingMap
data GhcModCaches
GhcModCaches :: CacheContents ChCacheData [GhcPkgDb] -> CacheContents ChCacheData [GHCOption] -> CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint] -> CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath))) -> GhcModCaches
[gmcPackageDbStack] :: GhcModCaches -> CacheContents ChCacheData [GhcPkgDb]
[gmcMergedPkgOptions] :: GhcModCaches -> CacheContents ChCacheData [GHCOption]
[gmcComponents] :: GhcModCaches -> CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint]
[gmcResolvedComponents] :: GhcModCaches -> CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))
defaultGhcModState :: GhcModState
data GmGhcSession
GmGhcSession :: !(IORef HscEnv) -> GmGhcSession
[gmgsSession] :: GmGhcSession -> !(IORef HscEnv)
data GmComponent (t :: GmComponentType) eps
GmComponent :: GmModuleGraph -> ChComponentName -> [GHCOption] -> [GHCOption] -> [GHCOption] -> [GHCOption] -> ChEntrypoint -> eps -> [FilePath] -> GmComponent eps
[gmcHomeModuleGraph] :: GmComponent eps -> GmModuleGraph
[gmcName] :: GmComponent eps -> ChComponentName
[gmcGhcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcPkgOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcSrcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcLangOpts] :: GmComponent eps -> [GHCOption]
[gmcRawEntrypoints] :: GmComponent eps -> ChEntrypoint
[gmcEntrypoints] :: GmComponent eps -> eps
[gmcSourceDirs] :: GmComponent eps -> [FilePath]
data GmLogLevel
GmSilent :: GmLogLevel
GmPanic :: GmLogLevel
GmException :: GmLogLevel
GmError :: GmLogLevel
GmWarning :: GmLogLevel
GmInfo :: GmLogLevel
GmDebug :: GmLogLevel
GmVomit :: GmLogLevel
data GhcModLog
GhcModLog :: Maybe GmLogLevel -> Last Bool -> [(GmLogLevel, String, Doc)] -> GhcModLog
[gmLogLevel] :: GhcModLog -> Maybe GmLogLevel
[gmLogVomitDump] :: GhcModLog -> Last Bool
[gmLogMessages] :: GhcModLog -> [(GmLogLevel, String, Doc)]
data GhcModError

-- | Unknown error
GMENoMsg :: GhcModError

-- | Some Error with a message. These are produced mostly by <a>fail</a>
--   calls on GhcModT.
GMEString :: String -> GhcModError

-- | Configuring a cabal project failed.
GMECabalConfigure :: GhcModError -> GhcModError

-- | Configuring a stack project failed.
GMEStackConfigure :: GhcModError -> GhcModError

-- | Bootstrapping <tt>stack</tt> environment failed (process exited with
--   failure)
GMEStackBootstrap :: GhcModError -> GhcModError

-- | Could not find a consistent component assignment for modules
GMECabalCompAssignment :: [(Either FilePath ModuleName, Set ChComponentName)] -> GhcModError

-- | Launching an operating system process failed. Fields in order:
--   function, command, arguments, (stdout, stderr, exitcode)
GMEProcess :: String -> String -> [String] -> (Either Int GhcModError) -> GhcModError

-- | No cabal file found.
GMENoCabalFile :: GhcModError

-- | Too many cabal files found.
GMETooManyCabalFiles :: [FilePath] -> GhcModError
type Gm m = (GmEnv m, GmState m, GmLog m, GmOut m)
class Monad m => GmEnv m where gmeAsk = gmeReader id gmeReader f = f `liftM` gmeAsk
gmeAsk :: GmEnv m => m GhcModEnv
gmeReader :: GmEnv m => (GhcModEnv -> a) -> m a
gmeLocal :: GmEnv m => (GhcModEnv -> GhcModEnv) -> m a -> m a
class Monad m => GmState m where gmsGet = gmsState (\ s -> (s, s)) gmsPut s = gmsState (\ _ -> ((), s)) gmsState f = do { s <- gmsGet; let ~(a, s') = f s; gmsPut s'; return a }
gmsGet :: GmState m => m GhcModState
gmsPut :: GmState m => GhcModState -> m ()
gmsState :: GmState m => (GhcModState -> (a, GhcModState)) -> m a
class Monad m => GmLog m
gmlJournal :: GmLog m => GhcModLog -> m ()
gmlHistory :: GmLog m => m GhcModLog
gmlClear :: GmLog m => m ()
class Monad m => GmOut m
gmoAsk :: GmOut m => m GhcModOut
cradle :: GmEnv m => m Cradle
options :: GmEnv m => m Options
outputOpts :: GmOut m => m OutputOpts
withOptions :: GmEnv m => (Options -> Options) -> m a -> m a
getMMappedFiles :: GmState m => m FileMappingMap
setMMappedFiles :: GmState m => FileMappingMap -> m ()
addMMappedFile :: GmState m => FilePath -> FileMapping -> m ()
delMMappedFile :: GmState m => FilePath -> m ()
lookupMMappedFile :: GmState m => FilePath -> m (Maybe FileMapping)
getMMappedFilePaths :: GmState m => m [FilePath]
class MonadIOC m => MonadIO m
liftIO :: MonadIO m => IO a -> m a
liftIO :: MonadIO m => IO a -> m a

-- | Get the underlying GHC session
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv

-- | Set the underlying GHC session
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => GhcMonad.GhcMonad (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance GhcMonad.GhcMonad Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => DynFlags.HasDynFlags (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance DynFlags.HasDynFlags Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Language.Haskell.GhcMod.Monad.Newtypes.GmOutT m)
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Language.Haskell.GhcMod.Monad.Newtypes.GmT m)
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Language.Haskell.GhcMod.Monad.Newtypes.GmlT m)
instance Exception.ExceptionMonad Language.Haskell.GhcMod.Monad.Newtypes.LightGhc
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Control.Monad.Trans.State.Strict.StateT s m)
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Control.Monad.Trans.Reader.ReaderT s m)
instance (GHC.Base.Monoid w, Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Control.Monad.Trans.Journal.JournalT w m)
instance (Language.Haskell.GhcMod.Types.MonadIO m, Control.Monad.Trans.Control.MonadBaseControl GHC.Types.IO m) => Exception.ExceptionMonad (Control.Monad.Trans.Maybe.MaybeT m)

module Language.Haskell.GhcMod.Convert
convert :: ToString a => OutputOpts -> a -> String
convert' :: (ToString a, IOish m, GmEnv m) => a -> m String
emptyResult :: Monad m => OutputOpts -> m String
whenFound :: (Monad m, ToString b) => OutputOpts -> m (Maybe a) -> (a -> b) -> m String
whenFound' :: (Monad m, ToString b) => OutputOpts -> m (Maybe a) -> (a -> m b) -> m String
instance Language.Haskell.GhcMod.Convert.ToString GHC.Base.String
instance Language.Haskell.GhcMod.Convert.ToString [GHC.Base.String]
instance Language.Haskell.GhcMod.Convert.ToString [Language.Haskell.GhcMod.Types.ModuleString]
instance Language.Haskell.GhcMod.Convert.ToString [((GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int), GHC.Base.String)]
instance Language.Haskell.GhcMod.Convert.ToString ((GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int), GHC.Base.String)
instance Language.Haskell.GhcMod.Convert.ToString ((GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int), [GHC.Base.String])
instance Language.Haskell.GhcMod.Convert.ToString (GHC.Base.String, (GHC.Types.Int, GHC.Types.Int, GHC.Types.Int, GHC.Types.Int), [GHC.Base.String])

module Language.Haskell.GhcMod.Options.Options

-- | An optparse-applicative <tt>Parser</tt> sepcification for
--   <tt>Options</tt> so that applications making use of the ghc-mod API
--   can have a consistent way of parsing global options.
globalArgSpec :: Parser Options

-- | Parse a set of arguments according to the ghc-mod CLI flag spec,
--   producing <tt>Options</tt> set accordingly.
parseCmdLineOptions :: [String] -> Maybe Options

module Language.Haskell.GhcMod.Output
gmPutStr :: (MonadIO m, GmOut m) => String -> m ()
gmErrStr :: (MonadIO m, GmOut m) => String -> m ()
gmPutStrLn :: (MonadIO m, GmOut m) => String -> m ()
gmErrStrLn :: (MonadIO m, GmOut m) => String -> m ()
gmPutStrIO :: (GmOut m, MonadIO mi) => m (String -> mi ())
gmErrStrIO :: (GmOut m, MonadIO mi) => m (String -> mi ())
gmReadProcess :: GmOut m => m (FilePath -> [String] -> String -> IO String)
gmReadProcess' :: GmOut m => m (FilePath -> [String] -> String -> IO ByteString)
stdoutGateway :: (String, String) -> Chan (Either (MVar ()) (GmStream, String)) -> IO ()
flushStdoutGateway :: Chan (Either (MVar ()) (GmStream, String)) -> IO ()
instance Language.Haskell.GhcMod.Output.ProcessOutput GHC.Base.String
instance Language.Haskell.GhcMod.Output.ProcessOutput Data.ByteString.Lazy.Internal.ByteString

module Language.Haskell.GhcMod.Pretty
renderGm :: Doc -> String
renderSDoc :: GhcMonad m => SDoc -> m Doc
gmComponentNameDoc :: ChComponentName -> Doc
gmLogLevelDoc :: GmLogLevel -> Doc
(<+>:) :: Doc -> Doc -> Doc
infixl 6 <+>:
fnDoc :: FilePath -> Doc
showToDoc :: Show a => a -> Doc
warnDoc :: Doc -> Doc
strLnDoc :: String -> Doc
strDoc :: String -> Doc

module Language.Haskell.GhcMod.Error
data GhcModError

-- | Unknown error
GMENoMsg :: GhcModError

-- | Some Error with a message. These are produced mostly by <a>fail</a>
--   calls on GhcModT.
GMEString :: String -> GhcModError

-- | Configuring a cabal project failed.
GMECabalConfigure :: GhcModError -> GhcModError

-- | Configuring a stack project failed.
GMEStackConfigure :: GhcModError -> GhcModError

-- | Bootstrapping <tt>stack</tt> environment failed (process exited with
--   failure)
GMEStackBootstrap :: GhcModError -> GhcModError

-- | Could not find a consistent component assignment for modules
GMECabalCompAssignment :: [(Either FilePath ModuleName, Set ChComponentName)] -> GhcModError

-- | Launching an operating system process failed. Fields in order:
--   function, command, arguments, (stdout, stderr, exitcode)
GMEProcess :: String -> String -> [String] -> (Either Int GhcModError) -> GhcModError

-- | No cabal file found.
GMENoCabalFile :: GhcModError

-- | Too many cabal files found.
GMETooManyCabalFiles :: [FilePath] -> GhcModError
type GmError m = MonadError GhcModError m
gmeDoc :: GhcModError -> Doc
ghcExceptionDoc :: GhcException -> Doc
liftMaybe :: MonadError e m => e -> m (Maybe a) -> m a
overrideError :: MonadError e m => e -> m a -> m a
modifyError :: MonadError e m => (e -> e) -> m a -> m a
modifyError' :: MonadError e m => m a -> (e -> e) -> m a
infixr 0 `modifyError'`
modifyGmError :: (MonadIO m, ExceptionMonad m) => (GhcModError -> GhcModError) -> m a -> m a
tryFix :: MonadError e m => m a -> (e -> m ()) -> m a
data GHandler m a
GHandler :: (e -> m a) -> GHandler m a
gcatches :: (MonadIO m, ExceptionMonad m) => m a -> [GHandler m a] -> m a

module Language.Haskell.GhcMod.DebugLogger
debugLogAction :: (String -> IO ()) -> GmLogAction
debugLogActionHPrintDoc :: DynFlags -> (String -> IO ()) -> SDoc -> PprStyle -> IO ()
debugLogActionHPutStrDoc :: DynFlags -> (String -> IO ()) -> SDoc -> PprStyle -> IO ()
gmPrintDoc :: Mode -> Int -> (String -> IO ()) -> Doc -> IO ()
gmPrintDoc_ :: Mode -> Int -> (String -> IO ()) -> Doc -> IO ()

module Language.Haskell.GhcMod.DynFlags
setEmptyLogger :: DynFlags -> DynFlags
setDebugLogger :: (String -> IO ()) -> DynFlags -> DynFlags
setHscNothing :: DynFlags -> DynFlags
setHscInterpreted :: DynFlags -> DynFlags

-- | Parse command line ghc options and add them to the <a>DynFlags</a>
--   passed
addCmdOpts :: GhcMonad m => [GHCOption] -> DynFlags -> m DynFlags
withDynFlags :: GhcMonad m => (DynFlags -> DynFlags) -> m a -> m a
withCmdFlags :: GhcMonad m => [GHCOption] -> m a -> m a

-- | Set <a>DynFlags</a> equivalent to "-w:".
setNoWarningFlags :: DynFlags -> DynFlags

-- | Set <a>DynFlags</a> equivalent to "-Wall".
setAllWarningFlags :: DynFlags -> DynFlags
allWarningFlags :: WarnFlags
deferErrors :: Monad m => DynFlags -> m DynFlags
eqDynFlags :: DynFlags -> DynFlags -> Bool

module Language.Haskell.GhcMod.LightGhc
newLightEnv :: IOish m => (DynFlags -> LightGhc DynFlags) -> m HscEnv
teardownLightEnv :: MonadIO m => HscEnv -> m ()
withLightHscEnv' :: IOish m => (DynFlags -> LightGhc DynFlags) -> (HscEnv -> m a) -> m a
withLightHscEnv :: IOish m => [GHCOption] -> (HscEnv -> m a) -> m a
runLightGhc :: MonadIO m => HscEnv -> LightGhc a -> m a
runLightGhc' :: MonadIO m => IORef HscEnv -> LightGhc a -> m a

module Language.Haskell.GhcMod.Logging
gmSetLogLevel :: GmLog m => GmLogLevel -> m ()
gmGetLogLevel :: forall m. GmLog m => m GmLogLevel
gmSetDumpLevel :: GmLog m => Bool -> m ()
increaseLogLevel :: GmLogLevel -> GmLogLevel
decreaseLogLevel :: GmLogLevel -> GmLogLevel

-- | <pre>
--   &gt;&gt;&gt; Just GmDebug &lt;= Nothing
--   False
--   
--   &gt;&gt;&gt; Just GmException &lt;= Just GmDebug
--   True
--   
--   &gt;&gt;&gt; Just GmDebug &lt;= Just GmException
--   False
--   </pre>
gmLog :: (MonadIO m, GmLog m, GmOut m) => GmLogLevel -> String -> Doc -> m ()
gmLogQuiet :: GmLog m => GmLogLevel -> String -> Doc -> m ()
gmAppendLogQuiet :: GmLog m => GhcModLog -> m ()
gmVomit :: (MonadIO m, GmLog m, GmOut m, GmEnv m) => String -> Doc -> String -> m ()
newtype LogDiscardT m a
LogDiscardT :: m a -> LogDiscardT m a
[runLogDiscard] :: LogDiscardT m a -> m a
data GmLogLevel
GmSilent :: GmLogLevel
GmPanic :: GmLogLevel
GmException :: GmLogLevel
GmError :: GmLogLevel
GmWarning :: GmLogLevel
GmInfo :: GmLogLevel
GmDebug :: GmLogLevel
GmVomit :: GmLogLevel
instance GHC.Base.Monad m => GHC.Base.Monad (Language.Haskell.GhcMod.Logging.LogDiscardT m)
instance GHC.Base.Applicative m => GHC.Base.Applicative (Language.Haskell.GhcMod.Logging.LogDiscardT m)
instance GHC.Base.Functor m => GHC.Base.Functor (Language.Haskell.GhcMod.Logging.LogDiscardT m)
instance Control.Monad.Trans.Class.MonadTrans Language.Haskell.GhcMod.Logging.LogDiscardT
instance GHC.Base.Monad m => Language.Haskell.GhcMod.Monad.Log.GmLog (Language.Haskell.GhcMod.Logging.LogDiscardT m)

module Language.Haskell.GhcMod.Caching

-- | Cache a MonadIO action with proper invalidation.
cached :: forall m a d. (Gm m, MonadIO m, Binary a, Eq d, Binary d, Show d) => FilePath -> Cached m GhcModState d a -> d -> m a
timeCacheInput :: MonadIO m => FilePath -> [FilePath] -> m [TimedFile]
invalidatingInputFiles :: TimedCacheFiles -> [FilePath]

module Language.Haskell.GhcMod.Utils
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
withDirectory_ :: (MonadIO m, ExceptionMonad m) => FilePath -> m a -> m a
uniqTempDirName :: FilePath -> FilePath
newTempDir :: FilePath -> IO FilePath
whenM :: Monad m => m Bool -> m () -> m ()

-- | Returns the path to the currently running ghc-mod executable. With
--   ghc&lt;7.6 this is a guess but &gt;=7.6 uses <a>getExecutablePath</a>.
ghcModExecutable :: IO FilePath
getExecutablePath' :: IO FilePath
canonFilePath :: FilePath -> IO FilePath
withMappedFile :: (IOish m, GmState m, GmEnv m) => forall a. FilePath -> (FilePath -> m a) -> m a
getCanonicalFileNameSafe :: (IOish m, GmEnv m) => FilePath -> m FilePath
mkRevRedirMapFunc :: (Functor m, GmState m, GmEnv m) => m (FilePath -> FilePath)
findFilesWith' :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath]

-- | Make a path absolute by prepending the current directory (if it isn't
--   already absolute) and applying <a>normalise</a> to the result.
--   
--   If the path is already absolute, the operation never fails. Otherwise,
--   the operation may fail with the same exceptions as
--   <a>getCurrentDirectory</a>.
makeAbsolute' :: FilePath -> IO FilePath
data TimedFile
TimedFile :: FilePath -> ModTime -> TimedFile
[tfPath] :: TimedFile -> FilePath
[tfTime] :: TimedFile -> ModTime
timeFile :: FilePath -> IO TimedFile
mightExist :: FilePath -> IO (Maybe FilePath)
timeMaybe :: FilePath -> IO (Maybe TimedFile)

-- | <tt>readProcess</tt> forks an external process, reads its standard
--   output strictly, blocking until the process terminates, and returns
--   the output string. The external process inherits the standard error.
--   
--   If an asynchronous exception is thrown to the thread executing
--   <tt>readProcess</tt>, the forked process will be terminated and
--   <tt>readProcess</tt> will wait (block) until the process has been
--   terminated.
--   
--   Output is returned strictly, so this is not suitable for interactive
--   applications.
--   
--   This function throws an <a>IOError</a> if the process <a>ExitCode</a>
--   is anything other than <a>ExitSuccess</a>. If instead you want to get
--   the <a>ExitCode</a> then use <a>readProcessWithExitCode</a>.
--   
--   Users of this function should compile with <tt>-threaded</tt> if they
--   want other Haskell threads to keep running while waiting on the result
--   of readProcess.
--   
--   <pre>
--   &gt; readProcess "date" [] []
--   "Thu Feb  7 10:03:39 PST 2008\n"
--   </pre>
--   
--   The arguments are:
--   
--   <ul>
--   <li>The command to run, which must be in the $PATH, or an absolute or
--   relative path</li>
--   <li>A list of separate command line arguments to the program</li>
--   <li>A string to pass on standard input to the forked process.</li>
--   </ul>
readProcess :: FilePath -> [String] -> String -> IO String

module Language.Haskell.GhcMod.Logger

-- | Logged messages are returned as <a>String</a>. Right is success and
--   Left is failure.
withLogger :: (GmGhc m, GmEnv m, GmOut m, GmState m) => (DynFlags -> DynFlags) -> m a -> m (Either String (String, a))
withLogger' :: (IOish m, GmState m, GmEnv m) => HscEnv -> ((DynFlags -> DynFlags) -> m a) -> m (Either [String] ([String], a))
checkErrorPrefix :: String
errsToStr :: [ErrMsg] -> GmPprEnvM [String]
errBagToStrList :: (IOish m, GmState m, GmEnv m) => HscEnv -> Bag ErrMsg -> m [String]

module Language.Haskell.GhcMod.HomeModuleGraph
data GmModuleGraph
GmModuleGraph :: Map ModulePath (Set ModulePath) -> GmModuleGraph
[gmgGraph] :: GmModuleGraph -> Map ModulePath (Set ModulePath)
data ModulePath
ModulePath :: ModuleName -> FilePath -> ModulePath
[mpModule] :: ModulePath -> ModuleName
[mpPath] :: ModulePath -> FilePath
mkFileMap :: Set ModulePath -> Map FilePath ModulePath
mkModuleMap :: Set ModulePath -> Map ModuleName ModulePath
mkMainModulePath :: FilePath -> ModulePath
findModulePath :: HscEnv -> ModuleName -> IO (Maybe ModulePath)
findModulePathSet :: HscEnv -> [ModuleName] -> IO (Set ModulePath)
fileModuleName :: (IOish m, GmEnv m, GmState m) => HscEnv -> FilePath -> m (Either [String] (Maybe ModuleName))
canonicalizeModulePath :: ModulePath -> IO ModulePath
homeModuleGraph :: (IOish m, Gm m) => HscEnv -> Set ModulePath -> m GmModuleGraph
updateHomeModuleGraph :: (IOish m, Gm m) => HscEnv -> GmModuleGraph -> Set ModulePath -> Set ModulePath -> m GmModuleGraph
canonicalizeModuleGraph :: MonadIO m => GmModuleGraph -> m GmModuleGraph
reachable :: Set ModulePath -> GmModuleGraph -> Set ModulePath

-- | Turn module graph into a graphviz dot file
--   
--   <pre>
--   dot -Tpng -o modules.png modules.dot
--   </pre>
moduleGraphToDot :: GmModuleGraph -> String

module Language.Haskell.GhcMod.FileMapping

-- | maps <a>FilePath</a>, given as first argument to take source from
--   <a>FilePath</a> given as second argument. Works exactly the same as
--   first form of `--map-file` CLI option.
--   
--   'from' can be either full path, or path relative to project root. 'to'
--   has to be either relative to project root, or full path (preferred)
loadMappedFile :: IOish m => FilePath -> FilePath -> GhcModT m ()

-- | maps <a>FilePath</a>, given as first argument to have source as given
--   by second argument.
--   
--   'from' may or may not exist, and should be either full path, or
--   relative to project root.
loadMappedFileSource :: IOish m => FilePath -> String -> GhcModT m ()

-- | unloads previously mapped file 'file', so that it's no longer mapped,
--   and removes any temporary files created when file was mapped.
--   
--   'file' should be either full path, or relative to project root.
unloadMappedFile :: IOish m => FilePath -> GhcModT m ()
mapFile :: (IOish m, GmState m) => HscEnv -> Target -> m Target
fileModSummaryWithMapping :: (IOish m, GmState m, GhcMonad m, GmEnv m) => FilePath -> m ModSummary

module Language.Haskell.GhcMod.PathsAndFiles

-- | Guaranteed to be a path to a directory with no trailing slash.
type DirPath = FilePath

-- | Guaranteed to be the name of a file only (no slashes).
type FileName = String

-- | <tt>findCabalFiles dir</tt>. Searches for a <tt>.cabal</tt> files in
--   <tt>dir</tt>'s parent directories. The first parent directory
--   containing more than one cabal file is assumed to be the project
--   directory. If only one cabal file exists in this directory it is
--   returned otherwise <tt>findCabalFiles</tt> throws
--   <a>GMENoCabalFile</a> or <a>GMETooManyCabalFiles</a>
findCabalFile :: FilePath -> IO (Maybe FilePath)
findStackConfigFile :: FilePath -> IO (Maybe FilePath)
findCabalSandboxDir :: FilePath -> IO (Maybe FilePath)
findCustomPackageDbFile :: FilePath -> IO (Maybe FilePath)

-- | Get path to sandbox config file
getSandboxDb :: Cradle -> IO (Maybe GhcPkgDb)

-- | Extract the sandbox package db directory from the cabal.sandbox.config
--   file. Exception is thrown if the sandbox config file is broken.
extractSandboxDbDir :: String -> Maybe FilePath

-- | <pre>
--   &gt;&gt;&gt; isCabalFile "/home/user/.cabal"
--   False
--   </pre>
isCabalFile :: FilePath -> Bool

-- | <pre>
--   &gt;&gt;&gt; takeExtension' "/some/dir/bla.cabal"
--   ".cabal"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; takeExtension' "some/reldir/bla.cabal"
--   ".cabal"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; takeExtension' "bla.cabal"
--   ".cabal"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; takeExtension' ".cabal"
--   ""
--   </pre>
takeExtension' :: FilePath -> String

-- | <tt>findFileInParentsP p r dir</tt> Look for files satisfying
--   <tt>p</tt> in <tt>dir</tt> and all it's parent directories. Files
--   found to satisfy <tt>p</tt> in a given directory are passed to
--   <tt>r</tt> and if this yields a <a>Just</a> value the search finishes
--   early without examinig any more directories and this value is
--   returned.
findFileInParentsP :: (FilePath -> Bool) -> ([FilePath] -> Maybe a) -> FilePath -> IO (Maybe a)

-- | <tt>findFilesInParentsP p dir</tt> Look for files satisfying
--   <tt>p</tt> in <tt>dir</tt> and all it's parent directories.
findFilesInParentsP :: (FilePath -> Bool) -> FilePath -> IO [IO [FilePath]]

-- | <tt>getFilesP p dir</tt>. Find all <b>files</b> satisfying <tt>p</tt>
--   in <tt>.cabal</tt> in <tt>dir</tt>.
getFilesP :: (FilePath -> Bool) -> DirPath -> IO [FileName]

-- | <tt>parents dir</tt>. Returns all parent directories of <tt>dir</tt>
--   including <tt>dir</tt>.
--   
--   Examples
--   
--   <pre>
--   &gt;&gt;&gt; parents "foo"
--   ["foo"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; parents "/foo"
--   ["/foo","/"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; parents "/foo/bar"
--   ["/foo/bar","/foo","/"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; parents "foo/bar"
--   ["foo/bar","foo"]
--   </pre>
parents :: FilePath -> [FilePath]
setupConfigFile :: Cradle -> FilePath
sandboxConfigFile :: Cradle -> FilePath
sandboxConfigFileName :: String

-- | Path to <tt>LocalBuildInfo</tt> file, usually
--   <tt>dist/setup-config</tt>
setupConfigPath :: FilePath -> FilePath
macrosHeaderPath :: FilePath
autogenModulePath :: String -> String
autogenModulesDir :: FilePath
ghcSandboxPkgDbDir :: String -> String
packageCache :: String

-- | Filename of the symbol table cache file.
symbolCache :: Cradle -> FilePath
symbolCacheFile :: String
resolvedComponentsCacheFile :: FilePath -> FilePath
cabalHelperCacheFile :: FilePath -> FilePath
mergedPkgOptsCacheFile :: FilePath -> FilePath
pkgDbStackCacheFile :: FilePath -> FilePath

module Language.Haskell.GhcMod.CustomPackageDb
parseCustomPackageDb :: String -> [GhcPkgDb]
getCustomPkgDbStack :: (MonadIO m, GmEnv m) => m (Maybe [GhcPkgDb])

module Language.Haskell.GhcMod.Stack
patchStackPrograms :: (IOish m, GmOut m) => Cradle -> Programs -> m Programs
getStackEnv :: (IOish m, GmOut m, GmLog m) => FilePath -> FilePath -> m (Maybe StackEnv)
getStackGhcPath :: IOish m => StackEnv -> m (Maybe FilePath)
getStackGhcPkgPath :: IOish m => StackEnv -> m (Maybe FilePath)
findExecutablesInStackBinPath :: IOish m => String -> StackEnv -> m (Maybe FilePath)
findExecutablesInDirectories' :: [FilePath] -> String -> IO [FilePath]
readStack :: (IOish m, GmOut m, GmLog m) => FilePath -> [String] -> MaybeT m String

module Language.Haskell.GhcMod.CabalHelper

-- | Primary interface to cabal-helper and intended single entrypoint to
--   constructing <a>GmComponent</a>s
--   
--   The Component's <a>gmcHomeModuleGraph</a> will be empty and has to be
--   resolved by <tt>resolveGmComponents</tt>.
getComponents :: (Applicative m, IOish m, Gm m) => m [GmComponent GMCRaw ChEntrypoint]

-- | Only package related GHC options, sufficient for things that don't
--   need to access home modules
getGhcMergedPkgOptions :: (Applicative m, IOish m, Gm m) => m [GHCOption]
getCabalPackageDbStack :: (IOish m, Gm m) => m [GhcPkgDb]
prepareCabalHelper :: (IOish m, GmEnv m, GmOut m, GmLog m) => m ()
withAutogen :: (IOish m, GmEnv m, GmOut m, GmLog m) => m a -> m a
withCabal :: (IOish m, GmEnv m, GmOut m, GmLog m) => m a -> m a

module Language.Haskell.GhcMod.Cradle

-- | Finding <a>Cradle</a>. Find a cabal file by tracing ancestor
--   directories. Find a sandbox according to a cabal sandbox config in a
--   cabal directory.
findCradle :: (GmLog m, IOish m, GmOut m) => Programs -> m Cradle
findCradle' :: (GmLog m, IOish m, GmOut m) => Programs -> FilePath -> m Cradle
findCradleNoLog :: forall m. (IOish m, GmOut m) => Programs -> m Cradle
findSpecCradle :: (GmLog m, IOish m, GmOut m) => Programs -> FilePath -> m Cradle
cleanupCradle :: Cradle -> IO ()
plainCradle :: (IOish m, GmLog m, GmOut m) => FilePath -> MaybeT m Cradle

module Language.Haskell.GhcMod.GhcPkg
ghcPkgDbOpt :: GhcPkgDb -> [String]

-- | Get options needed to add a list of package dbs to ghc-pkg's db stack
ghcPkgDbStackOpts :: [GhcPkgDb] -> [String]

-- | Get options needed to add a list of package dbs to ghc's db stack
ghcDbStackOpts :: [GhcPkgDb] -> [String]
ghcDbOpt :: GhcPkgDb -> [String]
getPackageDbStack :: IOish m => GhcModT m [GhcPkgDb]
getPackageCachePaths :: IOish m => FilePath -> GhcModT m [FilePath]
getGhcPkgProgram :: IOish m => GhcModT m FilePath

module Language.Haskell.GhcMod.Target
runGmPkgGhc :: (IOish m, Gm m) => LightGhc a -> m a
initSession :: IOish m => [GHCOption] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> GhcModT m ()

-- | Drop the currently active GHC session, the next that requires a GHC
--   session will initialize a new one.
dropSession :: IOish m => GhcModT m ()

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules
runGmlT :: IOish m => [Either FilePath ModuleName] -> GmlT m a -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules, with updated GHC flags
runGmlT' :: IOish m => [Either FilePath ModuleName] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> GmlT m a -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules, with updated GHC flags and a final
--   transformation
runGmlTWith :: IOish m => [Either FilePath ModuleName] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> (GmlT m a -> GmlT m b) -> GmlT m a -> GhcModT m b
targetGhcOptions :: forall m. IOish m => Cradle -> Set (Either FilePath ModuleName) -> GhcModT m [GHCOption]
resolvedComponentsCache :: IOish m => FilePath -> Cached (GhcModT m) GhcModState [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))
moduleComponents :: Map ChComponentName (GmComponent t (Set ModulePath)) -> Either FilePath ModuleName -> Set ChComponentName
findCandidates :: [Set ChComponentName] -> Set ChComponentName
pickComponent :: Set ChComponentName -> ChComponentName
packageGhcOptions :: (IOish m, Applicative m, Gm m) => m [GHCOption]
sandboxOpts :: (IOish m, GmEnv m) => Cradle -> m [String]
resolveGmComponent :: (IOish m, Gm m) => Maybe [CompilationUnit] -> GmComponent GMCRaw (Set ModulePath) -> m (GmComponent GMCResolved (Set ModulePath))
resolveEntrypoint :: (IOish m, Gm m) => Cradle -> GmComponent GMCRaw ChEntrypoint -> m (GmComponent GMCRaw (Set ModulePath))
resolveChEntrypoints :: FilePath -> ChEntrypoint -> IO [CompilationUnit]
chModToMod :: ChModuleName -> ModuleName
resolveModule :: (IOish m, Gm m) => HscEnv -> [FilePath] -> CompilationUnit -> m (Maybe ModulePath)
type CompilationUnit = Either FilePath ModuleName
type Components = [GmComponent GMCRaw (Set ModulePath)]
type ResolvedComponentsMap = Map ChComponentName (GmComponent GMCResolved (Set ModulePath))
resolveGmComponents :: (IOish m, Gm m) => Maybe ([CompilationUnit], ResolvedComponentsMap) -> Components -> m ResolvedComponentsMap

-- | Set the files as targets and load them.
loadTargets :: IOish m => [GHCOption] -> [FilePath] -> GmlT m ()
needsHscInterpreted :: ModuleGraph -> Bool
cabalResolvedComponents :: (IOish m) => GhcModT m (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))

module Language.Haskell.GhcMod.Monad
runGmOutT :: IOish m => Options -> GmOutT m a -> m a
runGmOutT' :: GhcModOut -> GmOutT m a -> m a

-- | Run a <tt>GhcModT m</tt> computation.
runGhcModT :: IOish m => Options -> GhcModT m a -> m (Either GhcModError a, GhcModLog)

-- | Run a computation inside <tt>GhcModT</tt> providing the RWST
--   environment and initial state. This is a low level function, use it
--   only if you know what to do with <a>GhcModEnv</a> and
--   <a>GhcModState</a>.
--   
--   You should probably look at <a>runGhcModT</a> instead.
runGhcModT' :: IOish m => GhcModEnv -> GhcModState -> GhcModT m a -> GmOutT m (Either GhcModError (a, GhcModState), GhcModLog)

-- | <tt>hoistGhcModT result</tt>. Embed a GhcModT computation's result
--   into a GhcModT computation. Note that if the computation that returned
--   <tt>result</tt> modified the state part of GhcModT this cannot be
--   restored.
hoistGhcModT :: IOish m => (Either GhcModError a, GhcModLog) -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules
runGmlT :: IOish m => [Either FilePath ModuleName] -> GmlT m a -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules, with updated GHC flags
runGmlT' :: IOish m => [Either FilePath ModuleName] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> GmlT m a -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules, with updated GHC flags and a final
--   transformation
runGmlTWith :: IOish m => [Either FilePath ModuleName] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> (GmlT m a -> GmlT m b) -> GmlT m a -> GhcModT m b
runGmPkgGhc :: (IOish m, Gm m) => LightGhc a -> m a
withGhcModEnv :: (IOish m, GmOut m) => FilePath -> Options -> ((GhcModEnv, GhcModLog) -> m a) -> m a
withGhcModEnv' :: (IOish m, GmOut m) => (FilePath -> ((Cradle, GhcModLog) -> m a) -> m a) -> FilePath -> Options -> ((GhcModEnv, GhcModLog) -> m a) -> m a

module GhcModExe.Browse

-- | Getting functions, classes, etc from a module.
browse :: forall m. IOish m => BrowseOpts -> String -> GhcModT m String

-- | Options for "browseWith" function
data BrowseOpts
BrowseOpts :: Bool -> Bool -> Bool -> Bool -> BrowseOpts

-- | If <a>True</a>, "browseWith" also returns operators.
[optBrowseOperators] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" also returns types.
[optBrowseDetailed] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" also returns parents.
[optBrowseParents] :: BrowseOpts -> Bool

-- | If <a>True</a>, "browseWith" will return fully qualified name
[optBrowseQualified] :: BrowseOpts -> Bool

module GhcModExe.CaseSplit

-- | Splitting a variable in a equation.
splits :: IOish m => FilePath -> Int -> Int -> GhcModT m String

module GhcModExe.Check

-- | Checking syntax of a target file using GHC. Warnings and errors are
--   returned.
checkSyntax :: IOish m => [FilePath] -> GhcModT m String

-- | Checking syntax of a target file using GHC. Warnings and errors are
--   returned.
check :: IOish m => [FilePath] -> GhcModT m (Either String String)

-- | Expanding Haskell Template.
expandTemplate :: IOish m => [FilePath] -> GhcModT m String

-- | Expanding Haskell Template.
expand :: IOish m => [FilePath] -> GhcModT m (Either String String)

module GhcModExe.FillSig

-- | Create a initial body from a signature.
sig :: IOish m => FilePath -> Int -> Int -> GhcModT m String
refine :: IOish m => FilePath -> Int -> Int -> Expression -> GhcModT m String
auto :: IOish m => FilePath -> Int -> Int -> GhcModT m String
instance GhcModExe.FillSig.FnArgsInfo (HsTypes.HsType RdrName.RdrName) RdrName.RdrName
instance GhcModExe.FillSig.FnArgsInfo (Language.Haskell.Exts.Syntax.Type Language.Haskell.Exts.SrcLoc.SrcSpanInfo) (Language.Haskell.Exts.Syntax.Name Language.Haskell.Exts.SrcLoc.SrcSpanInfo)
instance GhcModExe.FillSig.FnArgsInfo TyCoRep.Type Var.Id

module GhcModExe.Flag

-- | Listing of GHC flags, same as <tt>ghc</tt>'s <tt>--show-options</tt>
--   with <tt>ghc &gt;= 7.10</tt>.
flags :: IOish m => GhcModT m String

module GhcModExe.Info

-- | Obtaining information of a target expression. (GHCi's info:)
info :: IOish m => FilePath -> Expression -> GhcModT m String

-- | Obtaining type of a target expression. (GHCi's type:)
types :: IOish m => Bool -> FilePath -> Int -> Int -> GhcModT m String

module GhcModExe.Lang

-- | Listing language extensions.
languages :: IOish m => GhcModT m String

module GhcModExe.Lint

-- | Checking syntax of a target file using hlint. Warnings and errors are
--   returned.
lint :: IOish m => LintOpts -> FilePath -> GhcModT m String

module GhcModExe.Modules

-- | Listing installed modules.
modules :: (IOish m, Gm m) => Bool -> m String

module GhcModExe.Boot

-- | Printing necessary information for front-end booting.
boot :: IOish m => GhcModT m String
preBrowsedModules :: [String]

module GhcModExe.PkgDoc

-- | Obtaining the package name and the doc path of a module.
pkgDoc :: IOish m => String -> GhcModT m String

module GhcModExe.Test
test :: IOish m => FilePath -> GhcModT m String
runTest :: GhcMonad m => String -> m (Maybe SomeException)

module Language.Haskell.GhcMod.World
data World
World :: [TimedFile] -> Maybe TimedFile -> Maybe TimedFile -> Maybe TimedFile -> FileMappingMap -> World
[worldPackageCaches] :: World -> [TimedFile]
[worldCabalFile] :: World -> Maybe TimedFile
[worldCabalConfig] :: World -> Maybe TimedFile
[worldCabalSandboxConfig] :: World -> Maybe TimedFile
[worldMappedFiles] :: World -> FileMappingMap
timedPackageCaches :: IOish m => GhcModT m [TimedFile]
getCurrentWorld :: IOish m => GhcModT m World
didWorldChange :: IOish m => World -> GhcModT m Bool
isYoungerThanSetupConfig :: FilePath -> World -> IO Bool
instance GHC.Classes.Eq Language.Haskell.GhcMod.World.World

module GhcModExe.Find

-- | Type of function and operation names.
type Symbol = ByteString

-- | Database from <a>Symbol</a> to &lt;math&gt;.
data SymbolDb

-- | Loading a file and creates <a>SymbolDb</a>.
loadSymbolDb :: IOish m => GhcModT m SymbolDb

-- | Looking up <a>SymbolDb</a> with <a>Symbol</a> to &lt;math&gt; which
--   will be concatenated.
lookupSymbol :: IOish m => String -> SymbolDb -> GhcModT m String

-- | Dumps a <a>Binary</a> representation of <a>SymbolDb</a> to stdout
dumpSymbol :: IOish m => GhcModT m ()

-- | Looking up <a>SymbolDb</a> with <a>Symbol</a> to &lt;math&gt; which
--   will be concatenated. <a>loadSymbolDb</a> is called internally.
findSymbol :: IOish m => String -> GhcModT m String
lookupSym :: Symbol -> SymbolDb -> [ModuleString]
isOutdated :: IOish m => SymbolDb -> GhcModT m Bool
data AsyncSymbolDb
newAsyncSymbolDb :: IOish m => GhcModT m AsyncSymbolDb
getAsyncSymbolDb :: forall m. IOish m => AsyncSymbolDb -> GhcModT m SymbolDb
instance GHC.Generics.Generic GhcModExe.Find.SymbolDb
instance Data.Binary.Class.Binary GhcModExe.Find.SymbolDb
instance Control.DeepSeq.NFData GhcModExe.Find.SymbolDb


-- | Low level access to the ghc-mod library.
module GhcModExe.Internal

-- | A single GHC command line option.
type GHCOption = String

-- | An include directory for modules.
type IncludeDir = FilePath
newtype GmlT m a
GmlT :: GhcModT m a -> GmlT m a
[unGmlT] :: GmlT m a -> GhcModT m a
class MonadIOC m => MonadIO m
liftIO :: MonadIO m => IO a -> m a
class Monad m => GmEnv m where gmeAsk = gmeReader id gmeReader f = f `liftM` gmeAsk
gmeAsk :: GmEnv m => m GhcModEnv
gmeReader :: GmEnv m => (GhcModEnv -> a) -> m a
gmeLocal :: GmEnv m => (GhcModEnv -> GhcModEnv) -> m a -> m a

-- | Obtaining the directory for ghc system libraries.
ghcLibDir :: FilePath

-- | Returns the path to the currently running ghc-mod executable. With
--   ghc&lt;7.6 this is a guess but &gt;=7.6 uses <a>getExecutablePath</a>.
ghcModExecutable :: IO FilePath

-- | Logged messages are returned as <a>String</a>. Right is success and
--   Left is failure.
withLogger :: (GmGhc m, GmEnv m, GmOut m, GmState m) => (DynFlags -> DynFlags) -> m a -> m (Either String (String, a))

-- | Set <a>DynFlags</a> equivalent to "-w:".
setNoWarningFlags :: DynFlags -> DynFlags

-- | Set <a>DynFlags</a> equivalent to "-Wall".
setAllWarningFlags :: DynFlags -> DynFlags
data GhcModEnv
GhcModEnv :: Options -> Cradle -> GhcModEnv
[gmOptions] :: GhcModEnv -> Options
[gmCradle] :: GhcModEnv -> Cradle
data GhcModState
data GhcModLog
class Monad m => GmLog m
gmlJournal :: GmLog m => GhcModLog -> m ()
gmlHistory :: GmLog m => m GhcModLog
gmlClear :: GmLog m => m ()
data GmLogLevel
GmSilent :: GmLogLevel
GmPanic :: GmLogLevel
GmException :: GmLogLevel
GmError :: GmLogLevel
GmWarning :: GmLogLevel
GmInfo :: GmLogLevel
GmDebug :: GmLogLevel
GmVomit :: GmLogLevel
gmSetLogLevel :: GmLog m => GmLogLevel -> m ()

-- | Run a computation inside <tt>GhcModT</tt> providing the RWST
--   environment and initial state. This is a low level function, use it
--   only if you know what to do with <a>GhcModEnv</a> and
--   <a>GhcModState</a>.
--   
--   You should probably look at <a>runGhcModT</a> instead.
runGhcModT' :: IOish m => GhcModEnv -> GhcModState -> GhcModT m a -> GmOutT m (Either GhcModError (a, GhcModState), GhcModLog)

-- | <tt>hoistGhcModT result</tt>. Embed a GhcModT computation's result
--   into a GhcModT computation. Note that if the computation that returned
--   <tt>result</tt> modified the state part of GhcModT this cannot be
--   restored.
hoistGhcModT :: IOish m => (Either GhcModError a, GhcModLog) -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules
runGmlT :: IOish m => [Either FilePath ModuleName] -> GmlT m a -> GhcModT m a

-- | Run a GmlT action (i.e. a function in the GhcMonad) in the context of
--   certain files or modules, with updated GHC flags
runGmlT' :: IOish m => [Either FilePath ModuleName] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> GmlT m a -> GhcModT m a

-- | Get the underlying GHC session
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv

-- | Set the underlying GHC session
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()

-- | Set the files as targets and load them.
loadTargets :: IOish m => [GHCOption] -> [FilePath] -> GmlT m ()
cabalResolvedComponents :: (IOish m) => GhcModT m (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))
options :: GmEnv m => m Options
cradle :: GmEnv m => m Cradle
targetGhcOptions :: forall m. IOish m => Cradle -> Set (Either FilePath ModuleName) -> GhcModT m [GHCOption]
withOptions :: GmEnv m => (Options -> Options) -> m a -> m a
gmeDoc :: GhcModError -> Doc
data World
getCurrentWorld :: IOish m => GhcModT m World
didWorldChange :: IOish m => World -> GhcModT m Bool
data ModulePath
ModulePath :: ModuleName -> FilePath -> ModulePath
[mpModule] :: ModulePath -> ModuleName
[mpPath] :: ModulePath -> FilePath
data GmComponent (t :: GmComponentType) eps
GmComponent :: GmModuleGraph -> ChComponentName -> [GHCOption] -> [GHCOption] -> [GHCOption] -> [GHCOption] -> ChEntrypoint -> eps -> [FilePath] -> GmComponent eps
[gmcHomeModuleGraph] :: GmComponent eps -> GmModuleGraph
[gmcName] :: GmComponent eps -> ChComponentName
[gmcGhcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcPkgOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcSrcOpts] :: GmComponent eps -> [GHCOption]
[gmcGhcLangOpts] :: GmComponent eps -> [GHCOption]
[gmcRawEntrypoints] :: GmComponent eps -> ChEntrypoint
[gmcEntrypoints] :: GmComponent eps -> eps
[gmcSourceDirs] :: GmComponent eps -> [FilePath]
data GmComponentType
GMCRaw :: GmComponentType
GMCResolved :: GmComponentType
data GmModuleGraph
GmModuleGraph :: Map ModulePath (Set ModulePath) -> GmModuleGraph
[gmgGraph] :: GmModuleGraph -> Map ModulePath (Set ModulePath)
prepareCabalHelper :: (IOish m, GmEnv m, GmOut m, GmLog m) => m ()
data GHandler m a
GHandler :: (e -> m a) -> GHandler m a
gcatches :: (MonadIO m, ExceptionMonad m) => m a -> [GHandler m a] -> m a

module GhcModExe.Debug

-- | Obtaining debug information.
debugInfo :: IOish m => GhcModT m String

-- | Obtaining root information.
rootInfo :: forall m. (IOish m, GmOut m, GmEnv m) => m String
componentInfo :: IOish m => [String] -> GhcModT m String


-- | The ghc-mod library.
module GhcMod

-- | The environment where this library is used.
data Cradle
Cradle :: Project -> FilePath -> FilePath -> FilePath -> Maybe FilePath -> FilePath -> Cradle
[cradleProject] :: Cradle -> Project

-- | The directory where this library is executed.
[cradleCurrentDir] :: Cradle -> FilePath

-- | The project root directory.
[cradleRootDir] :: Cradle -> FilePath

-- | Per-Project temporary directory
[cradleTempDir] :: Cradle -> FilePath

-- | The file name of the found cabal file.
[cradleCabalFile] :: Cradle -> Maybe FilePath

-- | The build info directory.
[cradleDistDir] :: Cradle -> FilePath
data Project
CabalProject :: Project
SandboxProject :: Project
PlainProject :: Project
StackProject :: StackEnv -> Project

-- | Finding <a>Cradle</a>. Find a cabal file by tracing ancestor
--   directories. Find a sandbox according to a cabal sandbox config in a
--   cabal directory.
findCradle :: (GmLog m, IOish m, GmOut m) => Programs -> m Cradle
data Options
Options :: OutputOpts -> Programs -> [GHCOption] -> [(FilePath, Maybe FilePath)] -> String -> Bool -> Options
[optOutput] :: Options -> OutputOpts
[optPrograms] :: Options -> Programs

-- | GHC command line options set on the <tt>ghc-mod</tt> command line
[optGhcUserOptions] :: Options -> [GHCOption]
[optFileMappings] :: Options -> [(FilePath, Maybe FilePath)]
[optEncoding] :: Options -> String
[optStackBuildDeps] :: Options -> Bool

-- | The type for line separator. Historically, a Null string is used.
newtype LineSeparator
LineSeparator :: String -> LineSeparator

-- | Output style.
data OutputStyle

-- | S expression style.
LispStyle :: OutputStyle

-- | Plain textstyle.
PlainStyle :: OutputStyle
data FileMapping
FileMapping :: FilePath -> Bool -> FileMapping
[fmPath] :: FileMapping -> FilePath
[fmTemp] :: FileMapping -> Bool

-- | A default <a>Options</a>.
defaultOptions :: Options
data GmLogLevel
increaseLogLevel :: GmLogLevel -> GmLogLevel
decreaseLogLevel :: GmLogLevel -> GmLogLevel
gmSetLogLevel :: GmLog m => GmLogLevel -> m ()

-- | <pre>
--   &gt;&gt;&gt; Just GmDebug &lt;= Nothing
--   False
--   
--   &gt;&gt;&gt; Just GmException &lt;= Just GmDebug
--   True
--   
--   &gt;&gt;&gt; Just GmDebug &lt;= Just GmException
--   False
--   </pre>
gmLog :: (MonadIO m, GmLog m, GmOut m) => GmLogLevel -> String -> Doc -> m ()

-- | Module name.
data ModuleString

-- | Haskell expression.
newtype Expression
Expression :: String -> Expression
[getExpression] :: Expression -> String

-- | GHC package database flags.
data GhcPkgDb

-- | Type of function and operation names.
type Symbol = ByteString

-- | Database from <a>Symbol</a> to &lt;math&gt;.
data SymbolDb
data GhcModError

-- | Unknown error
GMENoMsg :: GhcModError

-- | Some Error with a message. These are produced mostly by <a>fail</a>
--   calls on GhcModT.
GMEString :: String -> GhcModError

-- | Configuring a cabal project failed.
GMECabalConfigure :: GhcModError -> GhcModError

-- | Configuring a stack project failed.
GMEStackConfigure :: GhcModError -> GhcModError

-- | Bootstrapping <tt>stack</tt> environment failed (process exited with
--   failure)
GMEStackBootstrap :: GhcModError -> GhcModError

-- | Could not find a consistent component assignment for modules
GMECabalCompAssignment :: [(Either FilePath ModuleName, Set ChComponentName)] -> GhcModError

-- | Launching an operating system process failed. Fields in order:
--   function, command, arguments, (stdout, stderr, exitcode)
GMEProcess :: String -> String -> [String] -> (Either Int GhcModError) -> GhcModError

-- | No cabal file found.
GMENoCabalFile :: GhcModError

-- | Too many cabal files found.
GMETooManyCabalFiles :: [FilePath] -> GhcModError
type GhcModT m = GmT (GmOutT m)

-- | A constraint alias (-XConstraintKinds) to make functions dealing with
--   <tt>GhcModT</tt> somewhat cleaner.
--   
--   Basicially an <tt>IOish m =&gt; m</tt> is a <a>Monad</a> supporting
--   arbitrary <a>IO</a> and exception handling. Usually this will simply
--   be <a>IO</a> but we parametrise it in the exported API so users have
--   the option to use a custom inner monad.
type IOish m = (Functor m, MonadIO m, MonadBaseControl IO m, ExceptionMonad m)

-- | Run a <tt>GhcModT m</tt> computation.
runGhcModT :: IOish m => Options -> GhcModT m a -> m (Either GhcModError a, GhcModLog)
withOptions :: GmEnv m => (Options -> Options) -> m a -> m a

-- | Drop the currently active GHC session, the next that requires a GHC
--   session will initialize a new one.
dropSession :: IOish m => GhcModT m ()

-- | Printing necessary information for front-end booting.
boot :: IOish m => GhcModT m String

-- | Getting functions, classes, etc from a module.
browse :: forall m. IOish m => BrowseOpts -> String -> GhcModT m String

-- | Checking syntax of a target file using GHC. Warnings and errors are
--   returned.
check :: IOish m => [FilePath] -> GhcModT m (Either String String)

-- | Checking syntax of a target file using GHC. Warnings and errors are
--   returned.
checkSyntax :: IOish m => [FilePath] -> GhcModT m String

-- | Obtaining debug information.
debugInfo :: IOish m => GhcModT m String
componentInfo :: IOish m => [String] -> GhcModT m String

-- | Expanding Haskell Template.
expandTemplate :: IOish m => [FilePath] -> GhcModT m String

-- | Obtaining information of a target expression. (GHCi's info:)
info :: IOish m => FilePath -> Expression -> GhcModT m String

-- | Checking syntax of a target file using hlint. Warnings and errors are
--   returned.
lint :: IOish m => LintOpts -> FilePath -> GhcModT m String

-- | Obtaining the package name and the doc path of a module.
pkgDoc :: IOish m => String -> GhcModT m String

-- | Obtaining root information.
rootInfo :: forall m. (IOish m, GmOut m, GmEnv m) => m String

-- | Obtaining type of a target expression. (GHCi's type:)
types :: IOish m => Bool -> FilePath -> Int -> Int -> GhcModT m String
test :: IOish m => FilePath -> GhcModT m String

-- | Splitting a variable in a equation.
splits :: IOish m => FilePath -> Int -> Int -> GhcModT m String

-- | Create a initial body from a signature.
sig :: IOish m => FilePath -> Int -> Int -> GhcModT m String
refine :: IOish m => FilePath -> Int -> Int -> Expression -> GhcModT m String
auto :: IOish m => FilePath -> Int -> Int -> GhcModT m String

-- | Listing installed modules.
modules :: (IOish m, Gm m) => Bool -> m String

-- | Listing language extensions.
languages :: IOish m => GhcModT m String

-- | Listing of GHC flags, same as <tt>ghc</tt>'s <tt>--show-options</tt>
--   with <tt>ghc &gt;= 7.10</tt>.
flags :: IOish m => GhcModT m String

-- | Looking up <a>SymbolDb</a> with <a>Symbol</a> to &lt;math&gt; which
--   will be concatenated. <a>loadSymbolDb</a> is called internally.
findSymbol :: IOish m => String -> GhcModT m String

-- | Looking up <a>SymbolDb</a> with <a>Symbol</a> to &lt;math&gt; which
--   will be concatenated.
lookupSymbol :: IOish m => String -> SymbolDb -> GhcModT m String

-- | Dumps a <a>Binary</a> representation of <a>SymbolDb</a> to stdout
dumpSymbol :: IOish m => GhcModT m ()

-- | Loading a file and creates <a>SymbolDb</a>.
loadSymbolDb :: IOish m => GhcModT m SymbolDb
isOutdated :: IOish m => SymbolDb -> GhcModT m Bool
gmPutStr :: (MonadIO m, GmOut m) => String -> m ()
gmErrStr :: (MonadIO m, GmOut m) => String -> m ()
gmPutStrLn :: (MonadIO m, GmOut m) => String -> m ()
gmErrStrLn :: (MonadIO m, GmOut m) => String -> m ()

-- | maps <a>FilePath</a>, given as first argument to take source from
--   <a>FilePath</a> given as second argument. Works exactly the same as
--   first form of `--map-file` CLI option.
--   
--   'from' can be either full path, or path relative to project root. 'to'
--   has to be either relative to project root, or full path (preferred)
loadMappedFile :: IOish m => FilePath -> FilePath -> GhcModT m ()

-- | maps <a>FilePath</a>, given as first argument to have source as given
--   by second argument.
--   
--   'from' may or may not exist, and should be either full path, or
--   relative to project root.
loadMappedFileSource :: IOish m => FilePath -> String -> GhcModT m ()

-- | unloads previously mapped file 'file', so that it's no longer mapped,
--   and removes any temporary files created when file was mapped.
--   
--   'file' should be either full path, or relative to project root.
unloadMappedFile :: IOish m => FilePath -> GhcModT m ()
