ghc-7.8.0.20140228: The GHC API

Safe HaskellNone
LanguageHaskell98

CoreArity

Description

Arit and eta expansion

Synopsis

Documentation

manifestArity :: CoreExpr -> Arity Source

manifestArity sees how many leading value lambdas there are

exprArity :: CoreExpr -> Arity Source

An approximate, fast, version of exprEtaExpandArity

findRhsArity :: DynFlags -> Id -> CoreExpr -> Arity -> Arity Source

The Arity returned is the number of value args the expression can be applied to without doing much work

etaExpand Source

Arguments

:: Arity

Result should have this number of value args

-> CoreExpr

Expression to expand

-> CoreExpr 

etaExpand n us e ty returns an expression with the same meaning as e, but with arity n.

Given:

e' = etaExpand n us e ty

We should have that:

ty = exprType e = exprType e'