blob: 039830e63a73f195ec468bd0dc7b6d1fbdfd5b79 (
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’
‘a’ is a rigid type variable 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: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.2.0:GHC.Integer.Type’
instance Eq () -- Defined in ‘GHC.Classes’
...plus 21 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)
|