uncurrying

Stephen Weeks sweeks@wasabi.epr.com
Tue, 14 Sep 1999 12:10:39 -0700 (PDT)


> Can you elaborate?  In particular, I was wondering whether this
> would happen in the most common case, namely a curried function
> that is always fully applied.  In this case, wouldn't the simplifier
> running after closure conversion be able to remove the extra
> overhead?

Not necessarily so.  Suppose you have the following

fun f a b = ... x1 ... x2 ... xn ... a ...

Then, the closure converted form of f would look like

fun f(r, a) = 
	let 
		val x1 = #1 r
		...
		val xn = #n r
	in
		(x1, ..., xn, a)
	end

It doesn't matter if f is fully applied if this expression is too big 
to be inlined.