GHC.Unit.Finder.Types

ghc-9.2.8: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Unit.Finder.Types

Synopsis

- type FinderCache = InstalledModuleEnv InstalledFindResult
- data FindResult
  - = Found ModLocation Module
  - | NoPackage Unit
  - | FoundMultiple [(Module, ModuleOrigin)]
  - | NotFound {
    - fr_paths :: [FilePath]
    - fr_pkg :: Maybe Unit
    - fr_mods_hidden :: [Unit]
    - fr_pkgs_hidden :: [Unit]
    - fr_unusables :: [(Unit, UnusableUnitReason)]
    - fr_suggestions :: [ModuleSuggestion]
    }
- data InstalledFindResult
  - = InstalledFound ModLocation InstalledModule
  - | InstalledNoPackage UnitId
  - | InstalledNotFound [FilePath] (Maybe UnitId)

# Documentation

type FinderCache = InstalledModuleEnv InstalledFindResult Source #

The `FinderCache` maps modules to the result of searching for that module. It records the results of searching for modules along the search path. On `:load`, we flush the entire contents of this cache.

data FindResult Source #

The result of searching for an imported module.

NB: FindResult manages both user source-import lookups (which can result in `Module`) as well as direct imports for interfaces (which always result in `InstalledModule`).

Constructors

Found ModLocation Module | The module was found
NoPackage Unit | The requested unit was not found
FoundMultiple [(Module, ModuleOrigin)] | _Error_: both in multiple packages
NotFound | Not found
Fields fr_paths :: [FilePath] Places where I looked fr_pkg :: Maybe Unit Just p => module is in this unit's manifest, but couldn't find the .hi file fr_mods_hidden :: [Unit] Module is in these units, but the *module* is hidden fr_pkgs_hidden :: [Unit] Module is in these units, but the *unit* is hidden fr_unusables :: [(Unit, UnusableUnitReason)] Module is in these units, but it is unusable fr_suggestions :: [ModuleSuggestion] Possible mis-spelled modules

data InstalledFindResult Source #

Constructors

InstalledFound ModLocation InstalledModule |
InstalledNoPackage UnitId |
InstalledNotFound [FilePath] (Maybe UnitId) |