T13242a.hs:10:5: error: • Couldn't match expected type ‘a0’ with actual type ‘a’ because type variable ‘a’ would escape its scope This (rigid, skolem) type variable is bound by a pattern with constructor: A :: forall a. Eq a => a -> T, in a pattern binding in 'do' block at T13242a.hs:10:3-5 • In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' return (x == x) In an equation for ‘test’: test = do A x <- undefined _ <- return 'a' _ <- return 'b' return (x == x) • Relevant bindings include x :: a (bound at T13242a.hs:10:5) T13242a.hs:13:11: error: • Ambiguous type variable ‘a0’ arising from a use of ‘==’ prevents the constraint ‘(Eq a0)’ from being solved. Relevant bindings include x :: a0 (bound at T13242a.hs:10:5) Probable fix: use a type annotation to specify what ‘a0’ should be. These potential instances exist: instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘integer-gmp-1.0.1.0:GHC.Integer.Type’ instance Eq a => Eq (Maybe a) -- Defined in ‘GHC.Base’ ...plus 22 others ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' return (x == x) In an equation for ‘test’: test = do A x <- undefined _ <- return 'a' _ <- return 'b' return (x == x)