2024-07-13 12:46 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000055mercuryBugpublic2008-06-02 15:06
Assigned To 
Product Version 
Target VersionFixed in Version 
Summary0000055: typeclass instances for e.g. bag(T) no longer work
Descriptionwith rotd-2008-03-27, the attached file bug.m gives the following error:

bug.m:001: Warning: interface for module `bug' does not export anything.
bug.m:011: In instance declaration for `bug.fooable((bag.bag(V)))':
bug.m:011: the first arg contains a type variable which is used in another
bug.m:011: arg

with rotd-2007-08-13, the same code was compilable and worked as expected.

When I tried to avoid the type variable by instantiating the typeclass for eg. bag(string) specifically, the recent ROTD gives me this error:

testhugemap.m:047: In instance declaration for
testhugemap.m:047: `pickle.tc_picklable((bag.bag(string)))':
testhugemap.m:047: the first arg is a type whose first arg is not a variable

What is the correct way of instantiating such typeclasses?

Thanks, Ondrej.

TagsNo tags attached.
Attached Files
  • ? file icon bug.m (206 bytes) 2008-03-29 02:38




mark (administrator)

The basic problem is the following restriction from the
reference manual:

    "The types in an instance declaration must not be abstract
    types which are elsewhere defined as equivalence types."

bag/1 is an abstract type that happens to be defined as an
equivalence type.

The error message is just plain wrong, however.


juliensf (administrator)

I have changed the definition of bag/1 so that it can be used in type class instances --
the issue with the error message is still a bug though.

-Issue History
Date Modified Username Field Change
2008-03-29 02:38 obo New Issue
2008-03-29 02:38 obo File Added: bug.m
2008-03-29 12:00 mark Note Added: 0000096
2008-03-29 12:02 mark Status new => confirmed
2008-06-02 15:06 juliensf Note Added: 0000103
+Issue History