File: ModDetails.hs

package info (click to toggle)
haskell-ghc-lib-parser 9.6.6.20240701-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,280 kB
  • sloc: haskell: 109,582; yacc: 3,744; ansic: 2,480; makefile: 12
file content (51 lines) | stat: -rw-r--r-- 1,579 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module GHC.Unit.Module.ModDetails
   ( ModDetails (..)
   , emptyModDetails
   )
where

import GHC.Core         ( CoreRule )
import GHC.Core.FamInstEnv
import GHC.Core.InstEnv ( InstEnv, emptyInstEnv )

import GHC.Types.Avail
import GHC.Types.CompleteMatch
import GHC.Types.TypeEnv
import GHC.Types.Annotations ( Annotation )

-- | The 'ModDetails' is essentially a cache for information in the 'ModIface'
-- for home modules only. Information relating to packages will be loaded into
-- global environments in 'ExternalPackageState'.
data ModDetails = ModDetails
   { -- The next two fields are created by the typechecker
     md_exports   :: [AvailInfo]
   , md_types     :: !TypeEnv
      -- ^ Local type environment for this particular module
      -- Includes Ids, TyCons, PatSyns

   , md_insts     :: InstEnv
      -- ^ 'DFunId's for the instances in this module

   , md_fam_insts :: ![FamInst]
   , md_rules     :: ![CoreRule]
      -- ^ Domain may include 'Id's from other modules

   , md_anns      :: ![Annotation]
      -- ^ Annotations present in this module: currently
      -- they only annotate things also declared in this module

   , md_complete_matches :: [CompleteMatch]
      -- ^ Complete match pragmas for this module
   }

-- | Constructs an empty ModDetails
emptyModDetails :: ModDetails
emptyModDetails = ModDetails
   { md_types            = emptyTypeEnv
   , md_exports          = []
   , md_insts            = emptyInstEnv
   , md_rules            = []
   , md_fam_insts        = []
   , md_anns             = []
   , md_complete_matches = []
   }