[mercury-users] type class bug?

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Jun 22 12:40:16 AEST 2006


On Thu, 22 Jun 2006, Nicholas Nethercote wrote:

> Hi,
>
> I'm trying to use a type class.
>
> I have these declarations:
>
>    :- typeclass pstr(T) where [ func pstr(T) = string ].
>
>    :- instance pstr(raw_item)  where [ func(pstr/1) is pstr_raw_item  ].
>    :- instance pstr(type_expr) where [ func(pstr/1) is pstr_type_expr ].
>    %:- instance pstr(expr)      where [ func(pstr/1) is pstr_expr      ].
>
> This compiles fine.
>
> If I uncomment the last line, I get this error:

...

Does the error go away if you change the instance decls to:

	:- instance pstr(pair(raw_type_expr, src_locn)).
	:- instance pstr(pair(raw_expr, src_locn)).

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