Safe Haskell | None |
---|
Low level access to the ghc-mod library.
- type GHCOption = String
- type Package = (PackageBaseName, PackageVersion, PackageId)
- type PackageBaseName = String
- type PackageVersion = String
- type PackageId = String
- type IncludeDir = FilePath
- data CompilerOptions = CompilerOptions {
- ghcOptions :: [GHCOption]
- includeDirs :: [IncludeDir]
- depPackages :: [Package]
- parseCabalFile :: FilePath -> IO PackageDescription
- getCompilerOptions :: [GHCOption] -> Cradle -> PackageDescription -> IO CompilerOptions
- cabalAllBuildInfo :: PackageDescription -> [BuildInfo]
- cabalDependPackages :: [BuildInfo] -> [PackageBaseName]
- cabalSourceDirs :: [BuildInfo] -> [IncludeDir]
- cabalAllTargets :: PackageDescription -> IO ([String], [String], [String], [String])
- getSystemLibDir :: IO (Maybe FilePath)
- getDynamicFlags :: IO DynFlags
- initializeFlagsWithCradle :: GhcMonad m => Options -> Cradle -> m ()
- setTargetFiles :: GhcMonad m => [FilePath] -> m ()
- withLogger :: Options -> (DynFlags -> DynFlags) -> Ghc () -> Ghc (Either String String)
- setNoWaringFlags :: DynFlags -> DynFlags
- setAllWaringFlags :: DynFlags -> DynFlags
- (||>) :: Ghc a -> Ghc a -> Ghc a
- goNext :: Ghc a
- runAnyOne :: [Ghc a] -> Ghc a
- (|||>) :: GhcMonad m => m a -> m a -> m a
Types
type Package = (PackageBaseName, PackageVersion, PackageId)Source
A package's name, verson and id.
type PackageBaseName = StringSource
A package name.
type PackageVersion = StringSource
A package version.
type IncludeDir = FilePathSource
An include directory for modules.
data CompilerOptions Source
Option information for GHC
CompilerOptions | |
|
Cabal API
parseCabalFile :: FilePath -> IO PackageDescriptionSource
Parsing a cabal file and returns PackageDescription
.
IOException
is thrown if parsing fails.
getCompilerOptions :: [GHCOption] -> Cradle -> PackageDescription -> IO CompilerOptionsSource
Getting necessary CompilerOptions
from three information sources.
cabalAllBuildInfo :: PackageDescription -> [BuildInfo]Source
Extracting all BuildInfo
for libraries, executables, and tests.
cabalDependPackages :: [BuildInfo] -> [PackageBaseName]Source
Extracting package names of dependency.
cabalSourceDirs :: [BuildInfo] -> [IncludeDir]Source
Extracting include directories for modules.
cabalAllTargets :: PackageDescription -> IO ([String], [String], [String], [String])Source
Extracting all Module
FilePath
s for libraries, executables,
tests and benchmarks.
IO
getSystemLibDir :: IO (Maybe FilePath)Source
Obtaining the directory for system libraries.
getDynamicFlags :: IO DynFlagsSource
Return the DynFlags
currently in use in the GHC session.
Initializing DynFlags
initializeFlagsWithCradle :: GhcMonad m => Options -> Cradle -> m ()Source
Targets
setTargetFiles :: GhcMonad m => [FilePath] -> m ()Source
Set the files as targets and load them.
Logging
Ghc
Choice
(||>) :: Ghc a -> Ghc a -> Ghc aSource
Try the left Ghc
action. If IOException
occurs, try
the right Ghc
action.