eta-expansion
David Sabel
dsabel@stud.uni-frankfurt.de
Wed, 23 Apr 2003 23:58:28 +0200
I have some questions about the eta-expansion, which
is perfomed in the simplifier.
I found in [1], that the transformation "eta-expansion"
is of the form
v = \a1 ... an -> f a1 ... an
===> v = \a1 ...an ... am -> f a1 ... an ...am
assuming f has arity m > n.
arity is something like "how many arguments can be applied, without
perfoming work"
My questions:
1) How do you compute this arity.
2) What's the expression f in the general rule, is it a variable or
a term, or could it be both?
In the same paper is the case-eta-expansion, but I don't understand
the correctness of this transformation:
case e of {p1 -> e1,...,pn -> en}
===> \y -> case e of {p1 -> e1 y, ..., pn -> en y}
The rhs is a WHNF, but the lhs isn't, so the rule
can't be correct in general. For example, assume that e is bot.
Regards,
David
[1] André Santos,
Compilation by Transformation in Non-Strict Functional Languages,
PhD thesis, TR-1995-17,
Department of Computing Science, University of Glasgow, 1995.
---------------------------------------------------------------------
David Sabel
sabel@cs.uni-frankfurt.de
JWGU Frankfurt