I wrote:
| OK, I see this was intentional:
|
| The type variables in the head of a class or instance
| declaration scope over the methods defined in the where part.
|
| But both provisions cause Haskell 98 modules to be rejected,
| even without -fglasgow-exts.
On Mon, Apr 22,
| Is rejecting Haskell 98 modules when -fglasgow-exts is on
| also a bug? (i.e. does GHC Haskell aim to be a conservative
| extension of H98?)
Yes, we do so aim, but this seems to be an occasion where
there's no obvious way to make the extension 100% conservative
without making the extended
OK, I see this was intentional:
The type variables in the head of a class or instance declaration
scope over the methods defined in the where part.
But both provisions cause Haskell 98 modules to be rejected, even
without -fglasgow-exts.
That's a bug; I'll fix it.
| -Original Message-
| From: Ross Paterson [mailto:[EMAIL PROTECTED]]
| Sent: 22 April 2002 14:15
| To: [EMAIL PROTECTED]
| Subject: Re: scoped type variables in instance?
|
|
| OK, I see this was intentional:
|
| The type variables in the head
GHC (even without -fglasgow-exts) rejects the following:
newtype Foo a = Foo a
instance Eq a = Eq (Foo a) where
Foo x == Foo y = bar
where bar :: a
bar = undefined
It seems to treat the inner a as bound
On Mon, 15 Apr 2002, Ross Paterson wrote:
GHC (even without -fglasgow-exts) rejects the following:
newtype Foo a = Foo a
instance Eq a = Eq (Foo a) where
Foo x == Foo y = bar
where bar :: a
bar = undefined
On Mon, 15 Apr 2002, Jay Cox wrote:
class Eq z where
(==) :: z - z - Bool
Oops. Here to report a Jay.Brain bug. I understand you now.
Heh. I infered the bug you report was standard haskell usage.
Here's a more dramatic example of your bug :)