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

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 11 11:09:11 AEST 2001


On 11-May-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Fri, May 11, 2001 at 03:55:15AM +1000, Fergus Henderson wrote:
> > OK, so that was the old story.  But now that I think about it a bit
> > more, I suppose the type checker doesn't handle all constraints eagerly
> > any more.  In particular, type class constraints get delayed.  Maybe we
> > could do something similar here, with a higher-order call adding a class
> > 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.
> 
> That would be nice.  But if that proves to be too much work, I think an
> engineering solution (ie, a hack) would be much better than nothing.  How
> about just specifying that F(A) always means fully applying F to A, not
> partially applying it?  Ie, always type F(A) as F :: func(T1) = T, A :: T.

Good idea -- such a good idea, in fact, that it is exactly what we do
currently ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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