Hi Sigbjorn,

| loading the following module
|
| module A where { data X = X deriving (Foo.Bar); }
|
| produces
|
|  ERROR "a.hs" (line 1): Unknown class "d78938" in derived instance
|
| making it all a bit more real, and changing Foo.Bar to Prelude.Eq
| (+ adding "import qualified Prelude"), produces a similar error msg.

Thanks for the bug report.  I've tracked this down, and the fix will
appear in the official Hugs 98 release.  For anyone anxious to avoid
this now, a sketch of the modifications needed is attached below.
(Just two lines need to be changed; they are marked by CHANGED).

All the best,
Mark

>From static.c:

static Void local checkDerive(t,p,ts,ct)/* verify derived instance request
*/
Tycon t;                                /* for tycon t, with explicit
*/
List  p;                                /* context p, component types ts
*/
List  ts;                               /* and named class ct
*/
Cell  ct; {
    Int   line = tycon(t).line;
    Class c    = findQualClass(ct);     /* CHANGED */
    if (isNull(c)) {
        ERRMSG(line) "Unknown class \"%s\" in derived instance",
                     identToStr(ct)     /* CHANGED */
        EEND;
    }
    addDerInst(line,c,p,dupList(ts),t,tycon(t).arity);
}

Reply via email to