[mercury-users] maybe(T)

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 21 10:52:06 AEST 2002


On 21-Oct-2002, Michael Day <mikeday at yeslogic.com> wrote:
> 
> > Yes.  Well, close enough anyway.  We use a pointer to T to represent
> > yes(T) and we use a pointer with value "1" to represent no.
> 
> Actually I made a mistake, the maybe(T) type has "no" as its *first*
> functor, not the second.  Does this affect its representation?

In general, the order can effect the representation
(programmers concerned with micro-optimization should
order the functors with the most-frequently used ones first).
However, in this case it doesn't make any difference.

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