never executed always true always false
1 module GHC.Unit.Module.ModDetails
2 ( ModDetails (..)
3 , emptyModDetails
4 )
5 where
6
7 import GHC.Core ( CoreRule )
8 import GHC.Core.FamInstEnv
9 import GHC.Core.InstEnv ( ClsInst )
10
11 import GHC.Types.Avail
12 import GHC.Types.CompleteMatch
13 import GHC.Types.TypeEnv
14 import GHC.Types.Annotations ( Annotation )
15
16 -- | The 'ModDetails' is essentially a cache for information in the 'ModIface'
17 -- for home modules only. Information relating to packages will be loaded into
18 -- global environments in 'ExternalPackageState'.
19 data ModDetails = ModDetails
20 { -- The next two fields are created by the typechecker
21 md_exports :: [AvailInfo]
22 , md_types :: !TypeEnv
23 -- ^ Local type environment for this particular module
24 -- Includes Ids, TyCons, PatSyns
25
26 , md_insts :: ![ClsInst]
27 -- ^ 'DFunId's for the instances in this module
28
29 , md_fam_insts :: ![FamInst]
30 , md_rules :: ![CoreRule]
31 -- ^ Domain may include 'Id's from other modules
32
33 , md_anns :: ![Annotation]
34 -- ^ Annotations present in this module: currently
35 -- they only annotate things also declared in this module
36
37 , md_complete_matches :: [CompleteMatch]
38 -- ^ Complete match pragmas for this module
39 }
40
41 -- | Constructs an empty ModDetails
42 emptyModDetails :: ModDetails
43 emptyModDetails = ModDetails
44 { md_types = emptyTypeEnv
45 , md_exports = []
46 , md_insts = []
47 , md_rules = []
48 , md_fam_insts = []
49 , md_anns = []
50 , md_complete_matches = []
51 }