ghc-8.2.1: The GHC API

Safe HaskellNone




Simple expression optimiser

Join points

joinPointBinding_maybe :: InBndr -> InExpr -> Maybe (InBndr, InExpr) Source #

Returns Just (bndr,rhs) if the binding is a join point: If it's a JoinId, just return it If it's not yet a JoinId but is always tail-called, make it into a JoinId and return it. In the latter case, eta-expand the RHS if necessary, to make the lambdas explicit, as is required for join points

Precondition: the InBndr has been occurrence-analysed, so its OccInfo is valid

Predicates on expressions

exprIsConApp_maybe :: InScopeEnv -> CoreExpr -> Maybe (DataCon, [Type], [CoreExpr]) Source #

Returns Just (dc, [], [x1..xn]) if the argument expression is a *saturated* constructor application of the form dc x1 .. xn, where are the *universally-qantified* type args of dc

Coercions and casts