Thanks. Turned out to be a rather bizarre thing. The derived instance "should" look like instance X T c => Show S where ...
but the 'c' in the instance that doesn't appear after the => sent the system into a loop. I hadn't anticipated that.... I spent longer than I should have peering at this, and decided in the end that it is asking too much from the deriving mechanism to figure this out. The main difficulty is finding the fixpoint when figuring out the context for the instance declarations. So I just made it illegal. You'll have to write out your Show instance. An intermediate position would be to have some syntax for writing down the contexts of the instance decl. Simon | -----Original Message----- | From: Armin Groesslinger [mailto:[EMAIL PROTECTED]] | Sent: 28 December 2001 03:35 | To: [EMAIL PROTECTED] | Subject: ghc-5.02.x: getTcTyVar | | | Hello, | | when I try to compile the program below with "ghc | -fglasgow-exts -fallow-undecidable-instances" ghc-5.02.1 and | 5.02.2 (from today's | CVS) go into an infinite loop saying | | getTcTyVar c{-r4D-} | | all the time instead of complaining for the missing | instance X T c to derive Show S . | | | Regards, | | Armin | | | | module Test where | | data T = T Integer | | class X a b | a -> b where | f :: a -> b | | instance X T c => Show T where | show _ = "" | | data S = S T deriving Show | | | _______________________________________________ | Glasgow-haskell-bugs mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs | _______________________________________________ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs