... | ... | @@ -6,20 +6,22 @@ Here we attempt to describe some of the main data structures involved in GHC's r |
|
|
## Module
|
|
|
|
|
|
|
|
|
Location: [compiler/Language/Haskell/Syntax/Module/Name.hs](https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/Language/Haskell/Syntax/Module/Name.hs)
|
|
|
Location: [compiler/GHC/Unit/Types.hs](https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Unit/Types.hs)
|
|
|
|
|
|
|
|
|
The **Module** data type is simply an identifier of a module; its fully qualified name.
|
|
|
|
|
|
```wiki
|
|
|
-- | A Module is a pair of a 'PackageId' and a 'ModuleName'.
|
|
|
data Module = Module {
|
|
|
modulePackageId :: !PackageId, -- pkg-1.0
|
|
|
moduleName :: !ModuleName -- A.B.C
|
|
|
}
|
|
|
deriving (Eq, Ord)
|
|
|
|
|
|
newtype ModuleName = ModuleName FastString
|
|
|
-- | A generic module is a pair of a unit identifier and a 'ModuleName'.
|
|
|
data GenModule unit = Module
|
|
|
{ moduleUnit :: !unit -- ^ Unit the module belongs to
|
|
|
, moduleName :: !ModuleName -- ^ Module name (e.g. A.B.C)
|
|
|
}
|
|
|
deriving (Eq,Ord,Data,Functor)
|
|
|
|
|
|
-- | A Module is a pair of a 'Unit' and a 'ModuleName'.
|
|
|
type Module = GenModule Unit
|
|
|
|
|
|
```
|
|
|
|
|
|
## ModIface
|
... | ... | |