ghc-7.0.3: The GHC API

SimplUtils

# Documentation

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

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

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

tryEtaExpand :: SimplEnv -> OutId -> OutExpr -> SimplM (Arity, OutExpr)Source

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

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

activeUnfolding :: SimplEnv -> Id -> Bool Source

activeRule :: DynFlags -> SimplEnv -> Maybe (Activation -> Bool)Source

getUnfoldingInRuleMatch :: SimplEnv -> IdUnfoldingFun Source

simplEnvForGHCi :: SimplEnv Source

updModeForInlineRules :: Activation -> SimplifierMode -> SimplifierMode Source

data SimplCont Source

Constructors

Stop CallCtxt |
CoerceIt OutCoercion SimplCont |
ApplyTo DupFlag InExpr StaticEnv SimplCont |
Select DupFlag InId [InAlt] StaticEnv SimplCont |
StrictBind InId [InBndr] InExpr StaticEnv SimplCont |
StrictArg ArgInfo CallCtxt SimplCont |

Instances

Outputable SimplCont |

data DupFlag Source

Constructors

NoDup |
Simplified |
OkToDup |

Instances

Outputable DupFlag |

data ArgInfo Source

Constructors

ArgInfo |

Fields

ai_fun :: Id
ai_args :: [OutExpr]
ai_rules :: [CoreRule]
ai_encl :: Bool
ai_strs :: [Bool]
ai_discs :: [Int]

isSimplified :: DupFlag -> Bool Source

contIsDupable :: SimplCont -> Bool Source

contResultType :: SimplEnv -> OutType -> SimplCont -> OutType Source

contIsTrivial :: SimplCont -> Bool Source

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

dropArgs :: Int -> SimplCont -> SimplCont Source

pushSimplifiedArgs :: SimplEnv -> [CoreExpr] -> SimplCont -> SimplCont Source

countValArgs :: SimplCont -> Int Source

countArgs :: SimplCont -> Int Source

addArgTo :: ArgInfo -> OutExpr -> ArgInfo Source

mkBoringStop :: SimplCont Source

mkRhsStop :: SimplCont Source

mkLazyArgStop :: CallCtxt -> SimplCont Source

contIsRhsOrArg :: SimplCont -> Bool Source

interestingCallContext :: SimplCont -> CallCtxt Source

interestingArg :: CoreExpr -> ArgSummary Source

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

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