Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
This module has the code that uses the GHC definitions to: 1. MAKE a name-resolution environment, 2. USE the environment to translate plain symbols into Var, TyCon, etc.
Synopsis
- data Env = RE {
- reLMap :: !LogicMap
- reSyms :: ![(Symbol, Var)]
- _reSubst :: !Subst
- _reTyThings :: !TyThingMap
- reCfg :: !Config
- reQualImps :: !QImports
- reAllImps :: !(HashSet Symbol)
- reLocalVars :: !LocalVars
- reGlobSyms :: !(HashSet Symbol)
- reSrc :: !GhcSrc
- type TyThingMap = HashMap Symbol [(Symbol, TyThing)]
- type ModSpecs = HashMap ModName BareSpec
- type LocalVars = HashMap Symbol [(Int, Var)]
- data TycEnv = TycEnv {
- tcTyCons :: ![TyConP]
- tcDataCons :: ![DataConP]
- tcSelMeasures :: ![Measure SpecType DataCon]
- tcSelVars :: ![(Var, LocSpecType)]
- tcTyConMap :: !TyConMap
- tcAdts :: ![DataDecl]
- tcDataConMap :: !DataConMap
- tcEmbs :: !(TCEmb TyCon)
- tcName :: !ModName
- type DataConMap = HashMap (Symbol, Int) Symbol
- data TyConMap
- data SigEnv = SigEnv {
- sigEmbs :: !(TCEmb TyCon)
- sigTyRTyMap :: !TyConMap
- sigExports :: !(HashSet StableName)
- sigRTEnv :: !BareRTEnv
- data MeasEnv = MeasEnv {
- meMeasureSpec :: !(MSpec SpecType DataCon)
- meClassSyms :: ![(Symbol, Located (RRType Reft))]
- meSyms :: ![(Symbol, Located (RRType Reft))]
- meDataCons :: ![(Var, LocSpecType)]
- meClasses :: ![DataConP]
- meMethods :: ![(ModName, Var, LocSpecType)]
- meCLaws :: ![(Class, [(ModName, Var, LocSpecType)])]
- data PlugTV v
- plugSrc :: PlugTV v -> Maybe v
- varRSort :: Var -> RSort
- varSortedReft :: TCEmb TyCon -> Var -> SortedReft
- failMaybe :: Env -> ModName -> Either e r -> Either e (Maybe r)
Name resolution environment
Name resolution environment
RE | |
|
type TyThingMap = HashMap Symbol [(Symbol, TyThing)] Source #
A TyThingMap
is used to resolve symbols into GHC TyThing
and,
from there into Var, TyCon, DataCon, etc.
type LocalVars = HashMap Symbol [(Int, Var)] Source #
LocalVars
is a map from names to lists of pairs of Ghc.Var
and
the lines at which they were defined.
Tycon and Datacon processing environment
A TycEnv
contains the information needed to process Type- and Data- Constructors
TycEnv | |
|
Information about Type Constructors
Signature processing environment
A SigEnv
contains the needed to process type signatures
SigEnv | |
|
Measure related environment
Intermediate representation for Measure information
MeasEnv | |
|
Misc
See [NOTE: Plug-Holes-TyVars] for a rationale for PlugTV
HsTV v | Use tyvars from GHC specification (in the |
LqTV v | Use tyvars from Liquid specification |
GenTV | Generalize ty-vars |
RawTV | Do NOT generalize ty-vars (e.g. for type-aliases) |
varSortedReft :: TCEmb TyCon -> Var -> SortedReft Source #
Converting Var
to Sort