summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail067.stderr
blob: fffdfaf6f700c8620e29c5360914b72762f136cf (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

tcfail067.hs:1:14: warning: [-Wdeprecated-flags (in -Wdefault)]
    -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.

tcfail067.hs:12:16: error: [GHC-39999]
    • No instance for ‘Ord a’ arising from a use of ‘SubRange’
      Possible fix:
        add (Ord a) to the context of
          the type signature for:
            subRangeValue :: forall a. SubRange a -> a
    • In the pattern: SubRange (lower, upper) value
      In an equation for ‘subRangeValue’:
          subRangeValue (SubRange (lower, upper) value) = value

tcfail067.hs:15:11: error: [GHC-39999]
    • No instance for ‘Ord a’ arising from a use of ‘SubRange’
      Possible fix:
        add (Ord a) to the context of
          the type signature for:
            subRange :: forall a. SubRange a -> (a, a)
    • In the pattern: SubRange r value
      In an equation for ‘subRange’: subRange (SubRange r value) = r

tcfail067.hs:46:12: error: [GHC-39999]
    • Could not deduce ‘Ord a’ arising from a use of ‘SubRange’
      from the context: Show a
        bound by the type signature for:
                   showRange :: forall a. Show a => SubRange a -> String
        at tcfail067.hs:45:1-43
      Possible fix:
        add (Ord a) to the context of
          the type signature for:
            showRange :: forall a. Show a => SubRange a -> String
    • In the pattern: SubRange (lower, upper) value
      In an equation for ‘showRange’:
          showRange (SubRange (lower, upper) value)
            = show value ++ " :" ++ show lower ++ ".." ++ show upper

tcfail067.hs:61:12: error: [GHC-39999]
    • Could not deduce ‘Ord a’
        arising from a use of ‘numSubRangeNegate’
      from the context: Num a
        bound by the instance declaration at tcfail067.hs:60:10-34
      Possible fix:
        add (Ord a) to the context of the instance declaration
    • In the expression: numSubRangeNegate
      In an equation for ‘negate’: negate = numSubRangeNegate
      In the instance declaration for ‘Num (SubRange a)’

tcfail067.hs:65:19: error: [GHC-39999]
    • Could not deduce ‘Ord a’ arising from a use of ‘SubRange’
      from the context: Num a
        bound by the instance declaration at tcfail067.hs:60:10-34
      Possible fix:
        add (Ord a) to the context of the instance declaration
    • In the expression:
        SubRange (fromInteger a, fromInteger a) (fromInteger a)
      In an equation for ‘fromInteger’:
          fromInteger a
            = SubRange (fromInteger a, fromInteger a) (fromInteger a)
      In the instance declaration for ‘Num (SubRange a)’

tcfail067.hs:74:5: error: [GHC-39999]
    • Could not deduce ‘Ord a’ arising from a use of ‘SubRange’
      from the context: Num a
        bound by the type signature for:
                   numSubRangeBinOp :: forall a.
                                       Num a =>
                                       (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
        at tcfail067.hs:(71,1)-(72,58)
      Possible fix:
        add (Ord a) to the context of
          the type signature for:
            numSubRangeBinOp :: forall a.
                                Num a =>
                                (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
    • In the expression: SubRange (result, result) result
      In an equation for ‘numSubRangeBinOp’:
          numSubRangeBinOp op a b
            = SubRange (result, result) result
            where
                result = (subRangeValue a) `op` (subRangeValue b)