[Haskell] multiple occurence of the same type variable in
simonpj at microsoft.com
Wed Oct 26 09:01:08 EDT 2005
Quite right. I've fixed the documentation (in CVS).
| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org]
On Behalf Of Wolfgang
| Sent: 17 October 2005 14:04
| To: Haskell ML
| Subject: [Haskell] multiple occurence of the same type variable in
| the following is not Haskell 98:
| class C a
| instance C (a,a)
| Well, GHC allows this with the -fglasgow-exts flag. Surprisingly, I
| find a section in the GHC User's Guide which states that
| be used to allow this kind of instance declarations. Well, in the
| undecidable instances (184.108.40.206), one can read:
| Note that instance heads may contain repeated type variables.
| this is OK:
| instance Stateful (ST s) (MutVar s) where ...
| But one has to note that in this expample, the different occurences of
| aren't in the same type. Furthermore, multiple occurences of the same
| variable cannot result in undecidability (as far as I understand).
| above-mentioned statement talks about the things that are allowed
| -fallow-undecidable-instances, and premises that multiple occurences
| type variable are okay.
| So am I missing something?
| Best wishes,
| Haskell mailing list
| Haskell at haskell.org
More information about the Haskell