View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000055 | mercury | Bug | public | 2008-03-29 02:38 | 2008-06-02 15:06 | ||||||||
Reporter | obo | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||||||
Status | confirmed | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000055: typeclass instances for e.g. bag(T) no longer work | ||||||||||||
Description | with 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. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
mark (administrator) 2008-03-29 12:00 |
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) 2008-06-02 15:06 |
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. |