ghc-5.02.x: getTcTyVar
Simon Peyton-Jones
simonpj at microsoft.com
Fri Dec 28 12:19:26 EST 2001
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:groessli at fmi.uni-passau.de]
| Sent: 28 December 2001 03:35
| To: glasgow-haskell-bugs at haskell.org
| 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
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-| haskell-bugs
|
More information about the Glasgow-haskell-bugs
mailing list