blob: 4ada4ecaedd4a24078669291afb58e1cc8596acb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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.
These potential instances exist:
instance Eq Ordering -- Defined in ‘GHC.Classes’
instance Eq Integer -- Defined in ‘GHC.Num.Integer’
instance Eq () -- Defined in ‘GHC.Classes’
...plus N others
...plus N 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)
|