[mercury-users] list functor style functions

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 12 22:40:51 AEDT 1999


On 12-Nov-1999, Ralph Becket <rbeck at microsoft.com> wrote:
> :- instance sequence(my_list(T), T) where [
>         func([]/0) is my_nil,
>         func('.'/2) is my_cons
> ].
...
> When I compile this, I get
> 
> Error: expected type in instance declaration to be a functor with variables
> as args: _1.

Obviously the error message here is not a good one.
But what the compiler is complaining about is the type `T'
in the second argument of the instance declaration for `sequence'.
The error is that this does not meet our current set of restrictions
on instance declarations, namely that types in instance declarations
must all be of the form `<typeconstructor>(<TypeVar1>, ..., <TypeVarN>)'
for some N >= 0.

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