[mercury-users] random quantification suggestion

Michael Day mikeday at bigpond.net.au
Mon Jun 3 21:49:23 AEST 2002

Just a piece of random syntax sugar for quantification; replace this:

:- some [T] pred foo(T).

with this:

:- pred foo(T) for some [T].

Same thing for all, although it wouldn't be needed as much:

:- pred foo(T) for all [T].

It would require an operator "for" with the appropriate precedence and so
forth; I don't really have any idea if it's feasible. But anyone reading
quantification out aloud will invariably add "for", and being able to
write it *afterwards* seems more natural for predicate declarations.

Might or might not work with type class constraints:

:- pred foo(T) for some [T] => store(T).

Doesn't look too bad, hmm?


mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list