[m-dev.] For review: minor additions to list.m and string.m

Ralph Becket rbeck at microsoft.com
Sat Sep 9 00:11:08 AEDT 2000


> > Hmmmmmmm.  That would read very nicely, but I think it 
> still gets kind
> > of confusing, for the same reason (or maybe it's the dual reason).
> 
> Yes.  I think probably the clearest way of writing these is as
> an explicit lambda expression.
> 
> Hence I don't think it would be worth adding `lt' etc. to int.m.

I disagree.  I think the main reason why this hasn't been a problem
in the past is that (going by what I've seen) there's very little
higher order Mercury code out there.

I would certainly find

	series(1, lt(100), fib)

much easier to read than

	series(1, ( pred(X::in) is semidet :- X < 100 ), fib)

and less confusing than

	series(1, >=(100), fib)

I think that the Mercury library currently lacks preds/funcs expressing
several common looping idioms and that (i) many such idioms are naturally
based around integer indices and (ii) therefore that lt, gt, etc. would
be very handy.  They certainly don't make anything less clear.

On (i), I'm prepared to be dissuaded if I see some convincing stream
typeclass stuff.

So, should I *not* add lt, gt, etc. on the grounds that concensus says
they are just unnecessary clutter or should I add them on the understanding
that they may be deprecated later on?

Cheers,

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