Re: scoped type variables in instance?

2002-04-23 Thread Ross Paterson
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,

RE: scoped type variables in instance?

2002-04-23 Thread Simon Peyton-Jones
| 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

Re: scoped type variables in instance?

2002-04-22 Thread Ross Paterson
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.

RE: scoped type variables in instance?

2002-04-22 Thread Simon Peyton-Jones
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

scoped type variables in instance?

2002-04-15 Thread Ross Paterson
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

Re: scoped type variables in instance?

2002-04-15 Thread Jay Cox
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

Re: scoped type variables in instance?

2002-04-15 Thread Jay Cox
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 :)