summaryrefslogtreecommitdiff
path: root/testdata/typeclass.out
blob: 7d3b916ab35660348f15e50f39cf8c3c1d731a58 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
main is not found
------------ desugared source code
infix 4 ==

infix 4 /=

infix 4 <

infixr 3 &&

infixr 2 ||

not = \(a :: _) -> case'Bool (\(_ :: _) -> _) (_rhs True) (_rhs False) a

(&&) = \(a :: _) (b :: _) -> case'Bool (\(_ :: _) -> _) (_rhs False) (_rhs b) a

(||) = \(a :: _) (b :: _) -> case'Bool (\(_ :: _) -> _) (_rhs b) (_rhs True) a

'Eq :: Type -> Constraint
'Eq
  = \(a :: _) -> match'Bool
    (\(_ :: _) -> _)
    (_rhs 'CUnit)
    a
    (_rhs ('CEmpty "no instance of 'Eq on ???"))

(==) :: forall a . Eq a => a -> a -> Bool
(==)
  = \ @a @(_ :: _) -> match'Bool
    (\(_ :: _) -> _)
    (_rhs
      let
        b = \(c :: _) (d :: _) -> case'Bool (\(_ :: _) -> _) (_rhs (not d)) (_rhs d) c
        in b)
    a
    (_rhs undefined)

(/=) = \(a :: _) (b :: _) -> _rhs (not (a == b))

(==.)
  = \(a :: _) (b :: _) -> case'List
    (\(_ :: _) -> _)
    (case'List (\(_ :: _) -> _) (_rhs True) (\(_ :: _) (_ :: _) -> _rhs False) b)
    (\(_ :: _) (c :: _) -> case'List
      (\(_ :: _) -> _)
      (_rhs False)
      (\(_ :: _) (d :: _) -> _rhs (c ==. d))
      b)
    a
------------ core code
&& :: Bool -> Bool -> Bool
&& = \a b -> case'Bool (\_ -> 'Bool) (_rhs False) (_rhs b) a

'Eq :: Type -> Constraint
'Eq
  = \a -> match'Bool
    (\_ -> 'Constraint)
    (_rhs CUnit)
    a
    (_rhs (CEmpty "no instance of 'Eq on ???"))

/= :: forall a . Eq a => a -> a -> Bool
/= = \a b c d -> _rhs (not ((a == b) c d))

== :: forall a . Eq a => a -> a -> Bool
==
  = \a _ -> match'Bool
    (\b -> b -> b -> 'Bool)
    (_rhs (==))
    a
    (_rhs (undefined (a -> a -> 'Bool)))

==. :: forall a b . [a] -> [b] -> Bool
==.
  = \a b -> primFix
    ([a] -> [b] -> 'Bool)
    \c d e -> case'List
      (\_ -> 'Bool)
      (case'List (\_ -> 'Bool) (_rhs True) (\_ _ -> _rhs False) e)
      (\_ f -> case'List (\_ -> 'Bool) (_rhs False) (\_ g -> _rhs (c f g)) e)
      d

not :: Bool -> Bool
not = \a -> case'Bool (\_ -> 'Bool) (_rhs True) (_rhs False) a

|| :: Bool -> Bool -> Bool
|| = \a b -> case'Bool (\_ -> 'Bool) (_rhs b) (_rhs True) a
------------ tooltips
testdata/typeclass.lc 8:1-8:4
    Bool -> Bool
testdata/typeclass.lc 8:12-8:17
    Bool
testdata/typeclass.lc 8:12-9:17
    Bool -> Bool
testdata/typeclass.lc 9:13-9:17
    Bool
testdata/typeclass.lc 11:6-11:8
    Bool -> Bool -> Bool
testdata/typeclass.lc 11:13-11:14
    _b
testdata/typeclass.lc 11:13-12:19
    Bool -> Bool
testdata/typeclass.lc 12:14-12:19
    Bool
testdata/typeclass.lc 14:7-14:9
    Bool -> Bool -> Bool
testdata/typeclass.lc 14:14-14:15
    _c
testdata/typeclass.lc 14:14-15:17
    Bool -> Bool
testdata/typeclass.lc 15:13-15:17
    Bool
testdata/typeclass.lc 17:7-17:9
    Type -> Constraint | Type -> Constraint | Constraint
testdata/typeclass.lc 17:7-18:27
    Type
testdata/typeclass.lc 18:6-18:8
    forall a . Eq a => a -> a -> Bool
testdata/typeclass.lc 18:13-18:14
    Type
testdata/typeclass.lc 18:13-18:27
    Type
testdata/typeclass.lc 18:18-18:19
    Type
testdata/typeclass.lc 18:18-18:27
    Type
testdata/typeclass.lc 18:23-18:27
    Type | Type
testdata/typeclass.lc 20:3-20:5
    forall a . Eq a => a -> a -> Bool
testdata/typeclass.lc 20:10-20:13
    Bool -> Bool
testdata/typeclass.lc 20:10-20:22
    Bool
testdata/typeclass.lc 20:15-20:16
    _f
testdata/typeclass.lc 20:15-20:19
    _e -> Bool
testdata/typeclass.lc 20:15-20:21
    Bool
testdata/typeclass.lc 20:17-20:19
    forall a . Eq a => a -> a -> Bool
testdata/typeclass.lc 20:20-20:21
    _c
testdata/typeclass.lc 23:17-23:18
    Bool
testdata/typeclass.lc 23:17-24:23
    Bool -> Bool
testdata/typeclass.lc 24:18-24:21
    Bool -> Bool
testdata/typeclass.lc 24:18-24:23
    Bool
testdata/typeclass.lc 24:22-24:23
    _b
testdata/typeclass.lc 26:6-26:9
    forall a b . [a] -> [b] -> Bool
testdata/typeclass.lc 26:17-26:21
    Bool
testdata/typeclass.lc 26:17-28:22
    [_a] -> Bool | Bool
testdata/typeclass.lc 27:36-27:38
    [_j]
testdata/typeclass.lc 27:36-28:22
    [_a] -> Bool | Bool
testdata/typeclass.lc 27:39-27:42
    _l
testdata/typeclass.lc 27:43-27:45
    [_g]
testdata/typeclass.lc 28:17-28:22
    Bool | Bool