SimplEnv

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

SimplEnv

Contents

- The simplifier mode
- Environments
- Substitution results
- Simplifying `Id` binders
- Floats

Synopsis

- setMode :: SimplifierMode -> SimplEnv -> SimplEnv
- getMode :: SimplEnv -> SimplifierMode
- updMode :: (SimplifierMode -> SimplifierMode) -> SimplEnv -> SimplEnv
- data SimplEnv = SimplEnv {
  - seMode :: SimplifierMode
  - seTvSubst :: TvSubstEnv
  - seCvSubst :: CvSubstEnv
  - seIdSubst :: SimplIdSubst
  - seInScope :: InScopeSet
  - seFloats :: Floats
  - seJoinFloats :: JoinFloats
  }
- type StaticEnv = SimplEnv
- pprSimplEnv :: SimplEnv -> SDoc
- mkSimplEnv :: SimplifierMode -> SimplEnv
- extendIdSubst :: SimplEnv -> Id -> SimplSR -> SimplEnv
- extendTvSubst :: SimplEnv -> TyVar -> Type -> SimplEnv
- extendCvSubst :: SimplEnv -> CoVar -> Coercion -> SimplEnv
- zapSubstEnv :: SimplEnv -> SimplEnv
- setSubstEnv :: SimplEnv -> TvSubstEnv -> CvSubstEnv -> SimplIdSubst -> SimplEnv
- getInScope :: SimplEnv -> InScopeSet
- setInScopeAndZapFloats :: SimplEnv -> SimplEnv -> SimplEnv
- setInScopeSet :: SimplEnv -> InScopeSet -> SimplEnv
- modifyInScope :: SimplEnv -> CoreBndr -> SimplEnv
- addNewInScopeIds :: SimplEnv -> [CoreBndr] -> SimplEnv
- getSimplRules :: SimplM RuleEnv
- data SimplSR
  - = DoneEx OutExpr
  - | DoneId OutId
  - | ContEx TvSubstEnv CvSubstEnv SimplIdSubst InExpr
- mkContEx :: SimplEnv -> InExpr -> SimplSR
- substId :: SimplEnv -> InId -> SimplSR
- lookupRecBndr :: SimplEnv -> InId -> OutId
- refineFromInScope :: InScopeSet -> Var -> Var
- isJoinIdInEnv_maybe :: SimplEnv -> InId -> Maybe JoinArity
- simplNonRecBndr :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr)
- simplNonRecJoinBndr :: SimplEnv -> OutType -> InBndr -> SimplM (SimplEnv, OutBndr)
- simplRecBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv
- simplRecJoinBndrs :: SimplEnv -> OutType -> [InBndr] -> SimplM SimplEnv
- simplBinder :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr)
- simplBinders :: SimplEnv -> [InBndr] -> SimplM (SimplEnv, [OutBndr])
- substTy :: SimplEnv -> Type -> Type
- substTyVar :: SimplEnv -> TyVar -> Type
- getTCvSubst :: SimplEnv -> TCvSubst
- substCo :: SimplEnv -> Coercion -> Coercion
- substCoVar :: SimplEnv -> CoVar -> Coercion
- data Floats
- emptyFloats :: Floats
- isEmptyFloats :: SimplEnv -> Bool
- addNonRec :: SimplEnv -> OutId -> OutExpr -> SimplEnv
- addFloats :: SimplEnv -> SimplEnv -> SimplEnv
- extendFloats :: SimplEnv -> OutBind -> SimplEnv
- wrapFloats :: SimplEnv -> OutExpr -> OutExpr
- setFloats :: SimplEnv -> SimplEnv -> SimplEnv
- zapFloats :: SimplEnv -> SimplEnv
- addRecFloats :: SimplEnv -> SimplEnv -> SimplEnv
- mapFloats :: SimplEnv -> ((Id, CoreExpr) -> (Id, CoreExpr)) -> SimplEnv
- doFloatFromRhs :: TopLevelFlag -> RecFlag -> Bool -> OutExpr -> SimplEnv -> Bool
- getFloatBinds :: SimplEnv -> [CoreBind]
- type JoinFloats = OrdList OutBind
- emptyJoinFloats :: JoinFloats
- isEmptyJoinFloats :: SimplEnv -> Bool
- wrapJoinFloats :: SimplEnv -> OutExpr -> OutExpr
- zapJoinFloats :: SimplEnv -> SimplEnv
- restoreJoinFloats :: SimplEnv -> SimplEnv -> SimplEnv
- getJoinFloatBinds :: SimplEnv -> [CoreBind]

# The simplifier mode

setMode :: SimplifierMode -> SimplEnv -> SimplEnv Source #

getMode :: SimplEnv -> SimplifierMode Source #

updMode :: (SimplifierMode -> SimplifierMode) -> SimplEnv -> SimplEnv Source #

