[m-dev.] Introduce !! rather than ^elem() for indexing

Michael Day mikeday at bigpond.net.au
Fri Oct 12 14:11:30 AEST 2001


> If you want this you do it in the following way:
>
> :- type [A|B] == list(A).
> :- type [] ---> [].
>
> :- type foo == [int].
>
> (nb [int] = [int|[]]).

That's very clever, and will reduce my typing considerably :) Passing a
list of lists of string now becomes [[string]] rather than
list(list(string)), which is pleasantly concise. And rather like Haskell,
I believe?

Michael

--------------------------------------------------------------------------
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