Safe Haskell | None |
---|---|
Language | GHC2021 |
Module location
Synopsis
- data ModLocation = OsPathModLocation {}
- pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation
- addBootSuffix :: OsPath -> OsPath
- addBootSuffix_maybe :: IsBootInterface -> OsPath -> OsPath
- addBootSuffixLocn_maybe :: IsBootInterface -> ModLocation -> ModLocation
- addBootSuffixLocn :: ModLocation -> ModLocation
- addBootSuffixLocnOut :: ModLocation -> ModLocation
- removeBootSuffix :: OsPath -> OsPath
- mkFileSrcSpan :: ModLocation -> SrcSpan
Documentation
data ModLocation Source #
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_ospath and ml_obj_file_ospath 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.
OsPathModLocation | |
|
Instances
Outputable ModLocation Source # | |
Defined in GHC.Unit.Module.Location ppr :: ModLocation -> SDoc Source # | |
Show ModLocation Source # | |
Defined in GHC.Unit.Module.Location showsPrec :: Int -> ModLocation -> ShowS # show :: ModLocation -> String # showList :: [ModLocation] -> ShowS # |
pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation Source #
addBootSuffix :: OsPath -> OsPath Source #
Add the -boot
suffix to .hs, .hi and .o files
addBootSuffix_maybe :: IsBootInterface -> OsPath -> OsPath Source #
Add the -boot
suffix if the Bool
argument is True
addBootSuffixLocn :: ModLocation -> ModLocation Source #
Add the -boot
suffix to all file paths associated with the module
addBootSuffixLocnOut :: ModLocation -> ModLocation Source #
Add the -boot
suffix to all output file paths associated with the
module, not including the input file itself
removeBootSuffix :: OsPath -> OsPath Source #
Remove the -boot
suffix to .hs, .hi and .o files
mkFileSrcSpan :: ModLocation -> SrcSpan Source #
Compute a SrcSpan
from a ModLocation
.