SimplUtils

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

SimplUtils

# Documentation

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

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

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

tryEtaExpandRhs :: SimplEnv -> RecFlag -> OutId -> OutExpr -> SimplM (Arity, OutExpr) Source #

preInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> InId -> InExpr -> Bool Source #

postInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> OutId -> OccInfo -> OutExpr -> Unfolding -> Bool Source #

activeUnfolding :: SimplEnv -> Id -> Bool Source #

activeRule :: SimplEnv -> Activation -> Bool Source #

getUnfoldingInRuleMatch :: SimplEnv -> InScopeEnv Source #

simplEnvForGHCi :: DynFlags -> SimplEnv Source #

updModeForStableUnfoldings :: Activation -> SimplifierMode -> SimplifierMode Source #

updModeForRules :: SimplifierMode -> SimplifierMode Source #

data SimplCont Source #

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 InId [InBndr] InExpr StaticEnv SimplCont |
StrictArg ArgInfo CallCtxt SimplCont |
TickIt (Tickish Id) SimplCont |

Instances

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

data DupFlag Source #

Constructors

NoDup |
Simplified |
OkToDup |

Instances

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

isSimplified :: DupFlag -> Bool Source #

contIsDupable :: SimplCont -> Bool Source #

contResultType :: SimplCont -> OutType Source #

contHoleType :: SimplCont -> OutType Source #

contIsTrivial :: SimplCont -> Bool Source #

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

countArgs :: SimplCont -> Int Source #

mkBoringStop :: OutType -> SimplCont Source #

mkRhsStop :: OutType -> SimplCont Source #

mkLazyArgStop :: OutType -> CallCtxt -> SimplCont Source #

contIsRhsOrArg :: SimplCont -> Bool Source #

interestingCallContext :: SimplCont -> CallCtxt Source #

data ArgInfo Source #

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 Source #

Constructors

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

Instances

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

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

addValArgTo :: ArgInfo -> OutExpr -> ArgInfo Source #

addCastTo :: ArgInfo -> OutCoercion -> ArgInfo Source #

addTyArgTo :: ArgInfo -> OutType -> ArgInfo Source #

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

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

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

abstractFloats :: [OutTyVar] -> SimplEnv -> OutExpr -> SimplM ([OutBind], OutExpr) Source #