HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Unit.Module.Location

Module location

  • 1 type
  • 6 values
  • Packageghc-9.10.3
  • Exports7
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceLocation.hs
datadata ModLocation
#

Module Location

Where a module lives on the file system: the actual locations of the .hs, .hi, .dyn_hi, .o, .dyn_o and .hie files, if we have them.

For a module in another unit, the ml_hs_file and ml_obj_file components of ModLocation are undefined.

The locations specified by a ModLocation may or may not correspond to actual files yet: for example, even if the object file doesn't exist, the ModLocation still contains the path to where the object file will reside if/when it is created.

The paths of anything which can affect recompilation should be placed inside ModLocation.

When a ModLocation is created none of the filepaths will have -boot suffixes. This is because in --make mode the ModLocation is put in the finder cache which is indexed by ModuleName, when a ModLocation is retrieved from the FinderCache the boot suffixes are appended. The other case is in -c mode, there the ModLocation immediately gets given the boot suffixes in mkOneShotModLocation.

Constructors

  • ModLocation
    • ml_hs_file :: Maybe FilePath

      The source file, if we have one. Package modules probably don't have source files.

    • ml_hi_file :: FilePath

      Where the .hi file is, whether or not it exists yet. Always of form foo.hi, even if there is an hi-boot file (we add the -boot suffix later)

    • ml_dyn_hi_file :: FilePath

      Where the .dyn_hi file is, whether or not it exists yet.

    • ml_obj_file :: FilePath

      Where the .o file is, whether or not it exists yet. (might not exist either because the module hasn't been compiled yet, or because it is part of a unit with a .a file)

    • ml_dyn_obj_file :: FilePath

      Where the .dy file is, whether or not it exists yet.

    • ml_hie_file :: FilePath

      Where the .hie file is, whether or not it exists yet.

Instances2Show, Outputable