Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module deals with finding imported modules and loading their interface files.
Synopsis
- data Mode
- pattern ScopeCheck :: Mode
- pattern TypeCheck :: Mode
- data CheckResult where
- pattern CheckResult :: Interface -> [TCWarning] -> ModuleCheckMode -> Source -> CheckResult
- crModuleInfo :: CheckResult -> ModuleInfo
- crInterface :: CheckResult -> Interface
- crWarnings :: CheckResult -> [TCWarning]
- crMode :: CheckResult -> ModuleCheckMode
- crSource :: CheckResult -> Source
- data Source = Source {}
- scopeCheckImport :: ModuleName -> TCM (ModuleName, Map ModuleName Scope)
- parseSource :: SourceFile -> TCM Source
- typeCheckMain :: Mode -> Source -> TCM CheckResult
- readInterface :: InterfaceFile -> TCM (Maybe Interface)
Documentation
Is the aim to type-check the top-level module, or only to scope-check it?
pattern ScopeCheck :: Mode Source #
data CheckResult where Source #
The result and associated parameters of a type-checked file, when invoked directly via interaction or a backend. Note that the constructor is not exported.
pattern CheckResult :: Interface -> [TCWarning] -> ModuleCheckMode -> Source -> CheckResult | Flattened unidirectional pattern for |
crModuleInfo :: CheckResult -> ModuleInfo Source #
crInterface :: CheckResult -> Interface Source #
crWarnings :: CheckResult -> [TCWarning] Source #
crMode :: CheckResult -> ModuleCheckMode Source #
crSource :: CheckResult -> Source Source #
The decorated source code.
Source | |
|
scopeCheckImport :: ModuleName -> TCM (ModuleName, Map ModuleName Scope) Source #
Scope checks the given module. A proper version of the module name (with correct definition sites) is returned.
parseSource :: SourceFile -> TCM Source Source #
Parses a source file and prepares the Source
record.
:: Mode | Should the file be type-checked, or only scope-checked? |
-> Source | The decorated source code. |
-> TCM CheckResult |
Type checks the main file of the interaction. This could be the file loaded in the interacting editor (emacs), or the file passed on the command line.
First, the primitive modules are imported.
Then, getInterface
is called to do the main work.
If the Mode
is ScopeCheck
, then type-checking is not
performed, only scope-checking. (This may include type-checking
of imported modules.) In this case the generated, partial
interface is not stored in the state (stDecodedModules
). Note,
however, that if the file has already been type-checked, then a
complete interface is returned.
readInterface :: InterfaceFile -> TCM (Maybe Interface) Source #
Read interface file corresponding to a module.