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

Thomas Conway conway at cs.mu.OZ.AU
Fri Oct 12 13:44:03 AEST 2001


On Fri, Oct 12, 2001 at 01:00:25PM EST, Michael Day wrote:
> More seriously though, what kind of beast is the term [X] ? I imagine now
> it expands into something like [|](X, []) ? Which would prevent me from
> using it as a single argument type constructor?
> 
> :- type [T] == list(T).	% for example
> 

If you want this you do it in the following way:

:- type [A|B] == list(A).
:- type [] ---> [].

:- type foo == [int].

(nb [int] = [int|[]]).

-- 
  Thomas Conway )O+
 <conway at cs.mu.oz.au>       499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
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