scoped type variables in instance?

Ross Paterson ross at soi.city.ac.uk
Mon Apr 15 11:24:19 EDT 2002


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 to the a in the instance header,
and thus not universally quantified.



More information about the Glasgow-haskell-bugs mailing list