Functions which map between module names and file names.
Note that file name lookups are cached in the
TCState. The code
assumes that no Agda source files are added or removed from the
include directories while the code is being type checked.
- toIFile :: AbsolutePath -> AbsolutePath
- data FindError
- findErrorToTypeError :: TopLevelModuleName -> FindError -> TypeError
- findFile :: TopLevelModuleName -> TCM AbsolutePath
- findFile' :: TopLevelModuleName -> TCM (Either FindError AbsolutePath)
- findFile'' :: [AbsolutePath] -> TopLevelModuleName -> ModuleToSource -> IO (Either FindError AbsolutePath, ModuleToSource)
- findInterfaceFile :: TopLevelModuleName -> TCM (Maybe AbsolutePath)
- checkModuleName :: TopLevelModuleName -> AbsolutePath -> TCM ()
- type ModuleToSource = Map TopLevelModuleName AbsolutePath
- type SourceToModule = Map AbsolutePath TopLevelModuleName
- sourceToModule :: TCM SourceToModule
- tests :: IO Bool
Converts an Agda file name to the corresponding interface file name.
Errors which can arise when trying to find a source file.
Invariant: All paths are absolute.
Finds the source file corresponding to a given top-level module name. The returned paths are absolute.
Raises an error if the file cannot be found.
Tries to find the source file corresponding to a given top-level module name. The returned paths are absolute.
Cached invocations of
|-> IO (Either FindError AbsolutePath, ModuleToSource)|
Finds the interface file corresponding to a given top-level module name. The returned paths are absolute.
Raises an error if the source file cannot be found, and returns
Nothing if the source file can be found but not the interface
The name of the module.
The file from which it was loaded.
|-> TCM ()|
Ensures that the module name matches the file name. The file corresponding to the module name (according to the include path) has to be the same as the given file name.
Maps top-level module names to the corresponding source file names.
Maps source file names to the corresponding top-level module names.