I don't know if this is a difference in terminology or not, but:

On 30 March 2015 at 11:50, Matt Oliveri <[email protected]> wrote:

> On Mon, Mar 30, 2015 at 2:54 AM, Keean Schupke <[email protected]> wrote:
> > As such the function concretization pass only has to deal with fully
> > determined arity abstract types.
>
> What exactly is fully determined about an arity-abstract type, whose
> arity is--by definition--not yet determined?
>

IE we know the whole type:

a -> b -> c

where c cannot be further expanded to (d -> e).

It is fully determined in that we know the number and nature of all
arguments. A curried function (arity abstract) has no arities to be
determentd.


>
> > A curried type is already arity abstract (the point of currying is to
> make
> > type system imementation easier, not partial application etc)
>
> We either do not mean the same thing by "curried" or by "arity-abstract".
>
> Curried: One function nested as the return of another
> Arity-Abstract: Concrete arity is unknown
>

Currying is the process of converting a multi-argument function into
functions that only accept one argument. Therefore a curried function has
only one argument. First-class functions refers to the fact that a function
can accept a function as an argument or return one as a result. Currying
relies on first-class functions, but first-class functions do not rely on
currying.


> It seems perfectly reasonable to me to curry arity-concrete functions.
> Indeed, (cfn 'a->cfn 'b->'c) is such a function type. But I don't
> think we ever reached a consensus on this terminology.
>

Arity concrete functions can also return functions, I have not said they
cannot, however they can have more than one argument, so they are not all
in curried form.

In other words a curried function can represent all arity-abstract
functions, but not all arity-concrete ones.

So re-recap my representations:

- A curried arrow (can only accept one argument) is used to represent
arity-abstract functions. We can call this an abstract-curried arrow if you
like "->"

- An uncurried arrow (can have more than one argument) is used to represent
concrete-arity functions. We can call this a concrete-arrow "=>"

After initial parsing arity abstract functions look like this:

'a -> 'b -> 'c

And arity concrete functions look like this (and may return further
functions):

'a 'b => 'c

After concretisation all (curried) arity-abstract arrows disappear, and are
no longer valid in the type system, only (uncurried) concrete-arity
functions remain.


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

Reply via email to