--- /dev/null
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! Functional dependencies
+-- This one gave another fail in tcReadMutVar
+
+module M1 where
+
+class HasFoo a foo | a -> foo where
+ foo :: a -> foo
+instance HasFoo Int Int where
+ foo = id
+
+instance HasFoo a b => HasFoo [a] b where
+ foo = foo . head
+
+test:: [[Int]] -> Int
+test = foo
--- /dev/null
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! An instance decl with a context containing a free type variable
+-- The interest here is that there's a "b" in the instance decl
+-- context that isn't mentioned in the instance head.
+
+module ShouldCompile where
+
+class HasConverter a b | a -> b where
+ convert :: a -> b
+
+data Foo a = MkFoo a
+
+instance (HasConverter a b,Show b) => Show (Foo a) where
+ show (MkFoo value) = show (convert value)
+
--- /dev/null
+{-# OPTIONS -fglasgow-exts #-}
+
+-- !!! Functional dependencies and existentials
+
+-- Hugs (February 2000) doesn't like it. It says
+-- Variable "e" in constraint is not locally bound
+
+module ShouldCompile where
+
+class Collection c e | c -> e where
+ empty :: c
+ put :: c -> e -> c
+
+data SomeCollection e = forall c . Collection c e => MakeSomeCollection c