Safe Haskell | None |
---|---|
Language | Haskell2010 |
Representation and operations for module collections (libraries, executables, ...) in the framework.
- data ModuleCollection = ModuleCollection {}
- containingMC :: FilePath -> Simple Traversal [ModuleCollection] ModuleCollection
- data ModuleRecord
- = ModuleNotLoaded { }
- | ModuleParsed { }
- | ModuleRenamed { }
- | ModuleTypeChecked { }
- | ModuleCodeGenerated { }
- data ModuleCollectionId
- moduleCollectionIdString :: ModuleCollectionId -> String
- moduleCollectionPkgId :: ModuleCollectionId -> Maybe String
- mcSourceDirs :: Lens ModuleCollection ModuleCollection [FilePath] [FilePath]
- mcRoot :: Lens ModuleCollection ModuleCollection FilePath FilePath
- mcModules :: Lens ModuleCollection ModuleCollection (Map SourceFileKey ModuleRecord) (Map SourceFileKey ModuleRecord)
- mcLoadFlagSetup :: Lens ModuleCollection ModuleCollection (DynFlags -> IO DynFlags) (DynFlags -> IO DynFlags)
- mcId :: Lens ModuleCollection ModuleCollection ModuleCollectionId ModuleCollectionId
- mcFlagSetup :: Lens ModuleCollection ModuleCollection (DynFlags -> IO DynFlags) (DynFlags -> IO DynFlags)
- mcDependencies :: Lens ModuleCollection ModuleCollection [ModuleCollectionId] [ModuleCollectionId]
- typedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule IdDom) (UnnamedModule IdDom)
- renamedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule (Dom Name)) (UnnamedModule (Dom Name))
- recModuleWillNeedCode :: Partial ModuleRecord ModuleRecord Bool Bool
- parsedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule (Dom RdrName)) (UnnamedModule (Dom RdrName))
- modRecMS :: Partial ModuleRecord ModuleRecord ModSummary ModSummary
- lookupModuleColl :: String -> [ModuleCollection] -> Maybe ModuleCollection
- lookupModInSCs :: SourceFileKey -> [ModuleCollection] -> Maybe (SourceFileKey, ModuleRecord)
- removeModule :: String -> [ModuleCollection] -> [ModuleCollection]
- hasGeneratedCode :: SourceFileKey -> [ModuleCollection] -> Bool
- needsGeneratedCode :: SourceFileKey -> [ModuleCollection] -> Bool
- codeGeneratedFor :: SourceFileKey -> [ModuleCollection] -> [ModuleCollection]
- isAlreadyLoaded :: SourceFileKey -> [ModuleCollection] -> Bool
- getAllModules :: [FilePath] -> IO [ModuleCollection]
- orderMCs :: [ModuleCollection] -> [ModuleCollection]
- getModules :: FilePath -> IO [ModuleCollection]
- modulesFromDirectory :: FilePath -> FilePath -> IO [String]
- srcDirFromRoot :: FilePath -> String -> FilePath
- modulesFromCabalFile :: FilePath -> FilePath -> IO [ModuleCollection]
- class ToModuleCollection t where
- isDirectoryMC :: ModuleCollection -> Bool
- compileInContext :: ModuleCollection -> [ModuleCollection] -> DynFlags -> IO DynFlags
- applyDependencies :: [ModuleCollection] -> [ModuleCollectionId] -> DynFlags -> DynFlags
- onlyUseEnabled :: DynFlags -> DynFlags
- dependencyToPkgFlag :: [ModuleCollection] -> ModuleCollectionId -> Maybe PackageFlag
- setupLoadFlags :: [ModuleCollection] -> DynFlags -> IO DynFlags
- breaks :: [a] -> [(a, [a])]
- loadFlagsFromBuildInfo :: BuildInfo -> DynFlags -> IO DynFlags
- flagsFromBuildInfo :: BuildInfo -> DynFlags -> IO DynFlags
- setExtensionFlag' :: Extension -> DynFlags -> DynFlags
- unSetExtensionFlag' :: Extension -> DynFlags -> DynFlags
- turnOn :: Bool
- turnOff :: Bool
- impliedXFlags :: [(Extension, Bool, Extension)]
- translateExtension :: KnownExtension -> Maybe Extension
Documentation
data ModuleCollection Source #
The modules of a library, executable, test or benchmark. A package contains one or more module collection.
ModuleCollection | |
|
data ModuleRecord Source #
The state of a module.
data ModuleCollectionId Source #
This data structure identifies a module collection.
mcModules :: Lens ModuleCollection ModuleCollection (Map SourceFileKey ModuleRecord) (Map SourceFileKey ModuleRecord) Source #
mcLoadFlagSetup :: Lens ModuleCollection ModuleCollection (DynFlags -> IO DynFlags) (DynFlags -> IO DynFlags) Source #
mcFlagSetup :: Lens ModuleCollection ModuleCollection (DynFlags -> IO DynFlags) (DynFlags -> IO DynFlags) Source #
mcDependencies :: Lens ModuleCollection ModuleCollection [ModuleCollectionId] [ModuleCollectionId] Source #
typedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule IdDom) (UnnamedModule IdDom) Source #
renamedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule (Dom Name)) (UnnamedModule (Dom Name)) Source #
parsedRecModule :: Partial ModuleRecord ModuleRecord (UnnamedModule (Dom RdrName)) (UnnamedModule (Dom RdrName)) Source #
lookupModuleColl :: String -> [ModuleCollection] -> Maybe ModuleCollection Source #
Find the module collection where the given module is.
lookupModInSCs :: SourceFileKey -> [ModuleCollection] -> Maybe (SourceFileKey, ModuleRecord) Source #
removeModule :: String -> [ModuleCollection] -> [ModuleCollection] Source #
hasGeneratedCode :: SourceFileKey -> [ModuleCollection] -> Bool Source #
needsGeneratedCode :: SourceFileKey -> [ModuleCollection] -> Bool Source #
codeGeneratedFor :: SourceFileKey -> [ModuleCollection] -> [ModuleCollection] Source #
isAlreadyLoaded :: SourceFileKey -> [ModuleCollection] -> Bool Source #
getAllModules :: [FilePath] -> IO [ModuleCollection] Source #
Gets all ModuleCollections from a list of source directories. It also orders the source directories that are package roots so that they can be loaded in the order they are defined (no backward imports). This matters in those cases because for them there can be special compilation flags.
orderMCs :: [ModuleCollection] -> [ModuleCollection] Source #
Sorts model collection in an order to remove all backward references. Works because module collections defined by directories cannot be recursive.
getModules :: FilePath -> IO [ModuleCollection] Source #
Get modules of the project with the indicated root directory. If there is a cabal file, it uses that, otherwise it just scans the directory recursively for haskell sourcefiles. Only returns the non-boot haskell modules, the boot modules will be found during loading.
modulesFromDirectory :: FilePath -> FilePath -> IO [String] Source #
Load the module giving a directory. All modules loaded from the folder and subfolders.
modulesFromCabalFile :: FilePath -> FilePath -> IO [ModuleCollection] Source #
Load the module using a cabal file. The modules described in the cabal file will be loaded. The flags and extensions set in the cabal file will be used by default.
class ToModuleCollection t where Source #
mkModuleCollKey :: PackageName -> t -> ModuleCollectionId Source #
getBuildInfo :: t -> BuildInfo Source #
getModuleNames :: t -> [ModuleName] Source #
isDirectoryMC :: ModuleCollection -> Bool Source #
compileInContext :: ModuleCollection -> [ModuleCollection] -> DynFlags -> IO DynFlags Source #
applyDependencies :: [ModuleCollection] -> [ModuleCollectionId] -> DynFlags -> DynFlags Source #
onlyUseEnabled :: DynFlags -> DynFlags Source #
setupLoadFlags :: [ModuleCollection] -> DynFlags -> IO DynFlags Source #
Not imported from DynFlags.hs, so I copied it here
Mapping of Cabal haskell extensions to their GHC counterpart
translateExtension :: KnownExtension -> Maybe Extension Source #
Map the cabal extensions to the ones that GHC recognizes