ghc-8.6.4: The GHC API

CoreArity

Description

Arity and eta expansion

Synopsis

# Documentation

manifestArity sees how many leading value lambdas there are, after looking through casts

An approximate, fast, version of exprEtaExpandArity

Arguments

 :: Arity Result should have this number of value args -> CoreExpr Expression to expand -> CoreExpr

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

Given:

e' = etaExpand n e

We should have that:

ty = exprType e = exprType e'

Split an expression into the given number of binders and a body, eta-expanding if necessary. Counts value *and* type binders.