ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

SimplUtils

# Documentation

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

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

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

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

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

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

activeUnfolding :: SimplEnv -> Id -> Bool

activeRule :: SimplEnv -> Activation -> Bool

getUnfoldingInRuleMatch :: SimplEnv -> InScopeEnv

simplEnvForGHCi :: DynFlags -> SimplEnv

updModeForStableUnfoldings :: Activation -> SimplifierMode -> SimplifierMode

updModeForRules :: SimplifierMode -> SimplifierMode

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

Instances

Outputable SimplCont |

data DupFlag

Constructors

NoDup |
Simplified |
OkToDup |

Instances

Outputable DupFlag |

isSimplified :: DupFlag -> Bool

contIsDupable :: SimplCont -> Bool

contResultType :: SimplCont -> OutType

contHoleType :: SimplCont -> OutType

contIsTrivial :: SimplCont -> Bool

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

countValArgs :: SimplCont -> Int

countArgs :: SimplCont -> Int

mkBoringStop :: OutType -> SimplCont

mkRhsStop :: OutType -> SimplCont

mkLazyArgStop :: OutType -> CallCtxt -> SimplCont

contIsRhsOrArg :: SimplCont -> Bool

interestingCallContext :: SimplCont -> CallCtxt

data ArgInfo

Constructors

ArgInfo |

Fields

ai_fun :: OutId
ai_args :: [ArgSpec]
ai_type :: OutType
ai_rules :: [CoreRule]
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 |

mkArgInfo :: 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 :: [OutTyVar] -> SimplEnv -> OutExpr -> SimplM ([OutBind], OutExpr)