[m-dev.] Why does the language insist on explicit lambdas?

Ralph Becket rbeck at microsoft.com
Fri May 11 18:30:43 AEST 2001


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> Sent: 10 May 2001 18:55
> [...]
> constraint for some builtin type class constraint.  i.e. for
> 
> 	p(P, A) :- P(A).
> 
> we'd infer
> 
> 	:- pred p(T1, T2) <= call(T1, T2).
> 
> Then we'd just need to have some builtin instances of this type class
> for the builtin higher-order types.  Hmmm, interesting...
> I haven't thought through all the ramifications of this.

Looks good to me too (also in a not-having-thought-too-deeply-about-it
sense).

The thing is that in my example I wrote

:- func foo(func(A, B, C) = Z, A, B, C) = Z.
foo(F, A, B, C) = foooo(F(A), B, C).

:- func foooo(func(B, C) = Z, B, C) = Z.
foooo(F, B, C) = F(B, C).

so the compiler had all the type information given to it; there's no
need for any type inference that I can see.

This is something that fully curried languages like ML do as a matter
of course - is there any way we could make use of ML style type
checkers/inference?

- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list