summaryrefslogtreecommitdiff
path: root/testdata/language-features/adt/adt02.out
blob: 404cd771f963befb82f415c0aeccf936ba1401f5 (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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
main :: Bool
main = True
------------ desugared source code
data Data1 :: Type where
    Data1 :: Bool -> Data1

one1
  = _lhs one1 \(a :: _) -> case'Data1 (\(_ :: _) -> _) (\(b :: _) -> _rhs b) a

data Data2 :: Type where
    Data2 :: Bool -> String -> Bool -> Data2

one2
  = _lhs
    one2
    \(a :: _) -> case'Data2
      (\(_ :: _) -> _)
      (\(b :: _) (_ :: _) (_ :: _) -> _rhs b)
      a

two2
  = _lhs
    two2
    \(a :: _) -> case'Data2
      (\(_ :: _) -> _)
      (\(_ :: _) (b :: _) (_ :: _) -> _rhs b)
      a

thr2
  = _lhs
    thr2
    \(a :: _) -> case'Data2
      (\(_ :: _) -> _)
      (\(_ :: _) (_ :: _) (b :: _) -> _rhs b)
      a

value1 = _lhs value1 (_rhs (Data1 True))

value2 = _lhs value2 (_rhs (Data2 True "friend" True))

data Data3 (_ :: Type) (_ :: Type) (_ :: Type) :: Type where
    Data3 :: forall a b c . a -> b -> c -> Data3 a b c

one3
  = _lhs
    one3
    \(a :: _) -> case'Data3
      (\(_ :: _) -> _)
      (\(b :: _) (_ :: _) (_ :: _) -> _rhs b)
      a

two3
  = _lhs
    two3
    \(a :: _) -> case'Data3
      (\(_ :: _) -> _)
      (\(_ :: _) (b :: _) (_ :: _) -> _rhs b)
      a

thr3
  = _lhs
    thr3
    \(a :: _) -> case'Data3
      (\(_ :: _) -> _)
      (\(_ :: _) (_ :: _) (b :: _) -> _rhs b)
      a

value3 = _lhs value3 (_rhs (Data3 True True True))

main = _lhs main (_rhs (one2 value2 && thr2 value2 && one3 value3))
------------ core code
'Data1 :: Type
'Data1 = <<type constructor with 0 indices; constructors: Data1>>

'Data2 :: Type
'Data2 = <<type constructor with 0 indices; constructors: Data2>>

'Data3 :: Type -> Type -> Type -> Type
'Data3 = <<type constructor with 0 indices; constructors: Data3>>

Data1 :: Bool -> Data1
Data1 = <<0th constructor of 'Data1>>

Data2 :: Bool -> String -> Bool -> Data2
Data2 = <<0th constructor of 'Data2>>

Data3 :: forall a b c . a -> b -> c -> Data3 a b c
Data3 = <<0th constructor of 'Data3>>

case'Data1
  :: forall (a :: Data1 -> Type)
    -> (forall (b :: Bool) -> a ('Data1 b)) -> forall (c :: Data1) -> a c
case'Data1 = \a b c -> <<case function of a type with 0 parameters>>

case'Data2
  :: forall (a :: Data2 -> Type)
    -> (forall (b :: Bool) (c :: String) (d :: Bool) -> a ('Data2 b c d))
      -> forall (e :: Data2) -> a e
case'Data2 = \a b c -> <<case function of a type with 0 parameters>>

case'Data3
  :: forall a b c
    . forall (d :: Data3 a b c -> Type)
      -> (forall (e :: a) (f :: b) (g :: c) -> d ('Data3 e f g))
        -> forall (h :: Data3 a b c) -> d h
case'Data3 = \_ _ _ a b c -> <<case function of a type with 3 parameters>>

main :: Bool
main = _rhs True

match'Data1 :: forall (a :: Type -> Type) -> a Data1 -> forall b -> a b -> a b
match'Data1 = \a b c d -> <<type case function>>

match'Data2 :: forall (a :: Type -> Type) -> a Data2 -> forall b -> a b -> a b
match'Data2 = \a b c d -> <<type case function>>

match'Data3
  :: forall (a :: Type -> Type)
    -> (forall b c d -> a (Data3 b c d)) -> forall e -> a e -> a e
match'Data3 = \a b c d -> <<type case function>>

one1 :: Data1 -> Bool
one1 = \a -> case'Data1 (\_ -> 'Bool) (\b -> _rhs b) a

one2 :: Data2 -> Bool
one2 = \a -> case'Data2 (\_ -> 'Bool) (\b _ _ -> _rhs b) a

one3 :: forall a b c . Data3 a b c -> a
one3 = \a b c d -> case'Data3 (\_ -> a) (\e _ _ -> _rhs e) d

thr2 :: Data2 -> Bool
thr2 = \a -> case'Data2 (\_ -> 'Bool) (\_ _ b -> _rhs b) a

thr3 :: forall a b c . Data3 a b c -> c
thr3 = \a b c d -> case'Data3 (\_ -> c) (\_ _ e -> _rhs e) d

two2 :: Data2 -> String
two2 = \a -> case'Data2 (\_ -> 'String) (\_ b _ -> _rhs b) a

two3 :: forall a b c . Data3 a b c -> b
two3 = \a b c d -> case'Data3 (\_ -> b) (\_ e _ -> _rhs e) d

value1 :: Data1
value1 = _rhs (Data1 True)

value2 :: Data2
value2 = _rhs (Data2 True "friend" True)

value3 :: Data3 Bool Bool Bool
value3 = _rhs (Data3 True True True)
------------ tooltips
1:6-1:11
    Type | Type | Type | Type | Type | Type
1:6-1:19
    Type
1:14-1:19
    Bool -> Data1 | Data1 | Type | Type
1:22-1:26
    Data1 -> Bool
1:30-1:34
    Type
3:6-3:11
    Type | Type | Type | Type | Type | Type
3:6-3:19
    Type
3:6-6:17
    Type | Type
3:14-3:19
    Bool -> String -> Bool -> Data2 | Data2 | Type | Type | Type | Type
4:5-4:9
    Data2 -> Bool
4:13-4:17
    Type
5:5-5:9
    Data2 -> String
5:13-5:19
    Type
6:5-6:9
    Data2 -> Bool
6:13-6:17
    Type
9:1-9:7
    Data1
9:10-9:15
    Bool -> Data1
9:10-9:20
    Data1
9:16-9:20
    Bool
10:1-10:7
    Data2
10:10-10:15
    Bool -> String -> Bool -> Data2
10:10-10:20
    String -> Bool -> Data2
10:10-10:29
    Bool -> Data2
10:10-10:34
    Data2
10:16-10:20
    Bool
10:21-10:29
    String
10:30-10:34
    Bool
12:6-12:11
    Type -> Type -> Type -> Type | Type -> Type -> Type -> Type | Type
      -> Type -> Type -> Type | Type -> Type -> Type -> Type | Type
12:6-12:13
    Type -> Type -> Type
12:6-12:15
    Type -> Type
12:6-12:17
    Type | Type
12:6-12:25
    Type | Type | Type | Type
12:6-15:14
    Type | Type | Type | Type | Type
12:12-12:13
    Type
12:14-12:15
    Type
12:16-12:17
    Type
12:20-12:25
    forall a b c . a -> b -> c -> Data3 a b c | Data3
      _g
      _f
      _e | Type | Type | Type | Type
13:5-13:9
    forall a b c . Data3 a b c -> a
13:13-13:14
    Type
14:5-14:9
    forall a b c . Data3 a b c -> b
14:13-14:14
    Type
15:5-15:9
    forall a b c . Data3 a b c -> c
15:13-15:14
    Type
18:1-18:7
    Data3 Bool Bool Bool
18:10-18:15
    forall a b c . a -> b -> c -> Data3 a b c
18:10-18:20
    _b -> _a -> Data3 Bool _b _a
18:10-18:25
    _a -> Data3 Bool Bool _a
18:10-18:30
    Data3 Bool Bool Bool
18:16-18:20
    Bool
18:21-18:25
    Bool
18:26-18:30
    Bool
20:1-20:5
    Bool
20:8-20:12
    Data2 -> Bool
20:8-20:19
    Bool
20:8-20:22
    Bool -> Bool
20:8-20:49
    Bool
20:13-20:19
    Data2
20:20-20:22
    Bool -> Bool -> Bool
20:23-20:27
    Data2 -> Bool
20:23-20:34
    Bool
20:23-20:37
    Bool -> Bool
20:23-20:49
    Bool
20:28-20:34
    Data2
20:35-20:37
    Bool -> Bool -> Bool
20:38-20:42
    forall a b c . Data3 a b c -> a
20:38-20:49
    Bool
20:43-20:49
    Data3 Bool Bool Bool