incompatible signatur syntax within instance definition

Simon Peyton-Jones simonpj at
Mon Dec 15 08:36:15 EST 2003

| This is legal in Haskell 98, because the `a' in the inner declaration
| implicitly universally quantified.  But if the scope of the outer type
| variable `a' extends over the inner type declaration, then the inner
| will not be locally universally quantified, and the call to `bar' will
| be a type error, because the `a' in the head of the instance
| will in general be different than `Int'.
| P.S. I note that ghc 5.02.2 enables this extension always, regardless
| of the setting of -fglasgow-exts.  That seems like a bug to me.

And indeed, GHC 6.0 fixes this bug: no scoped type variables without


More information about the Glasgow-haskell-users mailing list