On Mon, Feb 16, 2015 at 10:58 AM, Matt Oliveri <[email protected]> wrote:

> On Mon, Feb 16, 2015 at 10:46 AM, Jonathan S. Shapiro <[email protected]>
> wrote:
> > So I think that another viable proposal here is to decide that a function
> > definition can only specify a single pattern, and that from a type theory
> > perspective all functions are arity-1.
>
> Yes. I think that's the best proposal so far, actually.
>
> > Such a function can return a lambda,
> > allowing it to be progressively applied in something like curried style,
> but
> > the compiler is not inserting any accumulations in this case.
>
> I don't know what you mean by an accumulation. If the function is
> natively curried, you're saying there's still some trick to provide
> all the arguments in one function call?
>

I'm not sure what "natively curried" means in a language where all
functions are arity-1. What I was trying to say is that when all functions
are arity-1 the compiler never needs to insert lambda wrappers to turn
curried application into intermediate function calls that accumulate the
arguments.


> > The unfortunate consequence of this is that we remove all partial
> > application from the language, but we seem to be deciding that in the
> > presence of higher arity we need to do that anyway.
>
> 1. By "higher arity", you mean natively takes more than one argument?
>

Yes.


> 2. By no partial application, you only mean of natively-higher-arity
> functions, right?


Yes.



shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to