CompilerEnv.hs 894 Bytes
Newer Older
Björn Peemöller 's avatar
Björn Peemöller committed
1
2
3
4
5
6
module CompilerEnv where

import Curry.Base.Ident (ModuleIdent)

import Env.Arity
import Env.Eval
Björn Peemöller 's avatar
Björn Peemöller committed
7
import Env.Interfaces
Björn Peemöller 's avatar
Björn Peemöller committed
8
import Env.Label
9
import Env.ModuleAliases
Björn Peemöller 's avatar
Björn Peemöller committed
10
11
12
13
14
15
16
import Env.OpPrec
import Env.TypeConstructors
import Env.Value

-- |A compiler environment
data CompilerEnv = CompilerEnv
  { moduleIdent  :: ModuleIdent
17
  , aliasEnv     :: AliasEnv
Björn Peemöller 's avatar
Björn Peemöller committed
18
19
  , arityEnv     :: ArityEnv
  , evalAnnotEnv :: EvalEnv
Björn Peemöller 's avatar
Björn Peemöller committed
20
  , interfaceEnv :: InterfaceEnv
Björn Peemöller 's avatar
Björn Peemöller committed
21
22
23
24
25
26
27
28
29
  , labelEnv     :: LabelEnv
  , opPrecEnv    :: PEnv
  , tyConsEnv    :: TCEnv
  , valueEnv     :: ValueEnv
  }

initCompilerEnv :: ModuleIdent -> CompilerEnv
initCompilerEnv mid = CompilerEnv
  { moduleIdent  = mid
30
  , aliasEnv     = initAliasEnv
Björn Peemöller 's avatar
Björn Peemöller committed
31
32
  , arityEnv     = initAEnv
  , evalAnnotEnv = initEEnv
Björn Peemöller 's avatar
Björn Peemöller committed
33
  , interfaceEnv = initInterfaceEnv
Björn Peemöller 's avatar
Björn Peemöller committed
34
35
36
37
38
  , labelEnv     = initLEnv
  , opPrecEnv    = initPEnv
  , tyConsEnv    = initTCEnv
  , valueEnv     = initDCEnv
  }