Jonathan S. Shapiro wrote:
>       (forall ((%f <= %map))
>         map: (fn f:(fn 'a -> 'b) ls:(list 'a) -> (list 'b))
>   
I like it a lot. In a ML-ish (with currying) syntax, it would be 
something like:

(forall %f <= %map).
    map : (f: 'a -> 'b) -> List 'a -> List 'b

Since you are not going curry-style, this would be:

(forall %f <= %map).
    map : (f: 'a -> 'b, List 'a) -> List 'b

I'm not sure that putting the qualifier outside the function label makes 
things clearer.
I think I would have preferred the syntax <value> : <type>, leading to:

    map : (forall %f <= %map).(f : 'a -> 'b, List 'a) -> List 'b

Since labels names in the type are arbitrary, you could also device a 
system where %% (for instance)
refers to the effect type variable of the function itself, %<N> where 
<N> is the effect type variable
of the N'th argument, and nesting through %<N>.<M>. Then you would get

    map : (forall %0 <= %%) . ('a -> 'b, List 'a) -> List 'b

Thanks,

PKE.

-- 
Pål-Kristian Engstad ([EMAIL PROTECTED]), 
Lead Graphics & Engine Programmer,
Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North,
Santa Monica, CA 90404, USA. Ph.: (310) 633-9112.

"It is better to have 100 functions operate on one data structure
 than 10 functions [each operate] on 10 data structures." -- NN


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

Reply via email to