SimplUtils

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

SimplUtils

# Documentation

mkLam :: SimplEnv -> [OutBndr] -> OutExpr -> SimplCont -> SimplM OutExpr #

mkCase :: DynFlags -> OutExpr -> OutId -> OutType -> [OutAlt] -> SimplM OutExpr #

prepareAlts :: OutExpr -> OutId -> [InAlt] -> SimplM ([AltCon], [InAlt]) #

tryEtaExpandRhs :: SimplMode -> OutId -> OutExpr -> SimplM (Arity, Bool, OutExpr) #

preInlineUnconditionally :: SimplEnv -> TopLevelFlag -> InId -> InExpr -> StaticEnv -> Maybe SimplEnv #

postInlineUnconditionally :: SimplEnv -> TopLevelFlag -> OutId -> OccInfo -> OutExpr -> Bool #

activeUnfolding :: SimplMode -> Id -> Bool #

activeRule :: SimplMode -> Activation -> Bool #

getUnfoldingInRuleMatch :: SimplEnv -> InScopeEnv #

simplEnvForGHCi :: DynFlags -> SimplEnv #

updModeForStableUnfoldings :: Activation -> SimplMode -> SimplMode #

updModeForRules :: SimplMode -> SimplMode #

data SimplCont #

Constructors

Stop OutType CallCtxt |
CastIt OutCoercion SimplCont |
ApplyToVal |
Fields sc_dup :: DupFlag sc_arg :: InExpr sc_env :: StaticEnv sc_cont :: SimplCont
ApplyToTy |
Fields sc_arg_ty :: OutType sc_hole_ty :: OutType sc_cont :: SimplCont
Select |
Fields sc_dup :: DupFlag sc_bndr :: InId sc_alts :: [InAlt] sc_env :: StaticEnv sc_cont :: SimplCont
StrictBind |
Fields sc_dup :: DupFlag sc_bndr :: InId sc_bndrs :: [InBndr] sc_body :: InExpr sc_env :: StaticEnv sc_cont :: SimplCont
StrictArg |
Fields sc_dup :: DupFlag sc_fun :: ArgInfo sc_cci :: CallCtxt sc_cont :: SimplCont
TickIt (Tickish Id) SimplCont |

Instances

Outputable SimplCont # |
Instance details Defined in SimplUtils Methods ppr :: SimplCont -> SDoc # pprPrec :: Rational -> SimplCont -> SDoc #

data DupFlag #

Constructors

NoDup |
Simplified |
OkToDup |

Instances

Outputable DupFlag # |
Instance details Defined in SimplUtils Methods ppr :: DupFlag -> SDoc # pprPrec :: Rational -> DupFlag -> SDoc #

type StaticEnv = SimplEnv #

isSimplified :: DupFlag -> Bool #

contIsStop :: SimplCont -> Bool #

contIsDupable :: SimplCont -> Bool #

contResultType :: SimplCont -> OutType #

contHoleType :: SimplCont -> OutType #

contIsTrivial :: SimplCont -> Bool #

contArgs :: SimplCont -> (Bool, [ArgSummary], SimplCont) #

countArgs :: SimplCont -> Int #

mkBoringStop :: OutType -> SimplCont #

mkRhsStop :: OutType -> SimplCont #

mkLazyArgStop :: OutType -> CallCtxt -> SimplCont #

contIsRhsOrArg :: SimplCont -> Bool #

interestingCallContext :: SimplEnv -> SimplCont -> CallCtxt #

data ArgInfo #

Constructors

ArgInfo |
Fields ai_fun :: OutId ai_args :: [ArgSpec] ai_type :: OutType ai_rules :: FunRules ai_encl :: Bool ai_strs :: [Bool] ai_discs :: [Int]

data ArgSpec #

Constructors

ValArg OutExpr |
TyArg |
Fields as_arg_ty :: OutType as_hole_ty :: OutType
CastBy OutCoercion |

Instances

Outputable ArgSpec # |
Instance details Defined in SimplUtils Methods ppr :: ArgSpec -> SDoc # pprPrec :: Rational -> ArgSpec -> SDoc #

mkArgInfo :: SimplEnv -> Id -> [CoreRule] -> Int -> SimplCont -> ArgInfo #

addValArgTo :: ArgInfo -> OutExpr -> ArgInfo #

addCastTo :: ArgInfo -> OutCoercion -> ArgInfo #

addTyArgTo :: ArgInfo -> OutType -> ArgInfo #

argInfoExpr :: OutId -> [ArgSpec] -> OutExpr #

argInfoAppArgs :: [ArgSpec] -> [OutExpr] #

pushSimplifiedArgs :: SimplEnv -> [ArgSpec] -> SimplCont -> SimplCont #

abstractFloats :: DynFlags -> TopLevelFlag -> [OutTyVar] -> SimplFloats -> OutExpr -> SimplM ([OutBind], OutExpr) #

isExitJoinId :: Var -> Bool #