ghc-7.0.4: The GHC API

CoreArity

Description

Arit and eta expansion

Synopsis

- manifestArity :: CoreExpr -> Arity
- exprArity :: CoreExpr -> Arity
- exprBotStrictness_maybe :: CoreExpr -> Maybe (Arity, StrictSig)
- exprEtaExpandArity :: CheapFun -> CoreExpr -> Arity
- type CheapFun = CoreExpr -> Maybe Type -> Bool
- etaExpand :: Arity -> CoreExpr -> CoreExpr

# Documentation

manifestArity :: CoreExpr -> Arity Source

manifestArity sees how many leading value lambdas there are

exprArity :: CoreExpr -> Arity Source

An approximate, fast, version of `exprEtaExpandArity`

exprBotStrictness_maybe :: CoreExpr -> Maybe (Arity, StrictSig)Source

exprEtaExpandArity :: CheapFun -> CoreExpr -> Arity Source

type CheapFun = CoreExpr -> Maybe Type -> Bool Source

etaExpandSource

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'