ghc-4.04 gives the following confusing error message:
compiling with ghc-4.04 -fglasgow-exts -c Test.hs
Test.hs:8:
None of the type variable(s) in the constraint `Eq a'
appears in the type `Set a -> Set a -> Set a'
In the type signature for `unionSets'
Compilation had errors
module Test where
unionSetB :: Eq a => Set a -> Set a -> Set a
unionSetB (s1 :: Set a) s2 = unionSets s1 s2
where
unionSets :: Eq a => Set a -> Set a -> Set a
unionSets a b = a
Ok, I know why this happens, because a is no longer free in unionSets
because of the pattern signature, but initially it confused me looking at it
trying to work out why a /= a.
(Incidently hugs accepts this code without any complaints)
Meurig