[bitc-dev] Syntax: curried application
irving at naml.us
Mon Mar 9 10:44:19 EDT 2009
On Mon, Mar 9, 2009 at 10:00 AM, Jonathan S. Shapiro <shap at eros-os.com> wrote:
> Purity is not the only effect of interest. Heap allocation is another.
> I do concur that a partial application does not entail mutation effects,
> though it does entail escape (which has consequences for by-ref parameters).
> The more I think on this, the more interactions it seems to have, which
> inclines me (somewhat) to defer.
> shap, from my phone
If we take heap allocation into account, even the first equivalence of
yours breaks down. I.e.,
(pure fn 'a 'b -> 'c) != (pure fn 'a -> (pure fn 'b -> 'c))
since converting from left to right requires allocation. Overall, I
agree that currying adds far too many complications relative to its
I still think that "curried" syntax is an option, but it may be too
magical to stomach, since parentheses would be required for any
function with a curried type. E.g., if
f : a b -> c
g : a -> b -> c
the calling syntax would be
f a b + (g a) b
More information about the bitc-dev