ghc-9.0.0.20201227: The GHC API
Safe HaskellNone
LanguageHaskell2010

GHC.Core.Opt.Arity

Description

Arity and eta expansion

Synopsis

Documentation

manifestArity :: CoreExpr -> Arity Source #

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

exprArity :: CoreExpr -> Arity Source #

An approximate, fast, version of exprEtaExpandArity

etaExpand :: Arity -> CoreExpr -> CoreExpr Source #

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'

etaExpandToJoinPoint :: JoinArity -> CoreExpr -> ([CoreBndr], CoreExpr) Source #

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

data ArityType Source #

Constructors

ATop [OneShotInfo] 
ABot Arity 

Instances

Instances details
Eq ArityType # 
Instance details

Defined in GHC.Core.Opt.Arity

Outputable ArityType # 
Instance details

Defined in GHC.Core.Opt.Arity