From 2add920879ae9107f8dffd6d2dbca174fb85fae3 Mon Sep 17 00:00:00 2001 From: sewardj Date: Mon, 6 Mar 2000 10:12:57 +0000 Subject: [PATCH] [project @ 2000-03-06 10:12:57 by sewardj] typeInstDefn(), the bit which invents GHC compatible instance names: handle multiparam type classes. This enables Hugs standalone to deal multiparam type classes, but there's a fudge: class Foo s m where { } instance Foo s () where { } GHC calls the instance $fFoos. But Hugs records type vars as offsets, and loses the name "s" in the instance head; all it knows about are tyvar numbers (offsets), starting from zero. So it can never generate $fFoos here, only $fFoo0 (zero). The resulting code works in standalone mode but will not interwork with GHC. In general tho, multiparam type classes are not (yet) supported in combined mode; interface.c certainly can't handle them. It might be simplest in this case to change GHC's instance naming defn to be the same as Hugs'. --- ghc/interpreter/type.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ghc/interpreter/type.c b/ghc/interpreter/type.c index fec44e1..645ffb5 100644 --- a/ghc/interpreter/type.c +++ b/ghc/interpreter/type.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: type.c,v $ - * $Revision: 1.24 $ - * $Date: 2000/03/06 08:38:05 $ + * $Revision: 1.25 $ + * $Date: 2000/03/06 10:12:57 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -1983,12 +1983,13 @@ Inst in; { /* member functions for instance in*/ for (j = 0; i