# Environments

data SimplEnv Source #

Constructors

SimplEnv |
Fields seMode :: SimplifierMode seTvSubst :: TvSubstEnv seCvSubst :: CvSubstEnv seIdSubst :: SimplIdSubst seInScope :: InScopeSet seFloats :: Floats seJoinFloats :: JoinFloats

type StaticEnv = SimplEnv Source #

pprSimplEnv :: SimplEnv -> SDoc Source #

mkSimplEnv :: SimplifierMode -> SimplEnv Source #

extendIdSubst :: SimplEnv -> Id -> SimplSR -> SimplEnv Source #

extendTvSubst :: SimplEnv -> TyVar -> Type -> SimplEnv Source #

extendCvSubst :: SimplEnv -> CoVar -> Coercion -> SimplEnv Source #

zapSubstEnv :: SimplEnv -> SimplEnv Source #

setSubstEnv :: SimplEnv -> TvSubstEnv -> CvSubstEnv -> SimplIdSubst -> SimplEnv Source #

getInScope :: SimplEnv -> InScopeSet Source #

setInScopeAndZapFloats :: SimplEnv -> SimplEnv -> SimplEnv Source #

setInScopeSet :: SimplEnv -> InScopeSet -> SimplEnv Source #

modifyInScope :: SimplEnv -> CoreBndr -> SimplEnv Source #

addNewInScopeIds :: SimplEnv -> [CoreBndr] -> SimplEnv Source #

getSimplRules :: SimplM RuleEnv Source #

# Substitution results

data SimplSR Source #

A substitution result.

Constructors

DoneEx OutExpr |
DoneId OutId |
ContEx TvSubstEnv CvSubstEnv SimplIdSubst InExpr |

Instances

Outputable SimplSR # |
Methods ppr :: SimplSR -> SDoc Source # pprPrec :: Rational -> SimplSR -> SDoc Source #

mkContEx :: SimplEnv -> InExpr -> SimplSR Source #

substId :: SimplEnv -> InId -> SimplSR Source #

lookupRecBndr :: SimplEnv -> InId -> OutId Source #

refineFromInScope :: InScopeSet -> Var -> Var Source #

isJoinIdInEnv_maybe :: SimplEnv -> InId -> Maybe JoinArity Source #

# Simplifying `Id` binders

simplNonRecBndr :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) Source #

simplNonRecJoinBndr :: SimplEnv -> OutType -> InBndr -> SimplM (SimplEnv, OutBndr) Source #

simplRecBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv Source #

simplRecJoinBndrs :: SimplEnv -> OutType -> [InBndr] -> SimplM SimplEnv Source #

simplBinder :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) Source #

simplBinders :: SimplEnv -> [InBndr] -> SimplM (SimplEnv, [OutBndr]) Source #

substTy :: SimplEnv -> Type -> Type Source #

substTyVar :: SimplEnv -> TyVar -> Type Source #

getTCvSubst :: SimplEnv -> TCvSubst Source #

substCo :: SimplEnv -> Coercion -> Coercion Source #

substCoVar :: SimplEnv -> CoVar -> Coercion Source #

# Floats

data Floats Source #

Instances

Outputable Floats # |
Methods ppr :: Floats -> SDoc Source # pprPrec :: Rational -> Floats -> SDoc Source #

emptyFloats :: Floats Source #

isEmptyFloats :: SimplEnv -> Bool Source #

addNonRec :: SimplEnv -> OutId -> OutExpr -> SimplEnv Source #

addFloats :: SimplEnv -> SimplEnv -> SimplEnv Source #

extendFloats :: SimplEnv -> OutBind -> SimplEnv Source #

wrapFloats :: SimplEnv -> OutExpr -> OutExpr Source #

setFloats :: SimplEnv -> SimplEnv -> SimplEnv Source #

zapFloats :: SimplEnv -> SimplEnv Source #

addRecFloats :: SimplEnv -> SimplEnv -> SimplEnv Source #

mapFloats :: SimplEnv -> ((Id, CoreExpr) -> (Id, CoreExpr)) -> SimplEnv Source #

doFloatFromRhs :: TopLevelFlag -> RecFlag -> Bool -> OutExpr -> SimplEnv -> Bool Source #

getFloatBinds :: SimplEnv -> [CoreBind] Source #

type JoinFloats = OrdList OutBind Source #

emptyJoinFloats :: JoinFloats Source #

isEmptyJoinFloats :: SimplEnv -> Bool Source #

wrapJoinFloats :: SimplEnv -> OutExpr -> OutExpr Source #

zapJoinFloats :: SimplEnv -> SimplEnv Source #

restoreJoinFloats :: SimplEnv -> SimplEnv -> SimplEnv Source #

getJoinFloatBinds :: SimplEnv -> [CoreBind] Source #