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 a '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:13: 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. Potentially matching instances: instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others ...plus five 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)