[mercury-users] Another place for existentials?

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 3 16:08:18 AEST 2000


On 03-Aug-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Question: is the following meant to be legal Mercury?
> 
> 	:- type stream(S) == S.

Yes.  But using equivalence types like this in instance declarations
won't help.

There's two cases to consider.  If the equivalence type is visible,
then it's just a syntactic abbreviation.  So

	:- instance foo(stream(S)).

will just be equivalent to

	:- instance foo(S).

and the former should be legal iff the latter is.
(If the compiler does not treat these two identically,
that would be a compiler bug...)

If the instance type is abstract, then the instance declaration
is not allowed: the language reference manual states "The types in an
instance declaration must not be abstract types which are elsewhere
defined as equivalence types.".  If you try, you'll get a link error.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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