bend-schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2974 @@
1
+ // Generated by bend-emit from core.bend. Do not edit; rebuild.
2
+ class $C$WNil { constructor() { this.$ = "WNil"; } }
3
+ const $N$WNil = new $C$WNil();
4
+ class $C$WCon$head$tail { constructor(a0, a1) { this.$ = "WCon"; this.head = a0; this.tail = a1; } }
5
+ class $C$Tuple$fst$snd { constructor(a0, a1) { this.$ = "Tuple"; this.fst = a0; this.snd = a1; } }
6
+ class $C$Some$value { constructor(a0) { this.$ = "Some"; this.value = a0; } }
7
+ class $C$None { constructor() { this.$ = "None"; } }
8
+ const $N$None = new $C$None();
9
+ class $C$$JMP$f$x { constructor(a0, a1) { this.$ = "$JMP"; this.f = a0; this.x = a1; } }
10
+ class $C$RMissing { constructor() { this.$ = "RMissing"; } }
11
+ const $N$RMissing = new $C$RMissing();
12
+ class $C$Con$head$tail { constructor(a0, a1) { this.$ = "Con"; this.head = a0; this.tail = a1; } }
13
+ class $C$Nil { constructor() { this.$ = "Nil"; } }
14
+ const $N$Nil = new $C$Nil();
15
+ class $C$RKey$key$val$rest { constructor(a0, a1, a2) { this.$ = "RKey"; this.key = a0; this.val = a1; this.rest = a2; } }
16
+ class $C$Err$path$why { constructor(a0, a1) { this.$ = "Err"; this.path = a0; this.why = a1; } }
17
+ class $C$LengthNotIn$lo$hi { constructor(a0, a1) { this.$ = "LengthNotIn"; this.lo = a0; this.hi = a1; } }
18
+ class $C$NotIn$lo$hi { constructor(a0, a1) { this.$ = "NotIn"; this.lo = a0; this.hi = a1; } }
19
+ class $C$AtField$skip$name { constructor(a0, a1) { this.$ = "AtField"; this.skip = a0; this.name = a1; } }
20
+ class $C$RepeatedKey$key { constructor(a0) { this.$ = "RepeatedKey"; this.key = a0; } }
21
+ class $C$Missing { constructor() { this.$ = "Missing"; } }
22
+ const $N$Missing = new $C$Missing();
23
+ class $C$TooLarge { constructor() { this.$ = "TooLarge"; } }
24
+ const $N$TooLarge = new $C$TooLarge();
25
+ class $C$NotString { constructor() { this.$ = "NotString"; } }
26
+ const $N$NotString = new $C$NotString();
27
+ class $C$AtIndex$i { constructor(a0) { this.$ = "AtIndex"; this.i = a0; } }
28
+ class $C$BoundAt$i$key { constructor(a0, a1) { this.$ = "BoundAt"; this.i = a0; this.key = a1; } }
29
+ class $C$NotTrue { constructor() { this.$ = "NotTrue"; } }
30
+ const $N$NotTrue = new $C$NotTrue();
31
+ class $C$NotOneOf { constructor() { this.$ = "NotOneOf"; } }
32
+ const $N$NotOneOf = new $C$NotOneOf();
33
+ class $C$TwoVariants { constructor() { this.$ = "TwoVariants"; } }
34
+ const $N$TwoVariants = new $C$TwoVariants();
35
+ class $C$AtKey$key { constructor(a0) { this.$ = "AtKey"; this.key = a0; } }
36
+ class $C$UnknownKey { constructor() { this.$ = "UnknownKey"; } }
37
+ const $N$UnknownKey = new $C$UnknownKey();
38
+ class $C$NotObject { constructor() { this.$ = "NotObject"; } }
39
+ const $N$NotObject = new $C$NotObject();
40
+ class $C$RNil { constructor() { this.$ = "RNil"; } }
41
+ const $N$RNil = new $C$RNil();
42
+ class $C$CountNotIn$lo$hi { constructor(a0, a1) { this.$ = "CountNotIn"; this.lo = a0; this.hi = a1; } }
43
+ class $C$RCons$head$tail { constructor(a0, a1) { this.$ = "RCons"; this.head = a0; this.tail = a1; } }
44
+ class $C$NotList { constructor() { this.$ = "NotList"; } }
45
+ const $N$NotList = new $C$NotList();
46
+ class $C$NotNat { constructor() { this.$ = "NotNat"; } }
47
+ const $N$NotNat = new $C$NotNat();
48
+ class $C$NotBool { constructor() { this.$ = "NotBool"; } }
49
+ const $N$NotBool = new $C$NotBool();
50
+ class $C$NoVariant { constructor() { this.$ = "NoVariant"; } }
51
+ const $N$NoVariant = new $C$NoVariant();
52
+ class $C$STEnd { constructor() { this.$ = "STEnd"; } }
53
+ const $N$STEnd = new $C$STEnd();
54
+ class $C$STuple$s$rest { constructor(a0, a1) { this.$ = "STuple"; this.s = a0; this.rest = a1; } }
55
+ class $C$RNum$n { constructor(a0) { this.$ = "RNum"; this.n = a0; } }
56
+ class $C$RStr$s { constructor(a0) { this.$ = "RStr"; this.s = a0; } }
57
+ class $C$RNull { constructor() { this.$ = "RNull"; } }
58
+ const $N$RNull = new $C$RNull();
59
+ class $C$SList$elem { constructor(a0) { this.$ = "SList"; this.elem = a0; } }
60
+ class $C$REnd { constructor() { this.$ = "REnd"; } }
61
+ const $N$REnd = new $C$REnd();
62
+ class $C$RBool$b { constructor(a0) { this.$ = "RBool"; this.b = a0; } }
63
+ class $C$Both$a$b { constructor(a0, a1) { this.$ = "Both"; this.a = a0; this.b = a1; } }
64
+ class $C$Inl$value { constructor(a0) { this.$ = "Inl"; this.value = a0; } }
65
+ class $C$Inr$value { constructor(a0) { this.$ = "Inr"; this.value = a0; } }
66
+ class $C$Unit { constructor() { this.$ = "Unit"; } }
67
+ const $N$Unit = new $C$Unit();
68
+ class $C$TooShort { constructor() { this.$ = "TooShort"; } }
69
+ const $N$TooShort = new $C$TooShort();
70
+ class $C$TooLong { constructor() { this.$ = "TooLong"; } }
71
+ const $N$TooLong = new $C$TooLong();
72
+ class $C$EQ { constructor() { this.$ = "EQ"; } }
73
+ const $N$EQ = new $C$EQ();
74
+ class $C$LT { constructor() { this.$ = "LT"; } }
75
+ const $N$LT = new $C$LT();
76
+ class $C$GT { constructor() { this.$ = "GT"; } }
77
+ const $N$GT = new $C$GT();
78
+ // bend-emit: fold the pending constructors of a looped def, innermost last.
79
+ function $unwind$(s, r) {
80
+ for (let i = s.length; i > 0; i -= 2) {
81
+ const o = s[i - 2];
82
+ o[s[i - 1]] = r;
83
+ r = o;
84
+ }
85
+ return r;
86
+ }
87
+ function word_to_u32(w) {
88
+ let x = 0;
89
+ for (let i = 0; w.$ === "WCon"; i++) {
90
+ x |= Number(w.head) << i;
91
+ w = w.tail;
92
+ }
93
+ return x >>> 0;
94
+ }
95
+
96
+ function u32_to_word(x) {
97
+ let w = $N$WNil;
98
+ for (let i = 31; i >= 0; i--) {
99
+ w = new $C$WCon$head$tail(((x >>> i) & 1) === 1, w);
100
+ }
101
+ return w;
102
+ }
103
+
104
+ function cmp_new(a, b) {
105
+ return {$: a < b ? "LT"
106
+ : a === b ? "EQ" : "GT"};
107
+ }
108
+
109
+ function nat_divmod(a, b) {
110
+ return b === 0 ? new $C$Tuple$fst$snd(0, a)
111
+ : new $C$Tuple$fst$snd(Math.trunc(a / b), a % b);
112
+ }
113
+
114
+ function nat_chk(n) {
115
+ if (n > 281474976710655) {
116
+ throw "bend: a Nat past the largest immediate 2^48-1";
117
+ }
118
+ return n;
119
+ }
120
+
121
+ function nat_host(n) {
122
+ const int = typeof n === "bigint" || Number.isInteger(n);
123
+ if (int && n >= 0 && n <= 2 ** 53) {
124
+ return Number(n);
125
+ }
126
+ return { [Symbol.toPrimitive]() { throw "bend: a Nat past the largest immediate 2^48-1"; } };
127
+ }
128
+
129
+ function f32_show(x) {
130
+ if (x !== x) {
131
+ return "nan";
132
+ }
133
+ if (!Number.isFinite(x) || Object.is(x, -0)) {
134
+ return x < 0 ? "-inf"
135
+ : x === 0 ? "-0" : "inf";
136
+ }
137
+ let s = "x";
138
+ for (let p = 1; p <= 9 && f32_round(s) !== x; p += 1) {
139
+ s = String(Number(x.toExponential(p - 1)));
140
+ }
141
+ return s;
142
+ }
143
+
144
+ function f32_bits(x) {
145
+ return new Uint32Array(new Float32Array([x]).buffer)[0];
146
+ }
147
+
148
+ function f32_from_bits(u) {
149
+ return new Float32Array(new Uint32Array([u]).buffer)[0];
150
+ }
151
+
152
+ function f32_read(s) {
153
+ const re = /^\s*[+-]?((\d+\.?\d*|\.\d+)(e[+-]?\d+)?|inf(inity)?|nan)$/i;
154
+ const v = f32_round(s.replace(/inf\w*/i, "Infinity"));
155
+ return re.test(s) ? new $C$Some$value(v) : $N$None;
156
+ }
157
+
158
+ const f32_round = function f32_round(s) {
159
+ const d = Number(s);
160
+ const a = Math.abs(d);
161
+ const f = Math.fround(a);
162
+ const g = 2 * a - Math.min(f, 2 ** 128);
163
+ if (g === f || Math.fround(g) !== g || g === Infinity) {
164
+ return Math.sign(d) * f;
165
+ }
166
+ let k = 0;
167
+ while (a * 2 ** k % 1 !== 0) {
168
+ k += 1;
169
+ }
170
+ const [, i, r, e] = /(\d*)\.?(\d*)(?:e([+-]?\d+))?$/i.exec(s);
171
+ const n = Number(e ?? 0) - r.length;
172
+ const x = BigInt(i + r) * 2n ** BigInt(k) * 10n ** BigInt(Math.max(n, 0));
173
+ const y = BigInt(a * 2 ** k) * 10n ** BigInt(Math.max(-n, 0));
174
+ return Math.sign(d) * (x === y || x > y !== g > f ? f : g);
175
+ };
176
+
177
+ function char_new(code) {
178
+ if (code > 0x10FFFF || (code >= 0xD800 && code <= 0xDFFF)) {
179
+ throw "bend: " + code + " is not a Unicode scalar value";
180
+ }
181
+ return String.fromCodePoint(code);
182
+ }
183
+
184
+ // Array
185
+ // =====
186
+
187
+ function array_new(d, v) {
188
+ if (d > 31) {
189
+ throw "bend: an array past the deepest block class 31";
190
+ }
191
+ return Array(2 ** d).fill(v);
192
+ }
193
+
194
+ function array_node(a, b) {
195
+ if (a.length !== b.length) {
196
+ throw "bend: runtime fail-stop";
197
+ }
198
+ return a.concat(b);
199
+ }
200
+
201
+ function array_rmw(a, i, f) {
202
+ const at = i % a.length;
203
+ const old = a[at];
204
+ a[at] = f(old);
205
+ return new $C$Tuple$fst$snd(a, old);
206
+ }
207
+
208
+ // Run
209
+ // ===
210
+
211
+ function run_tail(f, x) {
212
+ return new $C$$JMP$f$x(f.j?.f === f ? f.j : f, [x]);
213
+ }
214
+
215
+ function run_clo(j) {
216
+ const f = (x) => run_loop(j(x));
217
+ f.j = j;
218
+ j.f = f;
219
+ return f;
220
+ }
221
+
222
+ function run_loop(r) {
223
+ while (r !== null && typeof r === "object" && r.$ === "$JMP") {
224
+ r = r.f(...r.x);
225
+ }
226
+ return r;
227
+ }
228
+
229
+ function run_lib(f, n) {
230
+ return (...a) => a.length < n ? run_lib((...b) => f(...a, ...b), n - a.length)
231
+ : f(...a);
232
+ }
233
+
234
+ // Effect
235
+ // ======
236
+
237
+ const $0eff = Object.create(null);
238
+
239
+ function io_eff(k, run, need) {
240
+ if (k in $0eff) {
241
+ throw new Error("bend: two effects register " + k);
242
+ }
243
+ $0eff[k] = { run, need };
244
+ }
245
+ // Program
246
+ // =======
247
+
248
+ function $pick_raw$(_b_0, _x_0, _y_0) {
249
+ if (_b_0) {
250
+ return _x_0;
251
+ } else {
252
+ return _y_0;
253
+ }
254
+ }
255
+
256
+ function $lookup$(_name_0, _r_0) {
257
+ if (_r_0.$ === "RKey") {
258
+ const _k_0 = _r_0["key"];
259
+ const _v_0 = _r_0["val"];
260
+ const _rest_0 = _r_0["rest"];
261
+ return $pick_raw$(($String$eq$(_k_0, _name_0)), _v_0, ($lookup$(_name_0, _rest_0)));
262
+ } else {
263
+ return $N$RMissing;
264
+ }
265
+ }
266
+
267
+ function $pick_bool$(_b_0, _x_0, _y_0) {
268
+ if (_b_0) {
269
+ return _x_0;
270
+ } else {
271
+ return _y_0;
272
+ }
273
+ }
274
+
275
+ function $is_rnil$(_r_0) {
276
+ if (_r_0.$ === "RNil") {
277
+ return true;
278
+ } else {
279
+ return false;
280
+ }
281
+ }
282
+
283
+ function $is_missing$(_v_0) {
284
+ if (_v_0.$ === "RMissing") {
285
+ return true;
286
+ } else {
287
+ return false;
288
+ }
289
+ }
290
+
291
+ function $in_names$(_x_0, _names_0) {
292
+ if (_names_0.$ === "Nil") {
293
+ return false;
294
+ } else {
295
+ const _n_0 = _names_0["head"];
296
+ const _t_0 = _names_0["tail"];
297
+ const _x_1 = ($String$eq$(_x_0, _n_0));
298
+ const _x_2 = ($in_names$(_x_0, _t_0));
299
+ return (_x_1 || _x_2);
300
+ }
301
+ }
302
+
303
+ function $none_present$(_s_0, _r_0) {
304
+ if (_s_0.$ === "SVariant") {
305
+ const _n_0 = _s_0["name"];
306
+ const _rest_0 = _s_0["rest"];
307
+ return $Bool$and$(($is_missing$(($lookup$(_n_0, _r_0)))), ($none_present$(_rest_0, _r_0)));
308
+ } else {
309
+ return true;
310
+ }
311
+ }
312
+
313
+ function $key_names$(_s_0) {
314
+ const $stk = [];
315
+ for (;;) {
316
+ if (_s_0.$ === "SField") {
317
+ const _n_0 = _s_0["name"];
318
+ const _rest_0 = _s_0["rest"];
319
+ $stk.push(new $C$Con$head$tail(_n_0, null), "tail");
320
+ { const $a0 = _rest_0; _s_0 = $a0; continue; }
321
+ } else if (_s_0.$ === "SVariant") {
322
+ const _n_1 = _s_0["name"];
323
+ const _rest_1 = _s_0["rest"];
324
+ $stk.push(new $C$Con$head$tail(_n_1, null), "tail");
325
+ { const $a0 = _rest_1; _s_0 = $a0; continue; }
326
+ } else {
327
+ { const $v = $N$Nil; return $unwind$($stk, $v); }
328
+ }
329
+ }
330
+ }
331
+
332
+ function $no_extra$(_ns_0, _r_0) {
333
+ if (_r_0.$ === "RKey") {
334
+ const _k_0 = _r_0["key"];
335
+ const _o_0 = _r_0["rest"];
336
+ return $Bool$and$(($in_names$(_k_0, _ns_0)), ($no_extra$(_ns_0, _o_0)));
337
+ } else {
338
+ return true;
339
+ }
340
+ }
341
+
342
+ function $drop_key$(_k_0, _r_0) {
343
+ if (_r_0.$ === "RKey") {
344
+ const _j_0 = _r_0["key"];
345
+ const _v_0 = _r_0["val"];
346
+ const _o_0 = _r_0["rest"];
347
+ return $pick_raw$(($String$eq$(_j_0, _k_0)), _o_0, new $C$RKey$key$val$rest(_j_0, _v_0, ($drop_key$(_k_0, _o_0))));
348
+ } else {
349
+ return _r_0;
350
+ }
351
+ }
352
+
353
+ function $is_str$(_n_0, _v_0) {
354
+ if (_v_0.$ === "RStr") {
355
+ const _x_0 = _v_0["s"];
356
+ return $String$eq$(_x_0, _n_0);
357
+ } else {
358
+ return false;
359
+ }
360
+ }
361
+
362
+ function $is_tag$(_k_0, _n_0, _r_0) {
363
+ return $is_str$(_n_0, ($lookup$(_k_0, _r_0)));
364
+ }
365
+
366
+ function $in_err$(_b_0, _w_0) {
367
+ if (_b_0) {
368
+ return $N$None;
369
+ } else {
370
+ return new $C$Some$value(new $C$Err$path$why($N$Nil, _w_0));
371
+ }
372
+ }
373
+
374
+ function $str_len_ok$(_lo_0, _hi_0, _x_0) {
375
+ return $Bool$and$(($Nat$is_le$(_lo_0, [..._x_0].length)), ($Nat$is_le$([..._x_0].length, _hi_0)));
376
+ }
377
+
378
+ function $num_ok$(_lo_0, _hi_0, _n_0) {
379
+ return $Bool$and$(($Nat$is_le$(_lo_0, _n_0)), ($Nat$is_le$(_n_0, _hi_0)));
380
+ }
381
+
382
+ function $len_ok$(_lo_0, _hi_0, _r_0) {
383
+ if (_r_0.$ === "RStr") {
384
+ const _x_0 = _r_0["s"];
385
+ return $str_len_ok$(_lo_0, _hi_0, _x_0);
386
+ } else {
387
+ return false;
388
+ }
389
+ }
390
+
391
+ function $str_len_in$(_lo_0, _hi_0, _r_0) {
392
+ if (_r_0.$ === "RStr") {
393
+ const _x_0 = _r_0["s"];
394
+ return $in_err$(($str_len_ok$(_lo_0, _hi_0, _x_0)), new $C$LengthNotIn$lo$hi(_lo_0, _hi_0));
395
+ } else {
396
+ return $N$None;
397
+ }
398
+ }
399
+
400
+ function $nat_in$(_lo_0, _hi_0, _r_0) {
401
+ if (_r_0.$ === "RNum") {
402
+ const _n_0 = _r_0["n"];
403
+ return $in_err$(($num_ok$(_lo_0, _hi_0, _n_0)), new $C$NotIn$lo$hi(_lo_0, _hi_0));
404
+ } else {
405
+ return $N$None;
406
+ }
407
+ }
408
+
409
+ function $is_bool$(_r_0) {
410
+ if (_r_0.$ === "RBool") {
411
+ return true;
412
+ } else {
413
+ return false;
414
+ }
415
+ }
416
+
417
+ function $raw_list$($0) {
418
+ for (;;) {
419
+ {
420
+ const _r_0 = $0;
421
+ if (_r_0.$ === "RNil") {
422
+ return true;
423
+ } else if (_r_0.$ === "RCons") {
424
+ const _t_0 = _r_0["tail"];
425
+ $0 = _t_0;
426
+ continue;
427
+ } else {
428
+ return false;
429
+ }
430
+ }
431
+ }
432
+ }
433
+
434
+ function $raw_len$(_r_0) {
435
+ if (_r_0.$ === "RCons") {
436
+ const _t_0 = _r_0["tail"];
437
+ return nat_chk(($raw_len$(_t_0)) + 1);
438
+ } else {
439
+ return 0;
440
+ }
441
+ }
442
+
443
+ function $count_ok$(_lo_0, _hi_0, _r_0) {
444
+ return $Bool$and$(($Nat$is_le$(_lo_0, ($raw_len$(_r_0)))), ($Nat$is_le$(($raw_len$(_r_0)), _hi_0)));
445
+ }
446
+
447
+ function $list_len_ok$(_lo_0, _hi_0, _r_0) {
448
+ return $Bool$and$(($raw_list$(_r_0)), ($count_ok$(_lo_0, _hi_0, _r_0)));
449
+ }
450
+
451
+ function $has_key$(_k_0, _r_0) {
452
+ if (_r_0.$ === "RKey") {
453
+ const _j_0 = _r_0["key"];
454
+ const _o_0 = _r_0["rest"];
455
+ const _x_0 = ($String$eq$(_k_0, _j_0));
456
+ const _x_1 = ($has_key$(_k_0, _o_0));
457
+ return (_x_0 || _x_1);
458
+ } else {
459
+ return false;
460
+ }
461
+ }
462
+
463
+ function $key_once_at$(_r_0, _b_0, _name_0) {
464
+ if (_r_0.$ === "RKey") {
465
+ const _k_0 = _r_0["key"];
466
+ const _o_0 = _r_0["rest"];
467
+ const _x_0 = ($String$eq$(_k_0, _name_0));
468
+ return $Bool$and$(($Bool$not$(($Bool$and$(_b_0, ($String$eq$(_k_0, _name_0)))))), ($key_once_at$(_o_0, (_b_0 || _x_0), _name_0)));
469
+ } else {
470
+ return true;
471
+ }
472
+ }
473
+
474
+ function $key_once$(_name_0, _r_0) {
475
+ return $key_once_at$(_r_0, false, _name_0);
476
+ }
477
+
478
+ function $key_err$(_b_0, _name_0) {
479
+ if (_b_0) {
480
+ return $N$None;
481
+ } else {
482
+ return new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(new $C$AtField$skip$name(0, _name_0), $N$Nil), new $C$RepeatedKey$key(_name_0)));
483
+ }
484
+ }
485
+
486
+ function $here$(_w_0) {
487
+ return new $C$Some$value(new $C$Err$path$why($N$Nil, _w_0));
488
+ }
489
+
490
+ function $under$(_st_0, _m_0) {
491
+ if (_m_0.$ === "None") {
492
+ return $N$None;
493
+ } else {
494
+ const _t_0 = _m_0["value"];
495
+ const _p_0 = _t_0["path"];
496
+ const _w_0 = _t_0["why"];
497
+ return new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(_st_0, _p_0), _w_0));
498
+ }
499
+ }
500
+
501
+ function $len_err$(_lo_0, _hi_0, _r_0) {
502
+ if (_r_0.$ === "RStr") {
503
+ const _x_0 = _r_0["s"];
504
+ return $in_err$(($str_len_ok$(_lo_0, _hi_0, _x_0)), new $C$LengthNotIn$lo$hi(_lo_0, _hi_0));
505
+ } else if (_r_0.$ === "RMissing") {
506
+ return $here$($N$Missing);
507
+ } else if (_r_0.$ === "RTooBig") {
508
+ return $here$($N$TooLarge);
509
+ } else {
510
+ return $here$($N$NotString);
511
+ }
512
+ }
513
+
514
+ function $later_l_path$(_p_0) {
515
+ if (_p_0.$ === "Con") {
516
+ const _t_0 = _p_0["head"];
517
+ if (_t_0.$ === "AtIndex") {
518
+ const _j_0 = _t_0["i"];
519
+ const _q_0 = _p_0["tail"];
520
+ return new $C$Con$head$tail(new $C$AtIndex$i(nat_chk(_j_0 + 1)), _q_0);
521
+ } else {
522
+ const _q_1 = _p_0["tail"];
523
+ return new $C$Con$head$tail(_t_0, _q_1);
524
+ }
525
+ } else {
526
+ return _p_0;
527
+ }
528
+ }
529
+
530
+ function $later_l$(_m_0) {
531
+ if (_m_0.$ === "None") {
532
+ return $N$None;
533
+ } else {
534
+ const _t_0 = _m_0["value"];
535
+ const _p_0 = _t_0["path"];
536
+ const _w_0 = _t_0["why"];
537
+ return new $C$Some$value(new $C$Err$path$why(($later_l_path$(_p_0)), _w_0));
538
+ }
539
+ }
540
+
541
+ function $later_i_path$(_p_0) {
542
+ if (_p_0.$ === "Con") {
543
+ const _t_0 = _p_0["head"];
544
+ if (_t_0.$ === "AtIndex") {
545
+ const _j_0 = _t_0["i"];
546
+ const _q_0 = _p_0["tail"];
547
+ return new $C$Con$head$tail(new $C$AtIndex$i(nat_chk(_j_0 + 1)), _q_0);
548
+ } else if (_t_0.$ === "BoundAt") {
549
+ const _j_1 = _t_0["i"];
550
+ const _key_0 = _t_0["key"];
551
+ const _q_1 = _p_0["tail"];
552
+ return new $C$Con$head$tail(new $C$BoundAt$i$key(nat_chk(_j_1 + 1), _key_0), _q_1);
553
+ } else {
554
+ const _q_2 = _p_0["tail"];
555
+ return new $C$Con$head$tail(_t_0, _q_2);
556
+ }
557
+ } else {
558
+ return _p_0;
559
+ }
560
+ }
561
+
562
+ function $later_i$(_m_0) {
563
+ if (_m_0.$ === "None") {
564
+ return $N$None;
565
+ } else {
566
+ const _t_0 = _m_0["value"];
567
+ const _p_0 = _t_0["path"];
568
+ const _w_0 = _t_0["why"];
569
+ return new $C$Some$value(new $C$Err$path$why(($later_i_path$(_p_0)), _w_0));
570
+ }
571
+ }
572
+
573
+ function $later_f_path$(_p_0) {
574
+ if (_p_0.$ === "Con") {
575
+ const _t_0 = _p_0["head"];
576
+ if (_t_0.$ === "AtField") {
577
+ const _k_0 = _t_0["skip"];
578
+ const _n_0 = _t_0["name"];
579
+ const _q_0 = _p_0["tail"];
580
+ return new $C$Con$head$tail(new $C$AtField$skip$name(nat_chk(_k_0 + 1), _n_0), _q_0);
581
+ } else {
582
+ const _q_1 = _p_0["tail"];
583
+ return new $C$Con$head$tail(_t_0, _q_1);
584
+ }
585
+ } else {
586
+ return _p_0;
587
+ }
588
+ }
589
+
590
+ function $later_f$(_m_0) {
591
+ if (_m_0.$ === "None") {
592
+ return $N$None;
593
+ } else {
594
+ const _t_0 = _m_0["value"];
595
+ const _p_0 = _t_0["path"];
596
+ const _w_0 = _t_0["why"];
597
+ return new $C$Some$value(new $C$Err$path$why(($later_f_path$(_p_0)), _w_0));
598
+ }
599
+ }
600
+
601
+ function $first$(_m_0, _n_0) {
602
+ if (_m_0.$ === "None") {
603
+ return _n_0;
604
+ } else {
605
+ const _e_0 = _m_0["value"];
606
+ return new $C$Some$value(_e_0);
607
+ }
608
+ }
609
+
610
+ function $missing_or$(_r_0, _w_0) {
611
+ if (_r_0.$ === "RMissing") {
612
+ return $N$Missing;
613
+ } else if (_r_0.$ === "RTooBig") {
614
+ return $N$TooLarge;
615
+ } else {
616
+ return _w_0;
617
+ }
618
+ }
619
+
620
+ function $pick_err$(_b_0, _x_0, _y_0) {
621
+ if (_b_0) {
622
+ return _x_0;
623
+ } else {
624
+ return _y_0;
625
+ }
626
+ }
627
+
628
+ function $true_err$(_b_0) {
629
+ if (_b_0) {
630
+ return $N$None;
631
+ } else {
632
+ return $here$($N$NotTrue);
633
+ }
634
+ }
635
+
636
+ function $enum_err$(_b_0) {
637
+ if (_b_0) {
638
+ return $N$None;
639
+ } else {
640
+ return $here$($N$NotOneOf);
641
+ }
642
+ }
643
+
644
+ function $dup_err$(_s_0, _r_0) {
645
+ if (_s_0.$ === "SVariant") {
646
+ const _n_0 = _s_0["name"];
647
+ const _rest_0 = _s_0["rest"];
648
+ return $pick_err$(($is_missing$(($lookup$(_n_0, _r_0)))), ($later_f$(($dup_err$(_rest_0, _r_0)))), new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(new $C$AtField$skip$name(0, _n_0), $N$Nil), $N$TwoVariants)));
649
+ } else {
650
+ return $N$None;
651
+ }
652
+ }
653
+
654
+ function $extra_err$(_ns_0, _r_0) {
655
+ if (_r_0.$ === "RKey") {
656
+ const _k_0 = _r_0["key"];
657
+ const _o_0 = _r_0["rest"];
658
+ return $pick_err$(($in_names$(_k_0, _ns_0)), ($extra_err$(_ns_0, _o_0)), new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(new $C$AtKey$key(_k_0), $N$Nil), $N$UnknownKey)));
659
+ } else {
660
+ return $N$None;
661
+ }
662
+ }
663
+
664
+ function $tag_err$(_k_0, _r_0) {
665
+ if (_r_0.$ === "REnd") {
666
+ return new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(new $C$AtKey$key(_k_0), $N$Nil), $N$Missing));
667
+ } else if (_r_0.$ === "RKey") {
668
+ const _j_0 = _r_0["key"];
669
+ const _v_0 = _r_0["val"];
670
+ const _o_0 = _r_0["rest"];
671
+ return new $C$Some$value(new $C$Err$path$why(new $C$Con$head$tail(new $C$AtKey$key(_k_0), $N$Nil), ($missing_or$(($lookup$(_k_0, new $C$RKey$key$val$rest(_j_0, _v_0, _o_0))), $N$NotOneOf))));
672
+ } else {
673
+ return $here$(($missing_or$(_r_0, $N$NotObject)));
674
+ }
675
+ }
676
+
677
+ function $count_err$(_lo_0, _hi_0, _r_0) {
678
+ if (_r_0.$ === "RNil") {
679
+ return $in_err$(($list_len_ok$(_lo_0, _hi_0, $N$RNil)), new $C$CountNotIn$lo$hi(_lo_0, _hi_0));
680
+ } else if (_r_0.$ === "RCons") {
681
+ const _h_0 = _r_0["head"];
682
+ const _t_0 = _r_0["tail"];
683
+ return $in_err$(($list_len_ok$(_lo_0, _hi_0, new $C$RCons$head$tail(_h_0, _t_0))), new $C$CountNotIn$lo$hi(_lo_0, _hi_0));
684
+ } else {
685
+ return $here$(($missing_or$(_r_0, $N$NotList)));
686
+ }
687
+ }
688
+
689
+ function $guard$(_b_0, _m_0) {
690
+ if (_b_0) {
691
+ return _m_0;
692
+ } else {
693
+ return $N$None;
694
+ }
695
+ }
696
+
697
+ function $nat_in_defect$(_lo_0, _hi_0, _r_0, _p_0) {
698
+ if (_r_0.$ === "RNum") {
699
+ const _n_0 = _r_0["n"];
700
+ if (_p_0.$ === "Nil") {
701
+ return $guard$(($Bool$not$(($num_ok$(_lo_0, _hi_0, _n_0)))), new $C$Some$value(new $C$NotIn$lo$hi(_lo_0, _hi_0)));
702
+ } else {
703
+ return $N$None;
704
+ }
705
+ } else {
706
+ if (_p_0.$ === "Nil") {
707
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotNat)));
708
+ } else {
709
+ return $N$None;
710
+ }
711
+ }
712
+ }
713
+
714
+ function $bool_defect$(_r_0, _p_0) {
715
+ if (_r_0.$ === "RBool") {
716
+ if (_p_0.$ === "Nil") {
717
+ return $N$None;
718
+ } else {
719
+ return $N$None;
720
+ }
721
+ } else {
722
+ if (_p_0.$ === "Nil") {
723
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotBool)));
724
+ } else {
725
+ return $N$None;
726
+ }
727
+ }
728
+ }
729
+
730
+ function $no_rule$(_tag_0, _r_0) {
731
+ return $N$None;
732
+ }
733
+
734
+ function $first_why$(_m_0, _n_0) {
735
+ if (_m_0.$ === "None") {
736
+ return _n_0;
737
+ } else {
738
+ const _w_0 = _m_0["value"];
739
+ return new $C$Some$value(_w_0);
740
+ }
741
+ }
742
+
743
+ function $step_eq$(_x_0, _y_0) {
744
+ if (_x_0.$ === "AtIndex") {
745
+ const _i_0 = _x_0["i"];
746
+ if (_y_0.$ === "AtIndex") {
747
+ const _j_0 = _y_0["i"];
748
+ return $Nat$is_eq$(_i_0, _j_0);
749
+ } else {
750
+ return false;
751
+ }
752
+ } else if (_x_0.$ === "AtField") {
753
+ const _a_0 = _x_0["skip"];
754
+ const _n_0 = _x_0["name"];
755
+ if (_y_0.$ === "AtField") {
756
+ const _b_0 = _y_0["skip"];
757
+ const _m_0 = _y_0["name"];
758
+ return $Bool$and$(($Nat$is_eq$(_a_0, _b_0)), ($String$eq$(_n_0, _m_0)));
759
+ } else {
760
+ return false;
761
+ }
762
+ } else if (_x_0.$ === "BoundAt") {
763
+ const _i_1 = _x_0["i"];
764
+ const _k_0 = _x_0["key"];
765
+ if (_y_0.$ === "BoundAt") {
766
+ const _j_1 = _y_0["i"];
767
+ const _m_1 = _y_0["key"];
768
+ return $Bool$and$(($Nat$is_eq$(_i_1, _j_1)), ($String$eq$(_k_0, _m_1)));
769
+ } else {
770
+ return false;
771
+ }
772
+ } else {
773
+ const _k_1 = _x_0["key"];
774
+ if (_y_0.$ === "AtKey") {
775
+ const _m_2 = _y_0["key"];
776
+ return $String$eq$(_k_1, _m_2);
777
+ } else {
778
+ return false;
779
+ }
780
+ }
781
+ }
782
+
783
+ function $path_eq$(_x_0, _y_0) {
784
+ if (_x_0.$ === "Nil") {
785
+ if (_y_0.$ === "Nil") {
786
+ return true;
787
+ } else {
788
+ return false;
789
+ }
790
+ } else {
791
+ const _a_0 = _x_0["head"];
792
+ const _at_0 = _x_0["tail"];
793
+ if (_y_0.$ === "Con") {
794
+ const _b_0 = _y_0["head"];
795
+ const _bt_0 = _y_0["tail"];
796
+ return $Bool$and$(($step_eq$(_a_0, _b_0)), ($path_eq$(_at_0, _bt_0)));
797
+ } else {
798
+ return false;
799
+ }
800
+ }
801
+ }
802
+
803
+ function $rule_defect$(_m_0, _p_0) {
804
+ if (_m_0.$ === "Some") {
805
+ const _t_0 = _m_0["value"];
806
+ const _q_0 = _t_0["path"];
807
+ const _w_0 = _t_0["why"];
808
+ return $guard$(($path_eq$(_q_0, _p_0)), new $C$Some$value(_w_0));
809
+ } else {
810
+ return $N$None;
811
+ }
812
+ }
813
+
814
+ function $not_list$(_x_0, _p_0) {
815
+ if (_p_0.$ === "Nil") {
816
+ return new $C$Some$value(($missing_or$(_x_0, $N$NotList)));
817
+ } else {
818
+ return $N$None;
819
+ }
820
+ }
821
+
822
+ function $not_object$(_x_0, _p_0) {
823
+ if (_p_0.$ === "Nil") {
824
+ return new $C$Some$value(($missing_or$(_x_0, $N$NotObject)));
825
+ } else {
826
+ return $N$None;
827
+ }
828
+ }
829
+
830
+ function $nat_defect$(_r_0, _p_0) {
831
+ if (_r_0.$ === "RNum") {
832
+ if (_p_0.$ === "Nil") {
833
+ return $N$None;
834
+ } else {
835
+ return $N$None;
836
+ }
837
+ } else {
838
+ if (_p_0.$ === "Nil") {
839
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotNat)));
840
+ } else {
841
+ return $N$None;
842
+ }
843
+ }
844
+ }
845
+
846
+ function $str_defect$(_r_0, _p_0) {
847
+ if (_r_0.$ === "RStr") {
848
+ if (_p_0.$ === "Nil") {
849
+ return $N$None;
850
+ } else {
851
+ return $N$None;
852
+ }
853
+ } else {
854
+ if (_p_0.$ === "Nil") {
855
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotString)));
856
+ } else {
857
+ return $N$None;
858
+ }
859
+ }
860
+ }
861
+
862
+ function $pick_why$(_b_0, _x_0, _y_0) {
863
+ if (_b_0) {
864
+ return _x_0;
865
+ } else {
866
+ return _y_0;
867
+ }
868
+ }
869
+
870
+ function $true_defect$(_r_0, _p_0) {
871
+ if (_r_0.$ === "RBool") {
872
+ const _t_0 = _r_0["b"];
873
+ if (_t_0) {
874
+ if (_p_0.$ === "Nil") {
875
+ return $N$None;
876
+ } else {
877
+ return $N$None;
878
+ }
879
+ } else {
880
+ if (_p_0.$ === "Nil") {
881
+ return new $C$Some$value($N$NotTrue);
882
+ } else {
883
+ return $N$None;
884
+ }
885
+ }
886
+ } else {
887
+ if (_p_0.$ === "Nil") {
888
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotTrue)));
889
+ } else {
890
+ return $N$None;
891
+ }
892
+ }
893
+ }
894
+
895
+ function $enum_defect$(_names_0, _r_0, _p_0) {
896
+ if (_r_0.$ === "RStr") {
897
+ const _x_0 = _r_0["s"];
898
+ if (_p_0.$ === "Nil") {
899
+ return $guard$(($Bool$not$(($in_names$(_x_0, _names_0)))), new $C$Some$value($N$NotOneOf));
900
+ } else {
901
+ return $N$None;
902
+ }
903
+ } else {
904
+ if (_p_0.$ === "Nil") {
905
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotOneOf)));
906
+ } else {
907
+ return $N$None;
908
+ }
909
+ }
910
+ }
911
+
912
+ function $no_variant$(_p_0) {
913
+ if (_p_0.$ === "Nil") {
914
+ return new $C$Some$value($N$NoVariant);
915
+ } else {
916
+ return $N$None;
917
+ }
918
+ }
919
+
920
+ function $dup_defect$(_s_0, _r_0, _p_0) {
921
+ if (_s_0.$ === "SVariant") {
922
+ const _n2_0 = _s_0["name"];
923
+ const _rr_0 = _s_0["rest"];
924
+ if (_p_0.$ === "Con") {
925
+ const _t_0 = _p_0["head"];
926
+ if (_t_0.$ === "AtField") {
927
+ const _t_1 = _t_0["skip"];
928
+ if (_t_1 === 0) {
929
+ const _m_0 = _t_0["name"];
930
+ const _t_2 = _p_0["tail"];
931
+ if (_t_2.$ === "Nil") {
932
+ return $guard$(($Bool$and$(($String$eq$(_m_0, _n2_0)), ($Bool$not$(($is_missing$(($lookup$(_n2_0, _r_0)))))))), new $C$Some$value($N$TwoVariants));
933
+ } else {
934
+ return $N$None;
935
+ }
936
+ } else {
937
+ const _j_0 = (_t_1 - 1);
938
+ const _m_1 = _t_0["name"];
939
+ const _41_0 = _p_0["tail"];
940
+ return $guard$(($is_missing$(($lookup$(_n2_0, _r_0)))), ($dup_defect$(_rr_0, _r_0, new $C$Con$head$tail(new $C$AtField$skip$name(_j_0, _m_1), _41_0))));
941
+ }
942
+ } else {
943
+ return $N$None;
944
+ }
945
+ } else {
946
+ return $N$None;
947
+ }
948
+ } else {
949
+ return $N$None;
950
+ }
951
+ }
952
+
953
+ function $at_end$(_w_0, _p_0) {
954
+ if (_p_0.$ === "Nil") {
955
+ return new $C$Some$value(_w_0);
956
+ } else {
957
+ return $N$None;
958
+ }
959
+ }
960
+
961
+ function $extra_defect$(_ns_0, _r_0, _p_0) {
962
+ if (_p_0.$ === "Con") {
963
+ const _t_0 = _p_0["head"];
964
+ if (_t_0.$ === "AtKey") {
965
+ const _k_0 = _t_0["key"];
966
+ const _t_1 = _p_0["tail"];
967
+ if (_t_1.$ === "Nil") {
968
+ return $guard$(($Bool$and$(($has_key$(_k_0, _r_0)), ($Bool$not$(($in_names$(_k_0, _ns_0)))))), new $C$Some$value($N$UnknownKey));
969
+ } else {
970
+ return $N$None;
971
+ }
972
+ } else {
973
+ return $N$None;
974
+ }
975
+ } else {
976
+ return $N$None;
977
+ }
978
+ }
979
+
980
+ function $tag_defect$(_k_0, _r_0, _p_0) {
981
+ if (_r_0.$ === "REnd") {
982
+ if (_p_0.$ === "Con") {
983
+ const _t_0 = _p_0["head"];
984
+ if (_t_0.$ === "AtKey") {
985
+ const _j_0 = _t_0["key"];
986
+ const _t_1 = _p_0["tail"];
987
+ if (_t_1.$ === "Nil") {
988
+ return $guard$(($String$eq$(_j_0, _k_0)), new $C$Some$value($N$Missing));
989
+ } else {
990
+ return $N$None;
991
+ }
992
+ } else {
993
+ return $N$None;
994
+ }
995
+ } else {
996
+ return $N$None;
997
+ }
998
+ } else if (_r_0.$ === "RKey") {
999
+ const _j_1 = _r_0["key"];
1000
+ const _v_0 = _r_0["val"];
1001
+ const _o_0 = _r_0["rest"];
1002
+ if (_p_0.$ === "Con") {
1003
+ const _t_2 = _p_0["head"];
1004
+ if (_t_2.$ === "AtKey") {
1005
+ const _i_0 = _t_2["key"];
1006
+ const _t_3 = _p_0["tail"];
1007
+ if (_t_3.$ === "Nil") {
1008
+ return $guard$(($String$eq$(_i_0, _k_0)), new $C$Some$value(($missing_or$(($lookup$(_k_0, new $C$RKey$key$val$rest(_j_1, _v_0, _o_0))), $N$NotOneOf))));
1009
+ } else {
1010
+ return $N$None;
1011
+ }
1012
+ } else {
1013
+ return $N$None;
1014
+ }
1015
+ } else {
1016
+ return $N$None;
1017
+ }
1018
+ } else {
1019
+ if (_p_0.$ === "Nil") {
1020
+ return new $C$Some$value(($missing_or$(_r_0, $N$NotObject)));
1021
+ } else {
1022
+ return $N$None;
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ function $tag_key_defect$(_b_0, _k_0, _p_0) {
1028
+ if (!_b_0) {
1029
+ return $N$None;
1030
+ } else {
1031
+ if (_p_0.$ === "Con") {
1032
+ const _t_0 = _p_0["head"];
1033
+ if (_t_0.$ === "AtField") {
1034
+ const _t_1 = _t_0["skip"];
1035
+ if (_t_1 === 0) {
1036
+ const _j_0 = _t_0["name"];
1037
+ const _t_2 = _p_0["tail"];
1038
+ if (_t_2.$ === "Nil") {
1039
+ return $pick_why$(($String$eq$(_j_0, _k_0)), new $C$Some$value(new $C$RepeatedKey$key(_k_0)), $N$None);
1040
+ } else {
1041
+ return $N$None;
1042
+ }
1043
+ } else {
1044
+ return $N$None;
1045
+ }
1046
+ } else {
1047
+ return $N$None;
1048
+ }
1049
+ } else {
1050
+ return $N$None;
1051
+ }
1052
+ }
1053
+ }
1054
+
1055
+ function $check0$(_s_0, _r_0) {
1056
+ return $check$1260$(_s_0, _r_0, $N$None);
1057
+ }
1058
+
1059
+ function $conforms0$(_s_0, _r_0) {
1060
+ return $conforms$1260$(_s_0, _r_0, $N$None);
1061
+ }
1062
+
1063
+ function $is_chain$($0) {
1064
+ for (;;) {
1065
+ {
1066
+ const _s_0 = $0;
1067
+ if (_s_0.$ === "SVariant") {
1068
+ const _rest_0 = _s_0["rest"];
1069
+ $0 = _rest_0;
1070
+ continue;
1071
+ } else if (_s_0.$ === "SVEnd") {
1072
+ return true;
1073
+ } else {
1074
+ return false;
1075
+ }
1076
+ }
1077
+ }
1078
+ }
1079
+
1080
+ function $is_object$(_r_0) {
1081
+ if (_r_0.$ === "REnd") {
1082
+ return true;
1083
+ } else if (_r_0.$ === "RKey") {
1084
+ return true;
1085
+ } else {
1086
+ return false;
1087
+ }
1088
+ }
1089
+
1090
+ function $one_if_there$(_b_0) {
1091
+ if (_b_0) {
1092
+ return 0;
1093
+ } else {
1094
+ return 1;
1095
+ }
1096
+ }
1097
+
1098
+ function $count_present$(_s_0, _r_0) {
1099
+ if (_s_0.$ === "SVariant") {
1100
+ const _n_0 = _s_0["name"];
1101
+ const _rest_0 = _s_0["rest"];
1102
+ const _x_0 = ($one_if_there$(($is_missing$(($lookup$(_n_0, _r_0))))));
1103
+ const _x_1 = ($count_present$(_rest_0, _r_0));
1104
+ return nat_chk(_x_0 + _x_1);
1105
+ } else {
1106
+ return 0;
1107
+ }
1108
+ }
1109
+
1110
+ function $tuple_of$(_ss_0) {
1111
+ const $stk = [];
1112
+ for (;;) {
1113
+ if (_ss_0.$ === "Nil") {
1114
+ { const $v = $N$STEnd; return $unwind$($stk, $v); }
1115
+ } else {
1116
+ const _h_0 = _ss_0["head"];
1117
+ const _t_0 = _ss_0["tail"];
1118
+ $stk.push(new $C$STuple$s$rest(_h_0, null), "rest");
1119
+ { const $a0 = _t_0; _ss_0 = $a0; continue; }
1120
+ }
1121
+ }
1122
+ }
1123
+
1124
+ function $at_raw$($0, $1) {
1125
+ for (;;) {
1126
+ {
1127
+ const _r_0 = $0;
1128
+ const _i_0 = $1;
1129
+ if (_r_0.$ === "RCons") {
1130
+ const _h_0 = _r_0["head"];
1131
+ const _t_0 = _r_0["tail"];
1132
+ if (_i_0 === 0) {
1133
+ return _h_0;
1134
+ } else {
1135
+ const _j_0 = (_i_0 - 1);
1136
+ $0 = _t_0;
1137
+ $1 = _j_0;
1138
+ continue;
1139
+ }
1140
+ } else {
1141
+ return $N$RMissing;
1142
+ }
1143
+ }
1144
+ }
1145
+ }
1146
+
1147
+ function $count_unknown$(_ns_0, _r_0) {
1148
+ if (_r_0.$ === "RKey") {
1149
+ const _k_0 = _r_0["key"];
1150
+ const _o_0 = _r_0["rest"];
1151
+ const _x_0 = ($one_if_there$(($in_names$(_k_0, _ns_0))));
1152
+ const _x_1 = ($count_unknown$(_ns_0, _o_0));
1153
+ return nat_chk(_x_0 + _x_1);
1154
+ } else {
1155
+ return 0;
1156
+ }
1157
+ }
1158
+
1159
+ function $Meaning$($0) {
1160
+ for (;;) {
1161
+ {
1162
+ const _s_0 = $0;
1163
+ if (_s_0.$ === "SNat") {
1164
+ return null;
1165
+ } else if (_s_0.$ === "SNatIn") {
1166
+ return null;
1167
+ } else if (_s_0.$ === "SStr") {
1168
+ return null;
1169
+ } else if (_s_0.$ === "SStrLen") {
1170
+ const _s2_0 = _s_0["s"];
1171
+ $0 = _s2_0;
1172
+ continue;
1173
+ } else if (_s_0.$ === "SListLen") {
1174
+ const _s2_1 = _s_0["s"];
1175
+ $0 = _s2_1;
1176
+ continue;
1177
+ } else if (_s_0.$ === "SOpt") {
1178
+ return null;
1179
+ } else if (_s_0.$ === "SOptional") {
1180
+ return null;
1181
+ } else if (_s_0.$ === "SList") {
1182
+ return null;
1183
+ } else if (_s_0.$ === "SField") {
1184
+ return null;
1185
+ } else if (_s_0.$ === "SEnd") {
1186
+ return null;
1187
+ } else if (_s_0.$ === "SRule") {
1188
+ const _s2_2 = _s_0["s"];
1189
+ $0 = _s2_2;
1190
+ continue;
1191
+ } else if (_s_0.$ === "SStrict") {
1192
+ const _s2_3 = _s_0["s"];
1193
+ $0 = _s2_3;
1194
+ continue;
1195
+ } else if (_s_0.$ === "STagged") {
1196
+ return null;
1197
+ } else if (_s_0.$ === "STagEnd") {
1198
+ return null;
1199
+ } else if (_s_0.$ === "SBool") {
1200
+ return null;
1201
+ } else if (_s_0.$ === "STrue") {
1202
+ return null;
1203
+ } else if (_s_0.$ === "SEnum") {
1204
+ return null;
1205
+ } else if (_s_0.$ === "SVariant") {
1206
+ return null;
1207
+ } else if (_s_0.$ === "SVEnd") {
1208
+ return null;
1209
+ } else if (_s_0.$ === "STuple") {
1210
+ return null;
1211
+ } else {
1212
+ return null;
1213
+ }
1214
+ }
1215
+ }
1216
+ }
1217
+
1218
+ function $enc$($0, $1) {
1219
+ for (;;) {
1220
+ {
1221
+ const _s_0 = $0;
1222
+ const _x_0 = $1;
1223
+ if (_s_0.$ === "SNat") {
1224
+ return new $C$RNum$n(_x_0);
1225
+ } else if (_s_0.$ === "SNatIn") {
1226
+ return new $C$RNum$n(_x_0);
1227
+ } else if (_s_0.$ === "SStr") {
1228
+ return new $C$RStr$s(_x_0);
1229
+ } else if (_s_0.$ === "SStrLen") {
1230
+ const _s2_0 = _s_0["s"];
1231
+ $0 = _s2_0;
1232
+ $1 = _x_0;
1233
+ continue;
1234
+ } else if (_s_0.$ === "SListLen") {
1235
+ const _s2_1 = _s_0["s"];
1236
+ $0 = _s2_1;
1237
+ $1 = _x_0;
1238
+ continue;
1239
+ } else if (_s_0.$ === "SOpt") {
1240
+ const _i_0 = _s_0["inner"];
1241
+ if (_x_0.$ === "None") {
1242
+ return $N$RNull;
1243
+ } else {
1244
+ const _v_0 = _x_0["value"];
1245
+ $0 = _i_0;
1246
+ $1 = _v_0;
1247
+ continue;
1248
+ }
1249
+ } else if (_s_0.$ === "SOptional") {
1250
+ const _i_1 = _s_0["inner"];
1251
+ if (_x_0.$ === "None") {
1252
+ return $N$RMissing;
1253
+ } else {
1254
+ const _v_1 = _x_0["value"];
1255
+ $0 = _i_1;
1256
+ $1 = _v_1;
1257
+ continue;
1258
+ }
1259
+ } else if (_s_0.$ === "SList") {
1260
+ const _e_0 = _s_0["elem"];
1261
+ if (_x_0.$ === "Nil") {
1262
+ return $N$RNil;
1263
+ } else {
1264
+ const _h_0 = _x_0["head"];
1265
+ const _t_0 = _x_0["tail"];
1266
+ return new $C$RCons$head$tail(($enc$(_e_0, _h_0)), ($enc$(new $C$SList$elem(_e_0), _t_0)));
1267
+ }
1268
+ } else if (_s_0.$ === "SField") {
1269
+ const _n_0 = _s_0["name"];
1270
+ const _fs_0 = _s_0["s"];
1271
+ const _rest_0 = _s_0["rest"];
1272
+ const _a_0 = _x_0["a"];
1273
+ const _b_0 = _x_0["b"];
1274
+ return new $C$RKey$key$val$rest(_n_0, ($enc$(_fs_0, _a_0)), ($enc$(_rest_0, _b_0)));
1275
+ } else if (_s_0.$ === "SEnd") {
1276
+ return $N$REnd;
1277
+ } else if (_s_0.$ === "SRule") {
1278
+ const _s2_2 = _s_0["s"];
1279
+ $0 = _s2_2;
1280
+ $1 = _x_0;
1281
+ continue;
1282
+ } else if (_s_0.$ === "SStrict") {
1283
+ const _s2_3 = _s_0["s"];
1284
+ $0 = _s2_3;
1285
+ $1 = _x_0;
1286
+ continue;
1287
+ } else if (_s_0.$ === "STagged") {
1288
+ const _k_0 = _s_0["key"];
1289
+ const _n_1 = _s_0["name"];
1290
+ const _cs_0 = _s_0["s"];
1291
+ const _rest_1 = _s_0["rest"];
1292
+ if (_x_0.$ === "Inl") {
1293
+ const _a_1 = _x_0["value"];
1294
+ return new $C$RKey$key$val$rest(_k_0, new $C$RStr$s(_n_1), ($enc$(_cs_0, _a_1)));
1295
+ } else {
1296
+ const _b_1 = _x_0["value"];
1297
+ $0 = _rest_1;
1298
+ $1 = _b_1;
1299
+ continue;
1300
+ }
1301
+ } else if (_s_0.$ === "STagEnd") {
1302
+ return $Empty$absurd$(_x_0);
1303
+ } else if (_s_0.$ === "STrue") {
1304
+ return new $C$RBool$b(true);
1305
+ } else if (_s_0.$ === "SBool") {
1306
+ return new $C$RBool$b(_x_0);
1307
+ } else if (_s_0.$ === "SEnum") {
1308
+ return new $C$RStr$s(_x_0);
1309
+ } else if (_s_0.$ === "SVariant") {
1310
+ const _n_2 = _s_0["name"];
1311
+ const _vs_0 = _s_0["s"];
1312
+ const _rest_2 = _s_0["rest"];
1313
+ if (_x_0.$ === "Inl") {
1314
+ const _a_2 = _x_0["value"];
1315
+ return new $C$RKey$key$val$rest(_n_2, ($enc$(_vs_0, _a_2)), $N$REnd);
1316
+ } else {
1317
+ const _b_2 = _x_0["value"];
1318
+ $0 = _rest_2;
1319
+ $1 = _b_2;
1320
+ continue;
1321
+ }
1322
+ } else if (_s_0.$ === "SVEnd") {
1323
+ return $Empty$absurd$(_x_0);
1324
+ } else if (_s_0.$ === "STuple") {
1325
+ const _ts_0 = _s_0["s"];
1326
+ const _rest_3 = _s_0["rest"];
1327
+ const _a_3 = _x_0["a"];
1328
+ const _b_3 = _x_0["b"];
1329
+ return new $C$RCons$head$tail(($enc$(_ts_0, _a_3)), ($enc$(_rest_3, _b_3)));
1330
+ } else {
1331
+ return $N$RNil;
1332
+ }
1333
+ }
1334
+ }
1335
+ }
1336
+
1337
+ function $lcons$(_h_0, _t_0) {
1338
+ if (_h_0.$ === "Some") {
1339
+ const _x_0 = _h_0["value"];
1340
+ if (_t_0.$ === "Some") {
1341
+ const _xs_0 = _t_0["value"];
1342
+ return new $C$Some$value(new $C$Con$head$tail(_x_0, _xs_0));
1343
+ } else {
1344
+ return $N$None;
1345
+ }
1346
+ } else {
1347
+ return $N$None;
1348
+ }
1349
+ }
1350
+
1351
+ function $both$(_p_0, _q_0) {
1352
+ if (_p_0.$ === "Some") {
1353
+ const _x_0 = _p_0["value"];
1354
+ if (_q_0.$ === "Some") {
1355
+ const _y_0 = _q_0["value"];
1356
+ return new $C$Some$value(new $C$Both$a$b(_x_0, _y_0));
1357
+ } else {
1358
+ return $N$None;
1359
+ }
1360
+ } else {
1361
+ return $N$None;
1362
+ }
1363
+ }
1364
+
1365
+ function $opt_some$(_m_0) {
1366
+ if (_m_0.$ === "Some") {
1367
+ const _v_0 = _m_0["value"];
1368
+ return new $C$Some$value(new $C$Some$value(_v_0));
1369
+ } else {
1370
+ return $N$None;
1371
+ }
1372
+ }
1373
+
1374
+ function $map_inl$(_m_0) {
1375
+ if (_m_0.$ === "Some") {
1376
+ const _v_0 = _m_0["value"];
1377
+ return new $C$Some$value(new $C$Inl$value(_v_0));
1378
+ } else {
1379
+ return $N$None;
1380
+ }
1381
+ }
1382
+
1383
+ function $map_inr$(_m_0) {
1384
+ if (_m_0.$ === "Some") {
1385
+ const _v_0 = _m_0["value"];
1386
+ return new $C$Some$value(new $C$Inr$value(_v_0));
1387
+ } else {
1388
+ return $N$None;
1389
+ }
1390
+ }
1391
+
1392
+ function $pick_m$(_b_0, _x_0, _y_0) {
1393
+ if (_b_0) {
1394
+ return _x_0;
1395
+ } else {
1396
+ return _y_0;
1397
+ }
1398
+ }
1399
+
1400
+ function $true_unit$(_b_0) {
1401
+ if (_b_0) {
1402
+ return new $C$Some$value($N$Unit);
1403
+ } else {
1404
+ return $N$None;
1405
+ }
1406
+ }
1407
+
1408
+ function $nullish$(_r_0) {
1409
+ if (_r_0.$ === "RNull") {
1410
+ return true;
1411
+ } else if (_r_0.$ === "RMissing") {
1412
+ return true;
1413
+ } else {
1414
+ return false;
1415
+ }
1416
+ }
1417
+
1418
+ function $dec$($0, $1) {
1419
+ for (;;) {
1420
+ {
1421
+ const _s_0 = $0;
1422
+ const _r_0 = $1;
1423
+ if (_s_0.$ === "SNat") {
1424
+ if (_r_0.$ === "RNum") {
1425
+ const _n_0 = _r_0["n"];
1426
+ return new $C$Some$value(_n_0);
1427
+ } else {
1428
+ return $N$None;
1429
+ }
1430
+ } else if (_s_0.$ === "SNatIn") {
1431
+ if (_r_0.$ === "RNum") {
1432
+ const _n_1 = _r_0["n"];
1433
+ return new $C$Some$value(_n_1);
1434
+ } else {
1435
+ return $N$None;
1436
+ }
1437
+ } else if (_s_0.$ === "SStr") {
1438
+ if (_r_0.$ === "RStr") {
1439
+ const _x_0 = _r_0["s"];
1440
+ return new $C$Some$value(_x_0);
1441
+ } else {
1442
+ return $N$None;
1443
+ }
1444
+ } else if (_s_0.$ === "SStrLen") {
1445
+ const _s2_0 = _s_0["s"];
1446
+ $0 = _s2_0;
1447
+ $1 = _r_0;
1448
+ continue;
1449
+ } else if (_s_0.$ === "SListLen") {
1450
+ const _s2_1 = _s_0["s"];
1451
+ $0 = _s2_1;
1452
+ $1 = _r_0;
1453
+ continue;
1454
+ } else if (_s_0.$ === "SOpt") {
1455
+ const _i_0 = _s_0["inner"];
1456
+ return $pick_m$(($nullish$(_r_0)), new $C$Some$value($N$None), ($opt_some$(($dec$(_i_0, _r_0)))));
1457
+ } else if (_s_0.$ === "SOptional") {
1458
+ const _i_1 = _s_0["inner"];
1459
+ return $pick_m$(($is_missing$(_r_0)), new $C$Some$value($N$None), ($opt_some$(($dec$(_i_1, _r_0)))));
1460
+ } else if (_s_0.$ === "SList") {
1461
+ const _e_0 = _s_0["elem"];
1462
+ if (_r_0.$ === "RNil") {
1463
+ return new $C$Some$value($N$Nil);
1464
+ } else if (_r_0.$ === "RCons") {
1465
+ const _h_0 = _r_0["head"];
1466
+ const _t_0 = _r_0["tail"];
1467
+ return $lcons$(($dec$(_e_0, _h_0)), ($dec$(new $C$SList$elem(_e_0), _t_0)));
1468
+ } else {
1469
+ return $N$None;
1470
+ }
1471
+ } else if (_s_0.$ === "SField") {
1472
+ const _n_2 = _s_0["name"];
1473
+ const _fs_0 = _s_0["s"];
1474
+ const _rest_0 = _s_0["rest"];
1475
+ return $both$(($dec$(_fs_0, ($lookup$(_n_2, _r_0)))), ($dec$(_rest_0, _r_0)));
1476
+ } else if (_s_0.$ === "SEnd") {
1477
+ return new $C$Some$value($N$Unit);
1478
+ } else if (_s_0.$ === "SRule") {
1479
+ const _s2_2 = _s_0["s"];
1480
+ $0 = _s2_2;
1481
+ $1 = _r_0;
1482
+ continue;
1483
+ } else if (_s_0.$ === "SStrict") {
1484
+ const _s2_3 = _s_0["s"];
1485
+ $0 = _s2_3;
1486
+ $1 = _r_0;
1487
+ continue;
1488
+ } else if (_s_0.$ === "STagged") {
1489
+ const _k_0 = _s_0["key"];
1490
+ const _n_3 = _s_0["name"];
1491
+ const _cs_0 = _s_0["s"];
1492
+ const _rest_1 = _s_0["rest"];
1493
+ return $pick_m$(($is_tag$(_k_0, _n_3, _r_0)), ($map_inl$(($dec$(_cs_0, ($drop_key$(_k_0, _r_0)))))), ($map_inr$(($dec$(_rest_1, _r_0)))));
1494
+ } else if (_s_0.$ === "STrue") {
1495
+ if (_r_0.$ === "RBool") {
1496
+ const _b_0 = _r_0["b"];
1497
+ return $true_unit$(_b_0);
1498
+ } else {
1499
+ return $N$None;
1500
+ }
1501
+ } else if (_s_0.$ === "SBool") {
1502
+ if (_r_0.$ === "RBool") {
1503
+ const _b_1 = _r_0["b"];
1504
+ return new $C$Some$value(_b_1);
1505
+ } else {
1506
+ return $N$None;
1507
+ }
1508
+ } else if (_s_0.$ === "SEnum") {
1509
+ if (_r_0.$ === "RStr") {
1510
+ const _x_1 = _r_0["s"];
1511
+ return new $C$Some$value(_x_1);
1512
+ } else {
1513
+ return $N$None;
1514
+ }
1515
+ } else if (_s_0.$ === "SVariant") {
1516
+ const _n_4 = _s_0["name"];
1517
+ const _vs_0 = _s_0["s"];
1518
+ const _rest_2 = _s_0["rest"];
1519
+ return $pick_m$(($is_missing$(($lookup$(_n_4, _r_0)))), ($map_inr$(($dec$(_rest_2, _r_0)))), ($map_inl$(($dec$(_vs_0, ($lookup$(_n_4, _r_0)))))));
1520
+ } else if (_s_0.$ === "STuple") {
1521
+ const _ts_0 = _s_0["s"];
1522
+ const _rest_3 = _s_0["rest"];
1523
+ if (_r_0.$ === "RCons") {
1524
+ const _h_1 = _r_0["head"];
1525
+ const _t_1 = _r_0["tail"];
1526
+ return $both$(($dec$(_ts_0, _h_1)), ($dec$(_rest_3, _t_1)));
1527
+ } else {
1528
+ return $N$None;
1529
+ }
1530
+ } else if (_s_0.$ === "STEnd") {
1531
+ if (_r_0.$ === "RNil") {
1532
+ return new $C$Some$value($N$Unit);
1533
+ } else {
1534
+ return $N$None;
1535
+ }
1536
+ } else {
1537
+ return $N$None;
1538
+ }
1539
+ }
1540
+ }
1541
+ }
1542
+
1543
+ function $opt_at$($0) {
1544
+ for (;;) {
1545
+ {
1546
+ const _s_0 = $0;
1547
+ if (_s_0.$ === "SOptional") {
1548
+ return true;
1549
+ } else if (_s_0.$ === "SOpt") {
1550
+ const _i_1 = _s_0["inner"];
1551
+ $0 = _i_1;
1552
+ continue;
1553
+ } else if (_s_0.$ === "SRule") {
1554
+ const _s2_0 = _s_0["s"];
1555
+ $0 = _s2_0;
1556
+ continue;
1557
+ } else if (_s_0.$ === "SStrict") {
1558
+ const _s2_1 = _s_0["s"];
1559
+ $0 = _s2_1;
1560
+ continue;
1561
+ } else if (_s_0.$ === "SStrLen") {
1562
+ const _s2_2 = _s_0["s"];
1563
+ $0 = _s2_2;
1564
+ continue;
1565
+ } else if (_s_0.$ === "SListLen") {
1566
+ const _s2_3 = _s_0["s"];
1567
+ $0 = _s2_3;
1568
+ continue;
1569
+ } else if (_s_0.$ === "STagged") {
1570
+ const _rest_0 = _s_0["rest"];
1571
+ $0 = _rest_0;
1572
+ continue;
1573
+ } else if (_s_0.$ === "SVariant") {
1574
+ const _rest_1 = _s_0["rest"];
1575
+ $0 = _rest_1;
1576
+ continue;
1577
+ } else {
1578
+ return false;
1579
+ }
1580
+ }
1581
+ }
1582
+ }
1583
+
1584
+ function $nullable$($0) {
1585
+ for (;;) {
1586
+ {
1587
+ const _s_0 = $0;
1588
+ if (_s_0.$ === "SOpt") {
1589
+ return true;
1590
+ } else if (_s_0.$ === "SOptional") {
1591
+ return true;
1592
+ } else if (_s_0.$ === "SRule") {
1593
+ const _s2_0 = _s_0["s"];
1594
+ $0 = _s2_0;
1595
+ continue;
1596
+ } else if (_s_0.$ === "SStrict") {
1597
+ const _s2_1 = _s_0["s"];
1598
+ $0 = _s2_1;
1599
+ continue;
1600
+ } else if (_s_0.$ === "SStrLen") {
1601
+ const _s2_2 = _s_0["s"];
1602
+ $0 = _s2_2;
1603
+ continue;
1604
+ } else if (_s_0.$ === "SListLen") {
1605
+ const _s2_3 = _s_0["s"];
1606
+ $0 = _s2_3;
1607
+ continue;
1608
+ } else if (_s_0.$ === "STagged") {
1609
+ const _rest_0 = _s_0["rest"];
1610
+ $0 = _rest_0;
1611
+ continue;
1612
+ } else if (_s_0.$ === "SVariant") {
1613
+ const _rest_1 = _s_0["rest"];
1614
+ $0 = _rest_1;
1615
+ continue;
1616
+ } else {
1617
+ return false;
1618
+ }
1619
+ }
1620
+ }
1621
+ }
1622
+
1623
+ function $no_key$($0, $1) {
1624
+ for (;;) {
1625
+ {
1626
+ const _k_0 = $0;
1627
+ const _s_0 = $1;
1628
+ if (_s_0.$ === "SField") {
1629
+ const _n_0 = _s_0["name"];
1630
+ const _rest_0 = _s_0["rest"];
1631
+ return $Bool$and$(($Bool$not$(($String$eq$(_n_0, _k_0)))), ($Bool$and$(($Bool$not$(($String$eq$(_k_0, _n_0)))), ($no_key$(_k_0, _rest_0)))));
1632
+ } else if (_s_0.$ === "SVariant") {
1633
+ const _n_1 = _s_0["name"];
1634
+ const _rest_1 = _s_0["rest"];
1635
+ return $Bool$and$(($Bool$not$(($String$eq$(_n_1, _k_0)))), ($Bool$and$(($Bool$not$(($String$eq$(_k_0, _n_1)))), ($no_key$(_k_0, _rest_1)))));
1636
+ } else if (_s_0.$ === "SStrict") {
1637
+ const _s2_0 = _s_0["s"];
1638
+ $0 = _k_0;
1639
+ $1 = _s2_0;
1640
+ continue;
1641
+ } else if (_s_0.$ === "SRule") {
1642
+ const _s2_1 = _s_0["s"];
1643
+ $0 = _k_0;
1644
+ $1 = _s2_1;
1645
+ continue;
1646
+ } else if (_s_0.$ === "SStrLen") {
1647
+ const _s2_2 = _s_0["s"];
1648
+ $0 = _k_0;
1649
+ $1 = _s2_2;
1650
+ continue;
1651
+ } else if (_s_0.$ === "SListLen") {
1652
+ const _s2_3 = _s_0["s"];
1653
+ $0 = _k_0;
1654
+ $1 = _s2_3;
1655
+ continue;
1656
+ } else if (_s_0.$ === "SOpt") {
1657
+ const _i_0 = _s_0["inner"];
1658
+ $0 = _k_0;
1659
+ $1 = _i_0;
1660
+ continue;
1661
+ } else if (_s_0.$ === "SOptional") {
1662
+ const _i_1 = _s_0["inner"];
1663
+ $0 = _k_0;
1664
+ $1 = _i_1;
1665
+ continue;
1666
+ } else if (_s_0.$ === "STagged") {
1667
+ const _k2_0 = _s_0["key"];
1668
+ const _cs2_0 = _s_0["s"];
1669
+ const _rest2_0 = _s_0["rest"];
1670
+ return $Bool$and$(($Bool$not$(($String$eq$(_k2_0, _k_0)))), ($Bool$and$(($Bool$not$(($String$eq$(_k_0, _k2_0)))), ($Bool$and$(($no_key$(_k_0, _cs2_0)), ($no_key$(_k_0, _rest2_0)))))));
1671
+ } else {
1672
+ return true;
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1677
+
1678
+ function $fresh_f$(_n_0, _s_0) {
1679
+ if (_s_0.$ === "SField") {
1680
+ const _m_0 = _s_0["name"];
1681
+ const _rest_0 = _s_0["rest"];
1682
+ return $Bool$and$(($Bool$not$(($String$eq$(_m_0, _n_0)))), ($Bool$and$(($Bool$not$(($String$eq$(_n_0, _m_0)))), ($fresh_f$(_n_0, _rest_0)))));
1683
+ } else if (_s_0.$ === "SEnd") {
1684
+ return true;
1685
+ } else {
1686
+ return false;
1687
+ }
1688
+ }
1689
+
1690
+ function $fresh_v$(_n_0, _s_0) {
1691
+ if (_s_0.$ === "SVariant") {
1692
+ const _m_0 = _s_0["name"];
1693
+ const _rest_0 = _s_0["rest"];
1694
+ return $Bool$and$(($Bool$not$(($String$eq$(_m_0, _n_0)))), ($Bool$and$(($Bool$not$(($String$eq$(_n_0, _m_0)))), ($fresh_v$(_n_0, _rest_0)))));
1695
+ } else if (_s_0.$ === "SVEnd") {
1696
+ return true;
1697
+ } else {
1698
+ return false;
1699
+ }
1700
+ }
1701
+
1702
+ function $is_keyed$($0) {
1703
+ for (;;) {
1704
+ {
1705
+ const _s_0 = $0;
1706
+ if (_s_0.$ === "SField") {
1707
+ const _rest_0 = _s_0["rest"];
1708
+ $0 = _rest_0;
1709
+ continue;
1710
+ } else if (_s_0.$ === "SEnd") {
1711
+ return true;
1712
+ } else if (_s_0.$ === "SVariant") {
1713
+ const _rest_1 = _s_0["rest"];
1714
+ $0 = _rest_1;
1715
+ continue;
1716
+ } else if (_s_0.$ === "SVEnd") {
1717
+ return true;
1718
+ } else {
1719
+ return false;
1720
+ }
1721
+ }
1722
+ }
1723
+ }
1724
+
1725
+ function $fresh_t$(_k_0, _n_0, _s_0) {
1726
+ if (_s_0.$ === "STagged") {
1727
+ const _k2_0 = _s_0["key"];
1728
+ const _m_0 = _s_0["name"];
1729
+ const _rest_0 = _s_0["rest"];
1730
+ return $Bool$and$(($String$eq$(_k2_0, _k_0)), ($Bool$and$(($Bool$not$(($String$eq$(_m_0, _n_0)))), ($fresh_t$(_k_0, _n_0, _rest_0)))));
1731
+ } else if (_s_0.$ === "STagEnd") {
1732
+ const _k2_1 = _s_0["key"];
1733
+ return $String$eq$(_k2_1, _k_0);
1734
+ } else {
1735
+ return false;
1736
+ }
1737
+ }
1738
+
1739
+ function $wf$(_s_0) {
1740
+ if (_s_0.$ === "SOpt") {
1741
+ const _i_0 = _s_0["inner"];
1742
+ return $Bool$and$(($Bool$not$(($nullable$(_i_0)))), ($wf$(_i_0)));
1743
+ } else if (_s_0.$ === "SOptional") {
1744
+ const _i_1 = _s_0["inner"];
1745
+ return $Bool$and$(($Bool$not$(($opt_at$(_i_1)))), ($wf$(_i_1)));
1746
+ } else if (_s_0.$ === "SList") {
1747
+ const _e_0 = _s_0["elem"];
1748
+ return $Bool$and$(($Bool$not$(($opt_at$(_e_0)))), ($wf$(_e_0)));
1749
+ } else if (_s_0.$ === "SListLen") {
1750
+ const _s2_0 = _s_0["s"];
1751
+ return $Bool$and$(($Bool$not$(($opt_at$(_s2_0)))), ($wf$(_s2_0)));
1752
+ } else if (_s_0.$ === "SStrLen") {
1753
+ const _s2_1 = _s_0["s"];
1754
+ return $Bool$and$(($Bool$not$(($opt_at$(_s2_1)))), ($wf$(_s2_1)));
1755
+ } else if (_s_0.$ === "SField") {
1756
+ const _n_0 = _s_0["name"];
1757
+ const _fs_0 = _s_0["s"];
1758
+ const _rest_0 = _s_0["rest"];
1759
+ return $Bool$and$(($wf$(_fs_0)), ($Bool$and$(($fresh_f$(_n_0, _rest_0)), ($wf$(_rest_0)))));
1760
+ } else if (_s_0.$ === "SRule") {
1761
+ const _s2_2 = _s_0["s"];
1762
+ return $Bool$and$(($Bool$not$(($opt_at$(_s2_2)))), ($wf$(_s2_2)));
1763
+ } else if (_s_0.$ === "SStrict") {
1764
+ const _s2_3 = _s_0["s"];
1765
+ return $Bool$and$(($is_keyed$(_s2_3)), ($Bool$and$(($Bool$not$(($opt_at$(_s2_3)))), ($wf$(_s2_3)))));
1766
+ } else if (_s_0.$ === "STagged") {
1767
+ const _k_0 = _s_0["key"];
1768
+ const _n_1 = _s_0["name"];
1769
+ const _cs_0 = _s_0["s"];
1770
+ const _rest_1 = _s_0["rest"];
1771
+ return $Bool$and$(($Bool$not$(($opt_at$(_cs_0)))), ($Bool$and$(($wf$(_cs_0)), ($Bool$and$(($no_key$(_k_0, _cs_0)), ($Bool$and$(($fresh_t$(_k_0, _n_1, _rest_1)), ($wf$(_rest_1)))))))));
1772
+ } else if (_s_0.$ === "SVariant") {
1773
+ const _n_2 = _s_0["name"];
1774
+ const _vs_0 = _s_0["s"];
1775
+ const _rest_2 = _s_0["rest"];
1776
+ return $Bool$and$(($Bool$not$(($opt_at$(_vs_0)))), ($Bool$and$(($wf$(_vs_0)), ($Bool$and$(($fresh_v$(_n_2, _rest_2)), ($wf$(_rest_2)))))));
1777
+ } else if (_s_0.$ === "STuple") {
1778
+ const _ts_0 = _s_0["s"];
1779
+ const _rest_3 = _s_0["rest"];
1780
+ return $Bool$and$(($Bool$not$(($opt_at$(_ts_0)))), ($Bool$and$(($wf$(_ts_0)), ($Bool$and$(($Bool$not$(($opt_at$(_rest_3)))), ($wf$(_rest_3)))))));
1781
+ } else {
1782
+ return true;
1783
+ }
1784
+ }
1785
+
1786
+ function $names_ok$($0, $1) {
1787
+ for (;;) {
1788
+ {
1789
+ const _s_0 = $0;
1790
+ const _x_0 = $1;
1791
+ if (_s_0.$ === "SOpt") {
1792
+ const _i_0 = _s_0["inner"];
1793
+ if (_x_0.$ === "None") {
1794
+ return true;
1795
+ } else {
1796
+ const _v_0 = _x_0["value"];
1797
+ $0 = _i_0;
1798
+ $1 = _v_0;
1799
+ continue;
1800
+ }
1801
+ } else if (_s_0.$ === "SList") {
1802
+ const _e_0 = _s_0["elem"];
1803
+ if (_x_0.$ === "Nil") {
1804
+ return true;
1805
+ } else {
1806
+ const _h_0 = _x_0["head"];
1807
+ const _t_0 = _x_0["tail"];
1808
+ return $Bool$and$(($names_ok$(_e_0, _h_0)), ($names_ok$(new $C$SList$elem(_e_0), _t_0)));
1809
+ }
1810
+ } else if (_s_0.$ === "SField") {
1811
+ const _fs_0 = _s_0["s"];
1812
+ const _rest_0 = _s_0["rest"];
1813
+ const _a_0 = _x_0["a"];
1814
+ const _b_0 = _x_0["b"];
1815
+ return $Bool$and$(($names_ok$(_fs_0, _a_0)), ($names_ok$(_rest_0, _b_0)));
1816
+ } else if (_s_0.$ === "SRule") {
1817
+ const _s2_0 = _s_0["s"];
1818
+ $0 = _s2_0;
1819
+ $1 = _x_0;
1820
+ continue;
1821
+ } else if (_s_0.$ === "SStrict") {
1822
+ const _s2_1 = _s_0["s"];
1823
+ $0 = _s2_1;
1824
+ $1 = _x_0;
1825
+ continue;
1826
+ } else if (_s_0.$ === "SStrLen") {
1827
+ const _s2_2 = _s_0["s"];
1828
+ $0 = _s2_2;
1829
+ $1 = _x_0;
1830
+ continue;
1831
+ } else if (_s_0.$ === "SListLen") {
1832
+ const _s2_3 = _s_0["s"];
1833
+ $0 = _s2_3;
1834
+ $1 = _x_0;
1835
+ continue;
1836
+ } else if (_s_0.$ === "SOptional") {
1837
+ const _i_1 = _s_0["inner"];
1838
+ if (_x_0.$ === "None") {
1839
+ return true;
1840
+ } else {
1841
+ const _v_1 = _x_0["value"];
1842
+ $0 = _i_1;
1843
+ $1 = _v_1;
1844
+ continue;
1845
+ }
1846
+ } else if (_s_0.$ === "STagged") {
1847
+ const _cs_0 = _s_0["s"];
1848
+ const _rest_1 = _s_0["rest"];
1849
+ if (_x_0.$ === "Inl") {
1850
+ const _a_1 = _x_0["value"];
1851
+ $0 = _cs_0;
1852
+ $1 = _a_1;
1853
+ continue;
1854
+ } else {
1855
+ const _b_1 = _x_0["value"];
1856
+ $0 = _rest_1;
1857
+ $1 = _b_1;
1858
+ continue;
1859
+ }
1860
+ } else if (_s_0.$ === "SEnum") {
1861
+ const _names_0 = _s_0["names"];
1862
+ return $in_names$(_x_0, _names_0);
1863
+ } else if (_s_0.$ === "SVariant") {
1864
+ const _vs_0 = _s_0["s"];
1865
+ const _rest_2 = _s_0["rest"];
1866
+ if (_x_0.$ === "Inl") {
1867
+ const _a_2 = _x_0["value"];
1868
+ $0 = _vs_0;
1869
+ $1 = _a_2;
1870
+ continue;
1871
+ } else {
1872
+ const _b_2 = _x_0["value"];
1873
+ $0 = _rest_2;
1874
+ $1 = _b_2;
1875
+ continue;
1876
+ }
1877
+ } else if (_s_0.$ === "STuple") {
1878
+ const _ts_0 = _s_0["s"];
1879
+ const _rest_3 = _s_0["rest"];
1880
+ const _a_3 = _x_0["a"];
1881
+ const _b_3 = _x_0["b"];
1882
+ return $Bool$and$(($names_ok$(_ts_0, _a_3)), ($names_ok$(_rest_3, _b_3)));
1883
+ } else {
1884
+ return true;
1885
+ }
1886
+ }
1887
+ }
1888
+ }
1889
+
1890
+ function $bounds_ok$($0, $1) {
1891
+ for (;;) {
1892
+ {
1893
+ const _s_0 = $0;
1894
+ const _x_0 = $1;
1895
+ if (_s_0.$ === "SOpt") {
1896
+ const _i_0 = _s_0["inner"];
1897
+ if (_x_0.$ === "None") {
1898
+ return true;
1899
+ } else {
1900
+ const _v_0 = _x_0["value"];
1901
+ $0 = _i_0;
1902
+ $1 = _v_0;
1903
+ continue;
1904
+ }
1905
+ } else if (_s_0.$ === "SList") {
1906
+ const _e_0 = _s_0["elem"];
1907
+ if (_x_0.$ === "Nil") {
1908
+ return true;
1909
+ } else {
1910
+ const _h_0 = _x_0["head"];
1911
+ const _t_0 = _x_0["tail"];
1912
+ return $Bool$and$(($bounds_ok$(_e_0, _h_0)), ($bounds_ok$(new $C$SList$elem(_e_0), _t_0)));
1913
+ }
1914
+ } else if (_s_0.$ === "SField") {
1915
+ const _fs_0 = _s_0["s"];
1916
+ const _rest_0 = _s_0["rest"];
1917
+ const _a_0 = _x_0["a"];
1918
+ const _b_0 = _x_0["b"];
1919
+ return $Bool$and$(($bounds_ok$(_fs_0, _a_0)), ($bounds_ok$(_rest_0, _b_0)));
1920
+ } else if (_s_0.$ === "SRule") {
1921
+ const _s2_0 = _s_0["s"];
1922
+ $0 = _s2_0;
1923
+ $1 = _x_0;
1924
+ continue;
1925
+ } else if (_s_0.$ === "SStrict") {
1926
+ const _s2_1 = _s_0["s"];
1927
+ $0 = _s2_1;
1928
+ $1 = _x_0;
1929
+ continue;
1930
+ } else if (_s_0.$ === "STagged") {
1931
+ const _cs_0 = _s_0["s"];
1932
+ const _rest_1 = _s_0["rest"];
1933
+ if (_x_0.$ === "Inl") {
1934
+ const _a_1 = _x_0["value"];
1935
+ $0 = _cs_0;
1936
+ $1 = _a_1;
1937
+ continue;
1938
+ } else {
1939
+ const _b_1 = _x_0["value"];
1940
+ $0 = _rest_1;
1941
+ $1 = _b_1;
1942
+ continue;
1943
+ }
1944
+ } else if (_s_0.$ === "SNatIn") {
1945
+ const _lo_0 = _s_0["lo"];
1946
+ const _hi_0 = _s_0["hi"];
1947
+ return $num_ok$(_lo_0, _hi_0, _x_0);
1948
+ } else if (_s_0.$ === "SStrLen") {
1949
+ const _lo_1 = _s_0["lo"];
1950
+ const _hi_1 = _s_0["hi"];
1951
+ const _s2_2 = _s_0["s"];
1952
+ return $Bool$and$(($bounds_ok$(_s2_2, _x_0)), ($len_ok$(_lo_1, _hi_1, ($enc$(_s2_2, _x_0)))));
1953
+ } else if (_s_0.$ === "SListLen") {
1954
+ const _lo_2 = _s_0["lo"];
1955
+ const _hi_2 = _s_0["hi"];
1956
+ const _s2_3 = _s_0["s"];
1957
+ return $Bool$and$(($bounds_ok$(_s2_3, _x_0)), ($list_len_ok$(_lo_2, _hi_2, ($enc$(_s2_3, _x_0)))));
1958
+ } else if (_s_0.$ === "SOptional") {
1959
+ const _i_1 = _s_0["inner"];
1960
+ if (_x_0.$ === "None") {
1961
+ return true;
1962
+ } else {
1963
+ const _v_1 = _x_0["value"];
1964
+ $0 = _i_1;
1965
+ $1 = _v_1;
1966
+ continue;
1967
+ }
1968
+ } else if (_s_0.$ === "SVariant") {
1969
+ const _vs_0 = _s_0["s"];
1970
+ const _rest_2 = _s_0["rest"];
1971
+ if (_x_0.$ === "Inl") {
1972
+ const _a_2 = _x_0["value"];
1973
+ $0 = _vs_0;
1974
+ $1 = _a_2;
1975
+ continue;
1976
+ } else {
1977
+ const _b_2 = _x_0["value"];
1978
+ $0 = _rest_2;
1979
+ $1 = _b_2;
1980
+ continue;
1981
+ }
1982
+ } else if (_s_0.$ === "STuple") {
1983
+ const _ts_0 = _s_0["s"];
1984
+ const _rest_3 = _s_0["rest"];
1985
+ const _a_3 = _x_0["a"];
1986
+ const _b_3 = _x_0["b"];
1987
+ return $Bool$and$(($bounds_ok$(_ts_0, _a_3)), ($bounds_ok$(_rest_3, _b_3)));
1988
+ } else {
1989
+ return true;
1990
+ }
1991
+ }
1992
+ }
1993
+ }
1994
+
1995
+ function $String$eq$(_a_0, _b_0) {
1996
+ return $Cmp$is_eq$(($String$order$(_a_0, _b_0)));
1997
+ }
1998
+
1999
+ function $Bool$and$(_a_0, _b_0) {
2000
+ if (!_a_0) {
2001
+ return false;
2002
+ } else {
2003
+ return _b_0;
2004
+ }
2005
+ }
2006
+
2007
+ function $Nat$is_le$(_a_0, _b_0) {
2008
+ return $Cmp$is_le$(cmp_new(_a_0, _b_0));
2009
+ }
2010
+
2011
+ function $Bool$not$(_b_0) {
2012
+ if (!_b_0) {
2013
+ return true;
2014
+ } else {
2015
+ return false;
2016
+ }
2017
+ }
2018
+
2019
+ function $Nat$is_eq$(_a_0, _b_0) {
2020
+ return $Cmp$is_eq$(cmp_new(_a_0, _b_0));
2021
+ }
2022
+
2023
+ function $check$1260$($0, $1, $2) {
2024
+ for (;;) {
2025
+ {
2026
+ const _s_0 = $0;
2027
+ const _r_0 = $1;
2028
+ const _prev_0 = $2;
2029
+ if (_s_0.$ === "SNat") {
2030
+ if (_r_0.$ === "RNum") {
2031
+ return $N$None;
2032
+ } else {
2033
+ return $here$(($missing_or$(_r_0, $N$NotNat)));
2034
+ }
2035
+ } else if (_s_0.$ === "SStr") {
2036
+ if (_r_0.$ === "RStr") {
2037
+ return $N$None;
2038
+ } else {
2039
+ return $here$(($missing_or$(_r_0, $N$NotString)));
2040
+ }
2041
+ } else if (_s_0.$ === "SNatIn") {
2042
+ const _lo_0 = _s_0["lo"];
2043
+ const _hi_0 = _s_0["hi"];
2044
+ if (_r_0.$ === "RNum") {
2045
+ const _n_1 = _r_0["n"];
2046
+ return $nat_in$(_lo_0, _hi_0, new $C$RNum$n(_n_1));
2047
+ } else {
2048
+ return $here$(($missing_or$(_r_0, $N$NotNat)));
2049
+ }
2050
+ } else if (_s_0.$ === "SStrLen") {
2051
+ const _lo_1 = _s_0["lo"];
2052
+ const _hi_1 = _s_0["hi"];
2053
+ const _s2_0 = _s_0["s"];
2054
+ return $first$(($check$1260$(_s2_0, _r_0, _prev_0)), ($len_err$(_lo_1, _hi_1, _r_0)));
2055
+ } else if (_s_0.$ === "SListLen") {
2056
+ const _lo_2 = _s_0["lo"];
2057
+ const _hi_2 = _s_0["hi"];
2058
+ const _s2_1 = _s_0["s"];
2059
+ return $first$(($count_err$(_lo_2, _hi_2, _r_0)), ($check$1260$(_s2_1, _r_0, $N$None)));
2060
+ } else if (_s_0.$ === "SOpt") {
2061
+ const _inner_0 = _s_0["inner"];
2062
+ if (_r_0.$ === "RNull") {
2063
+ return $N$None;
2064
+ } else {
2065
+ $0 = _inner_0;
2066
+ $1 = _r_0;
2067
+ $2 = $N$None;
2068
+ continue;
2069
+ }
2070
+ } else if (_s_0.$ === "SOptional") {
2071
+ const _inner_1 = _s_0["inner"];
2072
+ if (_r_0.$ === "RMissing") {
2073
+ return $N$None;
2074
+ } else {
2075
+ $0 = _inner_1;
2076
+ $1 = _r_0;
2077
+ $2 = $N$None;
2078
+ continue;
2079
+ }
2080
+ } else if (_s_0.$ === "SList") {
2081
+ const _e_0 = _s_0["elem"];
2082
+ if (_r_0.$ === "RNil") {
2083
+ return $N$None;
2084
+ } else if (_r_0.$ === "RCons") {
2085
+ const _h_0 = _r_0["head"];
2086
+ const _t_0 = _r_0["tail"];
2087
+ return $first$(($under$(new $C$AtIndex$i(0), ($check$1260$(_e_0, _h_0, $N$None)))), ($later_l$(($check$1260$(new $C$SList$elem(_e_0), _t_0, $N$None)))));
2088
+ } else {
2089
+ return $here$(($missing_or$(_r_0, $N$NotList)));
2090
+ }
2091
+ } else if (_s_0.$ === "SField") {
2092
+ const _name_0 = _s_0["name"];
2093
+ const _fs_0 = _s_0["s"];
2094
+ const _rest_0 = _s_0["rest"];
2095
+ if (_r_0.$ === "REnd") {
2096
+ return $first$(($under$(new $C$AtField$skip$name(0, _name_0), ($check$1260$(_fs_0, $N$RMissing, $N$None)))), ($later_f$(($check$1260$(_rest_0, $N$REnd, $N$None)))));
2097
+ } else if (_r_0.$ === "RKey") {
2098
+ const _k_0 = _r_0["key"];
2099
+ const _v_0 = _r_0["val"];
2100
+ const _o_0 = _r_0["rest"];
2101
+ return $first$(($key_err$(($key_once$(_name_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0))), _name_0)), ($first$(($under$(new $C$AtField$skip$name(0, _name_0), ($check$1260$(_fs_0, ($lookup$(_name_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0))), $N$None)))), ($later_f$(($check$1260$(_rest_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0), $N$None)))))));
2102
+ } else {
2103
+ return $here$(($missing_or$(_r_0, $N$NotObject)));
2104
+ }
2105
+ } else if (_s_0.$ === "SEnd") {
2106
+ if (_r_0.$ === "REnd") {
2107
+ return $N$None;
2108
+ } else if (_r_0.$ === "RKey") {
2109
+ return $N$None;
2110
+ } else {
2111
+ return $here$(($missing_or$(_r_0, $N$NotObject)));
2112
+ }
2113
+ } else if (_s_0.$ === "SRule") {
2114
+ const _s2_2 = _s_0["s"];
2115
+ const _tag_0 = _s_0["tag"];
2116
+ return $first$(($check$1260$(_s2_2, _r_0, _prev_0)), ($no_rule$(_tag_0, _r_0)));
2117
+ } else if (_s_0.$ === "SStrict") {
2118
+ const _s2_3 = _s_0["s"];
2119
+ return $first$(($check$1260$(_s2_3, _r_0, _prev_0)), ($extra_err$(($key_names$(_s2_3)), _r_0)));
2120
+ } else if (_s_0.$ === "STagged") {
2121
+ const _k_2 = _s_0["key"];
2122
+ const _n_2 = _s_0["name"];
2123
+ const _cs_0 = _s_0["s"];
2124
+ const _rest_1 = _s_0["rest"];
2125
+ return $pick_err$(($is_tag$(_k_2, _n_2, _r_0)), ($first$(($key_err$(($key_once$(_k_2, _r_0)), _k_2)), ($check$1260$(_cs_0, ($drop_key$(_k_2, _r_0)), $N$None)))), ($check$1260$(_rest_1, _r_0, $N$None)));
2126
+ } else if (_s_0.$ === "STagEnd") {
2127
+ const _k_3 = _s_0["key"];
2128
+ return $tag_err$(_k_3, _r_0);
2129
+ } else if (_s_0.$ === "SBool") {
2130
+ if (_r_0.$ === "RBool") {
2131
+ return $N$None;
2132
+ } else {
2133
+ return $here$(($missing_or$(_r_0, $N$NotBool)));
2134
+ }
2135
+ } else if (_s_0.$ === "STrue") {
2136
+ if (_r_0.$ === "RBool") {
2137
+ const _b_1 = _r_0["b"];
2138
+ return $true_err$(_b_1);
2139
+ } else {
2140
+ return $here$(($missing_or$(_r_0, $N$NotTrue)));
2141
+ }
2142
+ } else if (_s_0.$ === "SEnum") {
2143
+ const _names_0 = _s_0["names"];
2144
+ if (_r_0.$ === "RStr") {
2145
+ const _x_1 = _r_0["s"];
2146
+ return $enum_err$(($in_names$(_x_1, _names_0)));
2147
+ } else {
2148
+ return $here$(($missing_or$(_r_0, $N$NotOneOf)));
2149
+ }
2150
+ } else if (_s_0.$ === "SVariant") {
2151
+ const _name_1 = _s_0["name"];
2152
+ const _vs_0 = _s_0["s"];
2153
+ const _rest_2 = _s_0["rest"];
2154
+ if (_r_0.$ === "REnd") {
2155
+ return $later_f$(($check$1260$(_rest_2, $N$REnd, $N$None)));
2156
+ } else if (_r_0.$ === "RKey") {
2157
+ const _k_4 = _r_0["key"];
2158
+ const _v_2 = _r_0["val"];
2159
+ const _o_2 = _r_0["rest"];
2160
+ return $pick_err$(($is_missing$(($lookup$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))))), ($later_f$(($check$1260$(_rest_2, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2), $N$None)))), ($first$(($key_err$(($key_once$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))), _name_1)), ($first$(($under$(new $C$AtField$skip$name(0, _name_1), ($check$1260$(_vs_0, ($lookup$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))), $N$None)))), ($later_f$(($dup_err$(_rest_2, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))))))))));
2161
+ } else {
2162
+ return $here$(($missing_or$(_r_0, $N$NotObject)));
2163
+ }
2164
+ } else if (_s_0.$ === "SVEnd") {
2165
+ if (_r_0.$ === "REnd") {
2166
+ return $here$($N$NoVariant);
2167
+ } else if (_r_0.$ === "RKey") {
2168
+ return $here$($N$NoVariant);
2169
+ } else {
2170
+ return $here$(($missing_or$(_r_0, $N$NotObject)));
2171
+ }
2172
+ } else if (_s_0.$ === "STuple") {
2173
+ const _ts_0 = _s_0["s"];
2174
+ const _rest_3 = _s_0["rest"];
2175
+ if (_r_0.$ === "RCons") {
2176
+ const _h_1 = _r_0["head"];
2177
+ const _t_1 = _r_0["tail"];
2178
+ return $first$(($under$(new $C$AtIndex$i(0), ($check$1260$(_ts_0, _h_1, $N$None)))), ($later_l$(($check$1260$(_rest_3, _t_1, $N$None)))));
2179
+ } else if (_r_0.$ === "RNil") {
2180
+ return $here$($N$TooShort);
2181
+ } else {
2182
+ return $here$(($missing_or$(_r_0, $N$NotList)));
2183
+ }
2184
+ } else {
2185
+ if (_r_0.$ === "RNil") {
2186
+ return $N$None;
2187
+ } else if (_r_0.$ === "RCons") {
2188
+ return $here$($N$TooLong);
2189
+ } else {
2190
+ return $here$(($missing_or$(_r_0, $N$NotList)));
2191
+ }
2192
+ }
2193
+ }
2194
+ }
2195
+ }
2196
+
2197
+ function $conforms$1260$($0, $1, $2) {
2198
+ for (;;) {
2199
+ {
2200
+ const _s_0 = $0;
2201
+ const _r_0 = $1;
2202
+ const _prev_0 = $2;
2203
+ if (_s_0.$ === "SNat") {
2204
+ if (_r_0.$ === "RNum") {
2205
+ return true;
2206
+ } else {
2207
+ return false;
2208
+ }
2209
+ } else if (_s_0.$ === "SNatIn") {
2210
+ const _lo_0 = _s_0["lo"];
2211
+ const _hi_0 = _s_0["hi"];
2212
+ if (_r_0.$ === "RNum") {
2213
+ const _n_1 = _r_0["n"];
2214
+ return $num_ok$(_lo_0, _hi_0, _n_1);
2215
+ } else {
2216
+ return false;
2217
+ }
2218
+ } else if (_s_0.$ === "SStr") {
2219
+ if (_r_0.$ === "RStr") {
2220
+ return true;
2221
+ } else {
2222
+ return false;
2223
+ }
2224
+ } else if (_s_0.$ === "SStrLen") {
2225
+ const _lo_1 = _s_0["lo"];
2226
+ const _hi_1 = _s_0["hi"];
2227
+ const _s2_0 = _s_0["s"];
2228
+ return $Bool$and$(($conforms$1260$(_s2_0, _r_0, _prev_0)), ($len_ok$(_lo_1, _hi_1, _r_0)));
2229
+ } else if (_s_0.$ === "SListLen") {
2230
+ const _lo_2 = _s_0["lo"];
2231
+ const _hi_2 = _s_0["hi"];
2232
+ const _s2_1 = _s_0["s"];
2233
+ return $Bool$and$(($list_len_ok$(_lo_2, _hi_2, _r_0)), ($conforms$1260$(_s2_1, _r_0, $N$None)));
2234
+ } else if (_s_0.$ === "SOpt") {
2235
+ const _inner_0 = _s_0["inner"];
2236
+ if (_r_0.$ === "RNull") {
2237
+ return true;
2238
+ } else {
2239
+ $0 = _inner_0;
2240
+ $1 = _r_0;
2241
+ $2 = $N$None;
2242
+ continue;
2243
+ }
2244
+ } else if (_s_0.$ === "SOptional") {
2245
+ const _inner_1 = _s_0["inner"];
2246
+ const _x_1 = ($is_missing$(_r_0));
2247
+ const _x_2 = ($conforms$1260$(_inner_1, _r_0, $N$None));
2248
+ return (_x_1 || _x_2);
2249
+ } else if (_s_0.$ === "SList") {
2250
+ const _e_0 = _s_0["elem"];
2251
+ if (_r_0.$ === "RNil") {
2252
+ return true;
2253
+ } else if (_r_0.$ === "RCons") {
2254
+ const _h_0 = _r_0["head"];
2255
+ const _t_0 = _r_0["tail"];
2256
+ return $Bool$and$(($conforms$1260$(_e_0, _h_0, $N$None)), ($conforms$1260$(new $C$SList$elem(_e_0), _t_0, $N$None)));
2257
+ } else {
2258
+ return false;
2259
+ }
2260
+ } else if (_s_0.$ === "SField") {
2261
+ const _name_0 = _s_0["name"];
2262
+ const _fs_0 = _s_0["s"];
2263
+ const _rest_0 = _s_0["rest"];
2264
+ if (_r_0.$ === "REnd") {
2265
+ return $Bool$and$(($conforms$1260$(_fs_0, $N$RMissing, $N$None)), ($conforms$1260$(_rest_0, $N$REnd, $N$None)));
2266
+ } else if (_r_0.$ === "RKey") {
2267
+ const _k_0 = _r_0["key"];
2268
+ const _v_0 = _r_0["val"];
2269
+ const _o_0 = _r_0["rest"];
2270
+ return $Bool$and$(($key_once$(_name_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0))), ($Bool$and$(($conforms$1260$(_fs_0, ($lookup$(_name_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0))), $N$None)), ($conforms$1260$(_rest_0, new $C$RKey$key$val$rest(_k_0, _v_0, _o_0), $N$None)))));
2271
+ } else {
2272
+ return false;
2273
+ }
2274
+ } else if (_s_0.$ === "SEnd") {
2275
+ if (_r_0.$ === "REnd") {
2276
+ return true;
2277
+ } else if (_r_0.$ === "RKey") {
2278
+ return true;
2279
+ } else {
2280
+ return false;
2281
+ }
2282
+ } else if (_s_0.$ === "SRule") {
2283
+ const _s2_2 = _s_0["s"];
2284
+ const _tag_0 = _s_0["tag"];
2285
+ return $Bool$and$(($conforms$1260$(_s2_2, _r_0, _prev_0)), ($Maybe$is_none$(($no_rule$(_tag_0, _r_0)))));
2286
+ } else if (_s_0.$ === "SStrict") {
2287
+ const _s2_3 = _s_0["s"];
2288
+ return $Bool$and$(($conforms$1260$(_s2_3, _r_0, _prev_0)), ($no_extra$(($key_names$(_s2_3)), _r_0)));
2289
+ } else if (_s_0.$ === "STagged") {
2290
+ const _k_2 = _s_0["key"];
2291
+ const _n_2 = _s_0["name"];
2292
+ const _cs_0 = _s_0["s"];
2293
+ const _rest_1 = _s_0["rest"];
2294
+ return $pick_bool$(($is_tag$(_k_2, _n_2, _r_0)), ($Bool$and$(($key_once$(_k_2, _r_0)), ($conforms$1260$(_cs_0, ($drop_key$(_k_2, _r_0)), $N$None)))), ($conforms$1260$(_rest_1, _r_0, $N$None)));
2295
+ } else if (_s_0.$ === "STagEnd") {
2296
+ return false;
2297
+ } else if (_s_0.$ === "SBool") {
2298
+ if (_r_0.$ === "RBool") {
2299
+ return true;
2300
+ } else {
2301
+ return false;
2302
+ }
2303
+ } else if (_s_0.$ === "STrue") {
2304
+ if (_r_0.$ === "RBool") {
2305
+ const _b_1 = _r_0["b"];
2306
+ return _b_1;
2307
+ } else {
2308
+ return false;
2309
+ }
2310
+ } else if (_s_0.$ === "SEnum") {
2311
+ const _names_0 = _s_0["names"];
2312
+ if (_r_0.$ === "RStr") {
2313
+ const _x_3 = _r_0["s"];
2314
+ return $in_names$(_x_3, _names_0);
2315
+ } else {
2316
+ return false;
2317
+ }
2318
+ } else if (_s_0.$ === "SVariant") {
2319
+ const _name_1 = _s_0["name"];
2320
+ const _vs_0 = _s_0["s"];
2321
+ const _rest_2 = _s_0["rest"];
2322
+ if (_r_0.$ === "REnd") {
2323
+ $0 = _rest_2;
2324
+ $1 = $N$REnd;
2325
+ $2 = $N$None;
2326
+ continue;
2327
+ } else if (_r_0.$ === "RKey") {
2328
+ const _k_4 = _r_0["key"];
2329
+ const _v_2 = _r_0["val"];
2330
+ const _o_2 = _r_0["rest"];
2331
+ return $pick_bool$(($is_missing$(($lookup$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))))), ($conforms$1260$(_rest_2, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2), $N$None)), ($Bool$and$(($key_once$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))), ($Bool$and$(($conforms$1260$(_vs_0, ($lookup$(_name_1, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))), $N$None)), ($none_present$(_rest_2, new $C$RKey$key$val$rest(_k_4, _v_2, _o_2))))))));
2332
+ } else {
2333
+ return false;
2334
+ }
2335
+ } else if (_s_0.$ === "STuple") {
2336
+ const _ts_0 = _s_0["s"];
2337
+ const _rest_3 = _s_0["rest"];
2338
+ if (_r_0.$ === "RCons") {
2339
+ const _h_1 = _r_0["head"];
2340
+ const _t_1 = _r_0["tail"];
2341
+ return $Bool$and$(($conforms$1260$(_ts_0, _h_1, $N$None)), ($conforms$1260$(_rest_3, _t_1, $N$None)));
2342
+ } else {
2343
+ return false;
2344
+ }
2345
+ } else if (_s_0.$ === "STEnd") {
2346
+ if (_r_0.$ === "RNil") {
2347
+ return true;
2348
+ } else {
2349
+ return false;
2350
+ }
2351
+ } else {
2352
+ return false;
2353
+ }
2354
+ }
2355
+ }
2356
+ }
2357
+
2358
+ function $Empty$absurd$(_e_0) {
2359
+ throw "bend: runtime fail-stop";
2360
+ }
2361
+
2362
+ function $Cmp$is_eq$(_c_0) {
2363
+ if (_c_0.$ === "EQ") {
2364
+ return true;
2365
+ } else {
2366
+ return false;
2367
+ }
2368
+ }
2369
+
2370
+ function $String$order$(_a_0, _b_0) {
2371
+ return $Pair$snd$(($String$cmp$(_a_0, _b_0)));
2372
+ }
2373
+
2374
+ function $Cmp$is_le$(_c_0) {
2375
+ if (_c_0.$ === "GT") {
2376
+ return false;
2377
+ } else {
2378
+ return true;
2379
+ }
2380
+ }
2381
+
2382
+ function $Maybe$is_none$(_m_0) {
2383
+ return $Bool$not$(($Maybe$is_some$(_m_0)));
2384
+ }
2385
+
2386
+ function $Pair$snd$(_p_0) {
2387
+ const _b_0 = _p_0["snd"];
2388
+ return _b_0;
2389
+ }
2390
+
2391
+ function $String$cmp$(_a_0, _b_0) {
2392
+ if (_a_0 === "") {
2393
+ if (_b_0 === "") {
2394
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd("", ""), $N$EQ);
2395
+ } else {
2396
+ const _h_0 = (_b_0.codePointAt(0) > 0xFFFF ? _b_0.slice(0, 2) : _b_0[0]);
2397
+ const _t_0 = (_b_0.codePointAt(0) > 0xFFFF ? _b_0.slice(2) : _b_0.slice(1));
2398
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd("", (_h_0 + _t_0)), $N$LT);
2399
+ }
2400
+ } else {
2401
+ const _h_1 = (_a_0.codePointAt(0) > 0xFFFF ? _a_0.slice(0, 2) : _a_0[0]);
2402
+ const _t_1 = (_a_0.codePointAt(0) > 0xFFFF ? _a_0.slice(2) : _a_0.slice(1));
2403
+ if (_b_0 === "") {
2404
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd((_h_1 + _t_1), ""), $N$GT);
2405
+ } else {
2406
+ const _h2_0 = (_b_0.codePointAt(0) > 0xFFFF ? _b_0.slice(0, 2) : _b_0[0]);
2407
+ const _t2_0 = (_b_0.codePointAt(0) > 0xFFFF ? _b_0.slice(2) : _b_0.slice(1));
2408
+ return $String$cmp$fin$(_t_1, _t2_0, ($Char$cmp$(_h_1, _h2_0)));
2409
+ }
2410
+ }
2411
+ }
2412
+
2413
+ function $Maybe$is_some$(_m_0) {
2414
+ if (_m_0.$ === "None") {
2415
+ return false;
2416
+ } else {
2417
+ return true;
2418
+ }
2419
+ }
2420
+
2421
+ function $String$cmp$fin$(_t1_0, _t2_0, _hc_0) {
2422
+ const _t_0 = _hc_0["fst"];
2423
+ const _h1b_0 = _t_0["fst"];
2424
+ const _h2b_0 = _t_0["snd"];
2425
+ const _t_1 = _hc_0["snd"];
2426
+ if (_t_1.$ === "LT") {
2427
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd((_h1b_0 + _t1_0), (_h2b_0 + _t2_0)), $N$LT);
2428
+ } else if (_t_1.$ === "EQ") {
2429
+ return $String$cmp$rec$(_h1b_0, _h2b_0, ($String$cmp$(_t1_0, _t2_0)));
2430
+ } else {
2431
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd((_h1b_0 + _t1_0), (_h2b_0 + _t2_0)), $N$GT);
2432
+ }
2433
+ }
2434
+
2435
+ function $Char$cmp$(_a_0, _b_0) {
2436
+ const _x_0 = _a_0.codePointAt(0);
2437
+ const _x_1 = _b_0.codePointAt(0);
2438
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd(_a_0, _b_0), cmp_new(_x_0, _x_1));
2439
+ }
2440
+
2441
+ function $String$cmp$rec$(_h1b_0, _h2b_0, _rr_0) {
2442
+ const _t_0 = _rr_0["fst"];
2443
+ const _t1b_0 = _t_0["fst"];
2444
+ const _t2b_0 = _t_0["snd"];
2445
+ const _r_0 = _rr_0["snd"];
2446
+ return new $C$Tuple$fst$snd(new $C$Tuple$fst$snd((_h1b_0 + _t1b_0), (_h2b_0 + _t2b_0)), _r_0);
2447
+ }
2448
+
2449
+ function $0m0(v) {
2450
+ const top = [v];
2451
+ for (let at = top, key = 0;;) {
2452
+ switch (v.$) {
2453
+ case "RNum": at = at[key] = {...v, "n": nat_host(v["n"])}; return top[0];
2454
+ case "RBool": at[key] = v; return top[0];
2455
+ case "RNull": at[key] = v; return top[0];
2456
+ case "RStr": at[key] = v; return top[0];
2457
+ case "RBad": at[key] = v; return top[0];
2458
+ case "RTooBig": at[key] = v; return top[0];
2459
+ case "RMissing": at[key] = v; return top[0];
2460
+ case "RNil": at[key] = v; return top[0];
2461
+ case "RCons": at = at[key] = {...v, "head": $0m0(v["head"])}; key = "tail"; v = v[key]; continue;
2462
+ case "REnd": at[key] = v; return top[0];
2463
+ case "RKey": at = at[key] = {...v, "val": $0m0(v["val"])}; key = "rest"; v = v[key]; continue;
2464
+ default: throw "bend: Raw has no tag " + v?.$ + " (its tags: RNum, RBool, RNull, RStr, RBad, RTooBig, RMissing, RNil, RCons, REnd, RKey); a tag names its constructor as the"
2465
+ + " loading file sees it, which a later version will make the same"
2466
+ + " everywhere (#1105)";
2467
+ }
2468
+ }
2469
+ }
2470
+
2471
+ function $0m1(v) {
2472
+ const top = [v];
2473
+ for (let at = top, key = 0;;) {
2474
+ switch (v.$) {
2475
+ case "RNum": at = at[key] = {...v, "n": BigInt(v["n"])}; return top[0];
2476
+ case "RBool": at[key] = v; return top[0];
2477
+ case "RNull": at[key] = v; return top[0];
2478
+ case "RStr": at[key] = v; return top[0];
2479
+ case "RBad": at[key] = v; return top[0];
2480
+ case "RTooBig": at[key] = v; return top[0];
2481
+ case "RMissing": at[key] = v; return top[0];
2482
+ case "RNil": at[key] = v; return top[0];
2483
+ case "RCons": at = at[key] = {...v, "head": $0m1(v["head"])}; key = "tail"; v = v[key]; continue;
2484
+ case "REnd": at[key] = v; return top[0];
2485
+ case "RKey": at = at[key] = {...v, "val": $0m1(v["val"])}; key = "rest"; v = v[key]; continue;
2486
+ default: throw "bend: Raw has no tag " + v?.$ + " (its tags: RNum, RBool, RNull, RStr, RBad, RTooBig, RMissing, RNil, RCons, REnd, RKey); a tag names its constructor as the"
2487
+ + " loading file sees it, which a later version will make the same"
2488
+ + " everywhere (#1105)";
2489
+ }
2490
+ }
2491
+ }
2492
+
2493
+ function $0m2(v) {
2494
+ const top = [v];
2495
+ for (let at = top, key = 0;;) {
2496
+ switch (v.$) {
2497
+ case "SNat": at[key] = v; return top[0];
2498
+ case "SNatIn": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; return top[0];
2499
+ case "SStr": at[key] = v; return top[0];
2500
+ case "SStrLen": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; key = "s"; v = v[key]; continue;
2501
+ case "SOpt": at = at[key] = {...v}; key = "inner"; v = v[key]; continue;
2502
+ case "SList": at = at[key] = {...v}; key = "elem"; v = v[key]; continue;
2503
+ case "SField": at = at[key] = {...v, "s": $0m2(v["s"])}; key = "rest"; v = v[key]; continue;
2504
+ case "SEnd": at[key] = v; return top[0];
2505
+ case "SRule": at = at[key] = {...v, "tag": nat_host(v["tag"])}; key = "s"; v = v[key]; continue;
2506
+ case "SStrict": at = at[key] = {...v}; key = "s"; v = v[key]; continue;
2507
+ case "STagged": at = at[key] = {...v, "s": $0m2(v["s"])}; key = "rest"; v = v[key]; continue;
2508
+ case "STagEnd": at[key] = v; return top[0];
2509
+ case "SBool": at[key] = v; return top[0];
2510
+ case "STrue": at[key] = v; return top[0];
2511
+ case "SEnum": at[key] = v; return top[0];
2512
+ case "SVariant": at = at[key] = {...v, "s": $0m2(v["s"])}; key = "rest"; v = v[key]; continue;
2513
+ case "SVEnd": at[key] = v; return top[0];
2514
+ case "STuple": at = at[key] = {...v, "s": $0m2(v["s"])}; key = "rest"; v = v[key]; continue;
2515
+ case "STEnd": at[key] = v; return top[0];
2516
+ case "SOptional": at = at[key] = {...v}; key = "inner"; v = v[key]; continue;
2517
+ case "SListLen": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; key = "s"; v = v[key]; continue;
2518
+ default: throw "bend: Schema has no tag " + v?.$ + " (its tags: SNat, SNatIn, SStr, SStrLen, SOpt, SList, SField, SEnd, SRule, SStrict, STagged, STagEnd, SBool, STrue, SEnum, SVariant, SVEnd, STuple, STEnd, SOptional, SListLen); a tag names its constructor as the"
2519
+ + " loading file sees it, which a later version will make the same"
2520
+ + " everywhere (#1105)";
2521
+ }
2522
+ }
2523
+ }
2524
+
2525
+ function $0m3(v) {
2526
+ const top = [v];
2527
+ for (let at = top, key = 0;;) {
2528
+ switch (v.$) {
2529
+ case "SNat": at[key] = v; return top[0];
2530
+ case "SNatIn": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; return top[0];
2531
+ case "SStr": at[key] = v; return top[0];
2532
+ case "SStrLen": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; key = "s"; v = v[key]; continue;
2533
+ case "SOpt": at = at[key] = {...v}; key = "inner"; v = v[key]; continue;
2534
+ case "SList": at = at[key] = {...v}; key = "elem"; v = v[key]; continue;
2535
+ case "SField": at = at[key] = {...v, "s": $0m3(v["s"])}; key = "rest"; v = v[key]; continue;
2536
+ case "SEnd": at[key] = v; return top[0];
2537
+ case "SRule": at = at[key] = {...v, "tag": BigInt(v["tag"])}; key = "s"; v = v[key]; continue;
2538
+ case "SStrict": at = at[key] = {...v}; key = "s"; v = v[key]; continue;
2539
+ case "STagged": at = at[key] = {...v, "s": $0m3(v["s"])}; key = "rest"; v = v[key]; continue;
2540
+ case "STagEnd": at[key] = v; return top[0];
2541
+ case "SBool": at[key] = v; return top[0];
2542
+ case "STrue": at[key] = v; return top[0];
2543
+ case "SEnum": at[key] = v; return top[0];
2544
+ case "SVariant": at = at[key] = {...v, "s": $0m3(v["s"])}; key = "rest"; v = v[key]; continue;
2545
+ case "SVEnd": at[key] = v; return top[0];
2546
+ case "STuple": at = at[key] = {...v, "s": $0m3(v["s"])}; key = "rest"; v = v[key]; continue;
2547
+ case "STEnd": at[key] = v; return top[0];
2548
+ case "SOptional": at = at[key] = {...v}; key = "inner"; v = v[key]; continue;
2549
+ case "SListLen": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; key = "s"; v = v[key]; continue;
2550
+ default: throw "bend: Schema has no tag " + v?.$ + " (its tags: SNat, SNatIn, SStr, SStrLen, SOpt, SList, SField, SEnd, SRule, SStrict, STagged, STagEnd, SBool, STrue, SEnum, SVariant, SVEnd, STuple, STEnd, SOptional, SListLen); a tag names its constructor as the"
2551
+ + " loading file sees it, which a later version will make the same"
2552
+ + " everywhere (#1105)";
2553
+ }
2554
+ }
2555
+ }
2556
+
2557
+ function $0m4(v) {
2558
+ const top = [v];
2559
+ for (let at = top, key = 0;;) {
2560
+ switch (v.$) {
2561
+ case "Missing": at[key] = v; return top[0];
2562
+ case "NotNat": at[key] = v; return top[0];
2563
+ case "NotString": at[key] = v; return top[0];
2564
+ case "NotBool": at[key] = v; return top[0];
2565
+ case "NotList": at[key] = v; return top[0];
2566
+ case "NotObject": at[key] = v; return top[0];
2567
+ case "NoElements": at[key] = v; return top[0];
2568
+ case "OpenNotLast": at[key] = v; return top[0];
2569
+ case "LastNotOpen": at[key] = v; return top[0];
2570
+ case "NotIncreasing": at = at[key] = {...v, "prev": nat_host(v["prev"]), "got": nat_host(v["got"])}; return top[0];
2571
+ case "NotTrue": at[key] = v; return top[0];
2572
+ case "NotOneOf": at[key] = v; return top[0];
2573
+ case "NoVariant": at[key] = v; return top[0];
2574
+ case "TwoVariants": at[key] = v; return top[0];
2575
+ case "TooShort": at[key] = v; return top[0];
2576
+ case "TooLong": at[key] = v; return top[0];
2577
+ case "LengthNotIn": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; return top[0];
2578
+ case "NotIn": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; return top[0];
2579
+ case "UnknownKey": at[key] = v; return top[0];
2580
+ case "RepeatedKey": at[key] = v; return top[0];
2581
+ case "TooLarge": at[key] = v; return top[0];
2582
+ case "CountNotIn": at = at[key] = {...v, "lo": nat_host(v["lo"]), "hi": nat_host(v["hi"])}; return top[0];
2583
+ default: throw "bend: Why has no tag " + v?.$ + " (its tags: Missing, NotNat, NotString, NotBool, NotList, NotObject, NoElements, OpenNotLast, LastNotOpen, NotIncreasing, NotTrue, NotOneOf, NoVariant, TwoVariants, TooShort, TooLong, LengthNotIn, NotIn, UnknownKey, RepeatedKey, TooLarge, CountNotIn); a tag names its constructor as the"
2584
+ + " loading file sees it, which a later version will make the same"
2585
+ + " everywhere (#1105)";
2586
+ }
2587
+ }
2588
+ }
2589
+
2590
+ function $0m5(v) {
2591
+ const top = [v];
2592
+ for (let at = top, key = 0;;) {
2593
+ switch (v.$) {
2594
+ case "Missing": at[key] = v; return top[0];
2595
+ case "NotNat": at[key] = v; return top[0];
2596
+ case "NotString": at[key] = v; return top[0];
2597
+ case "NotBool": at[key] = v; return top[0];
2598
+ case "NotList": at[key] = v; return top[0];
2599
+ case "NotObject": at[key] = v; return top[0];
2600
+ case "NoElements": at[key] = v; return top[0];
2601
+ case "OpenNotLast": at[key] = v; return top[0];
2602
+ case "LastNotOpen": at[key] = v; return top[0];
2603
+ case "NotIncreasing": at = at[key] = {...v, "prev": BigInt(v["prev"]), "got": BigInt(v["got"])}; return top[0];
2604
+ case "NotTrue": at[key] = v; return top[0];
2605
+ case "NotOneOf": at[key] = v; return top[0];
2606
+ case "NoVariant": at[key] = v; return top[0];
2607
+ case "TwoVariants": at[key] = v; return top[0];
2608
+ case "TooShort": at[key] = v; return top[0];
2609
+ case "TooLong": at[key] = v; return top[0];
2610
+ case "LengthNotIn": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; return top[0];
2611
+ case "NotIn": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; return top[0];
2612
+ case "UnknownKey": at[key] = v; return top[0];
2613
+ case "RepeatedKey": at[key] = v; return top[0];
2614
+ case "TooLarge": at[key] = v; return top[0];
2615
+ case "CountNotIn": at = at[key] = {...v, "lo": BigInt(v["lo"]), "hi": BigInt(v["hi"])}; return top[0];
2616
+ default: throw "bend: Why has no tag " + v?.$ + " (its tags: Missing, NotNat, NotString, NotBool, NotList, NotObject, NoElements, OpenNotLast, LastNotOpen, NotIncreasing, NotTrue, NotOneOf, NoVariant, TwoVariants, TooShort, TooLong, LengthNotIn, NotIn, UnknownKey, RepeatedKey, TooLarge, CountNotIn); a tag names its constructor as the"
2617
+ + " loading file sees it, which a later version will make the same"
2618
+ + " everywhere (#1105)";
2619
+ }
2620
+ }
2621
+ }
2622
+
2623
+ function $0m9(v) {
2624
+ const top = [v];
2625
+ for (let at = top, key = 0;;) {
2626
+ switch (v.$) {
2627
+ case "AtIndex": at = at[key] = {...v, "i": BigInt(v["i"])}; return top[0];
2628
+ case "AtField": at = at[key] = {...v, "skip": BigInt(v["skip"])}; return top[0];
2629
+ case "BoundAt": at = at[key] = {...v, "i": BigInt(v["i"])}; return top[0];
2630
+ case "AtKey": at[key] = v; return top[0];
2631
+ default: throw "bend: Step has no tag " + v?.$ + " (its tags: AtIndex, AtField, BoundAt, AtKey); a tag names its constructor as the"
2632
+ + " loading file sees it, which a later version will make the same"
2633
+ + " everywhere (#1105)";
2634
+ }
2635
+ }
2636
+ }
2637
+
2638
+ function $0m8(v) {
2639
+ const top = [v];
2640
+ for (let at = top, key = 0;;) {
2641
+ switch (v.$) {
2642
+ case "Nil": at[key] = v; return top[0];
2643
+ case "Con": at = at[key] = {...v, "head": $0m9(v["head"])}; key = "tail"; v = v[key]; continue;
2644
+ default: throw "bend: List has no tag " + v?.$ + " (its tags: Nil, Con); a tag names its constructor as the"
2645
+ + " loading file sees it, which a later version will make the same"
2646
+ + " everywhere (#1105)";
2647
+ }
2648
+ }
2649
+ }
2650
+
2651
+ function $0m7(v) {
2652
+ const top = [v];
2653
+ for (let at = top, key = 0;;) {
2654
+ switch (v.$) {
2655
+ case "Err": at = at[key] = {...v, "path": $0m8(v["path"]), "why": $0m5(v["why"])}; return top[0];
2656
+ default: throw "bend: Err has no tag " + v?.$ + " (its tags: Err); a tag names its constructor as the"
2657
+ + " loading file sees it, which a later version will make the same"
2658
+ + " everywhere (#1105)";
2659
+ }
2660
+ }
2661
+ }
2662
+
2663
+ function $0m6(v) {
2664
+ const top = [v];
2665
+ for (let at = top, key = 0;;) {
2666
+ switch (v.$) {
2667
+ case "None": at[key] = v; return top[0];
2668
+ case "Some": at = at[key] = {...v, "value": $0m7(v["value"])}; return top[0];
2669
+ default: throw "bend: Maybe has no tag " + v?.$ + " (its tags: None, Some); a tag names its constructor as the"
2670
+ + " loading file sees it, which a later version will make the same"
2671
+ + " everywhere (#1105)";
2672
+ }
2673
+ }
2674
+ }
2675
+
2676
+ function $0m10(v) {
2677
+ const top = [v];
2678
+ for (let at = top, key = 0;;) {
2679
+ switch (v.$) {
2680
+ case "AtIndex": at = at[key] = {...v, "i": nat_host(v["i"])}; return top[0];
2681
+ case "AtField": at = at[key] = {...v, "skip": nat_host(v["skip"])}; return top[0];
2682
+ case "BoundAt": at = at[key] = {...v, "i": nat_host(v["i"])}; return top[0];
2683
+ case "AtKey": at[key] = v; return top[0];
2684
+ default: throw "bend: Step has no tag " + v?.$ + " (its tags: AtIndex, AtField, BoundAt, AtKey); a tag names its constructor as the"
2685
+ + " loading file sees it, which a later version will make the same"
2686
+ + " everywhere (#1105)";
2687
+ }
2688
+ }
2689
+ }
2690
+
2691
+ function $0m13(v) {
2692
+ const top = [v];
2693
+ for (let at = top, key = 0;;) {
2694
+ switch (v.$) {
2695
+ case "Nil": at[key] = v; return top[0];
2696
+ case "Con": at = at[key] = {...v, "head": $0m10(v["head"])}; key = "tail"; v = v[key]; continue;
2697
+ default: throw "bend: List has no tag " + v?.$ + " (its tags: Nil, Con); a tag names its constructor as the"
2698
+ + " loading file sees it, which a later version will make the same"
2699
+ + " everywhere (#1105)";
2700
+ }
2701
+ }
2702
+ }
2703
+
2704
+ function $0m12(v) {
2705
+ const top = [v];
2706
+ for (let at = top, key = 0;;) {
2707
+ switch (v.$) {
2708
+ case "Err": at = at[key] = {...v, "path": $0m13(v["path"]), "why": $0m4(v["why"])}; return top[0];
2709
+ default: throw "bend: Err has no tag " + v?.$ + " (its tags: Err); a tag names its constructor as the"
2710
+ + " loading file sees it, which a later version will make the same"
2711
+ + " everywhere (#1105)";
2712
+ }
2713
+ }
2714
+ }
2715
+
2716
+ function $0m11(v) {
2717
+ const top = [v];
2718
+ for (let at = top, key = 0;;) {
2719
+ switch (v.$) {
2720
+ case "None": at[key] = v; return top[0];
2721
+ case "Some": at = at[key] = {...v, "value": $0m12(v["value"])}; return top[0];
2722
+ default: throw "bend: Maybe has no tag " + v?.$ + " (its tags: None, Some); a tag names its constructor as the"
2723
+ + " loading file sees it, which a later version will make the same"
2724
+ + " everywhere (#1105)";
2725
+ }
2726
+ }
2727
+ }
2728
+
2729
+ function $0m14(v) {
2730
+ const top = [v];
2731
+ for (let at = top, key = 0;;) {
2732
+ switch (v.$) {
2733
+ case "None": at[key] = v; return top[0];
2734
+ case "Some": at = at[key] = {...v, "value": $0m4(v["value"])}; return top[0];
2735
+ default: throw "bend: Maybe has no tag " + v?.$ + " (its tags: None, Some); a tag names its constructor as the"
2736
+ + " loading file sees it, which a later version will make the same"
2737
+ + " everywhere (#1105)";
2738
+ }
2739
+ }
2740
+ }
2741
+
2742
+ function $0m15(v) {
2743
+ const top = [v];
2744
+ for (let at = top, key = 0;;) {
2745
+ switch (v.$) {
2746
+ case "None": at[key] = v; return top[0];
2747
+ case "Some": at = at[key] = {...v, "value": $0m5(v["value"])}; return top[0];
2748
+ default: throw "bend: Maybe has no tag " + v?.$ + " (its tags: None, Some); a tag names its constructor as the"
2749
+ + " loading file sees it, which a later version will make the same"
2750
+ + " everywhere (#1105)";
2751
+ }
2752
+ }
2753
+ }
2754
+
2755
+ function $0m16(v) {
2756
+ const top = [v];
2757
+ for (let at = top, key = 0;;) {
2758
+ switch (v.$) {
2759
+ case "Nil": at[key] = v; return top[0];
2760
+ case "Con": at = at[key] = {...v, "head": $0m2(v["head"])}; key = "tail"; v = v[key]; continue;
2761
+ default: throw "bend: List has no tag " + v?.$ + " (its tags: Nil, Con); a tag names its constructor as the"
2762
+ + " loading file sees it, which a later version will make the same"
2763
+ + " everywhere (#1105)";
2764
+ }
2765
+ }
2766
+ }
2767
+
2768
+ function $0m17(v) {
2769
+ const top = [v];
2770
+ for (let at = top, key = 0;;) {
2771
+ switch (v.$) {
2772
+ case "Nil": at[key] = v; return top[0];
2773
+ case "Con": at = at[key] = {...v, "head": $0m3(v["head"])}; key = "tail"; v = v[key]; continue;
2774
+ default: throw "bend: List has no tag " + v?.$ + " (its tags: Nil, Con); a tag names its constructor as the"
2775
+ + " loading file sees it, which a later version will make the same"
2776
+ + " everywhere (#1105)";
2777
+ }
2778
+ }
2779
+ }
2780
+ const $bend_emit = {
2781
+ "pick_raw": run_lib((a0, a1, a2) => { const r = $0m1(run_loop($pick_raw$((a0), $0m0(a1), $0m0(a2)))); (a0); $0m1(a1); $0m1(a2); return r; }, 3),
2782
+ "lookup": run_lib((a0, a1) => { const r = $0m1(run_loop($lookup$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2783
+ "pick_bool": run_lib((a0, a1, a2) => { const r = (run_loop($pick_bool$((a0), (a1), (a2)))); (a0); (a1); (a2); return r; }, 3),
2784
+ "is_rnil": run_lib((a0) => { const r = (run_loop($is_rnil$($0m0(a0)))); $0m1(a0); return r; }, 1),
2785
+ "is_missing": run_lib((a0) => { const r = (run_loop($is_missing$($0m0(a0)))); $0m1(a0); return r; }, 1),
2786
+ "in_names": run_lib((a0, a1) => { const r = (run_loop($in_names$((a0), (a1)))); (a0); (a1); return r; }, 2),
2787
+ "none_present": run_lib((a0, a1) => { const r = (run_loop($none_present$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2788
+ "key_names": run_lib((a0) => { const r = (run_loop($key_names$($0m2(a0)))); $0m3(a0); return r; }, 1),
2789
+ "no_extra": run_lib((a0, a1) => { const r = (run_loop($no_extra$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2790
+ "drop_key": run_lib((a0, a1) => { const r = $0m1(run_loop($drop_key$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2791
+ "is_str": run_lib((a0, a1) => { const r = (run_loop($is_str$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2792
+ "is_tag": run_lib((a0, a1, a2) => { const r = (run_loop($is_tag$((a0), (a1), $0m0(a2)))); (a0); (a1); $0m1(a2); return r; }, 3),
2793
+ "in_err": run_lib((a0, a1) => { const r = $0m6(run_loop($in_err$((a0), $0m4(a1)))); (a0); $0m5(a1); return r; }, 2),
2794
+ "str_len_ok": run_lib((a0, a1, a2) => { const r = (run_loop($str_len_ok$(nat_host(a0), nat_host(a1), (a2)))); BigInt(a0); BigInt(a1); (a2); return r; }, 3),
2795
+ "num_ok": run_lib((a0, a1, a2) => { const r = (run_loop($num_ok$(nat_host(a0), nat_host(a1), nat_host(a2)))); BigInt(a0); BigInt(a1); BigInt(a2); return r; }, 3),
2796
+ "len_ok": run_lib((a0, a1, a2) => { const r = (run_loop($len_ok$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2797
+ "str_len_in": run_lib((a0, a1, a2) => { const r = $0m6(run_loop($str_len_in$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2798
+ "nat_in": run_lib((a0, a1, a2) => { const r = $0m6(run_loop($nat_in$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2799
+ "is_bool": run_lib((a0) => { const r = (run_loop($is_bool$($0m0(a0)))); $0m1(a0); return r; }, 1),
2800
+ "raw_list": run_lib((a0) => { const r = (run_loop($raw_list$($0m0(a0)))); $0m1(a0); return r; }, 1),
2801
+ "raw_len": run_lib((a0) => { const r = BigInt(run_loop($raw_len$($0m0(a0)))); $0m1(a0); return r; }, 1),
2802
+ "count_ok": run_lib((a0, a1, a2) => { const r = (run_loop($count_ok$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2803
+ "list_len_ok": run_lib((a0, a1, a2) => { const r = (run_loop($list_len_ok$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2804
+ "has_key": run_lib((a0, a1) => { const r = (run_loop($has_key$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2805
+ "key_once_at": run_lib((a0, a1, a2) => { const r = (run_loop($key_once_at$($0m0(a0), (a1), (a2)))); $0m1(a0); (a1); (a2); return r; }, 3),
2806
+ "key_once": run_lib((a0, a1) => { const r = (run_loop($key_once$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2807
+ "key_err": run_lib((a0, a1) => { const r = $0m6(run_loop($key_err$((a0), (a1)))); (a0); (a1); return r; }, 2),
2808
+ "here": run_lib((a0) => { const r = $0m6(run_loop($here$($0m4(a0)))); $0m5(a0); return r; }, 1),
2809
+ "under": run_lib((a0, a1) => { const r = $0m6(run_loop($under$($0m10(a0), $0m11(a1)))); $0m9(a0); $0m6(a1); return r; }, 2),
2810
+ "len_err": run_lib((a0, a1, a2) => { const r = $0m6(run_loop($len_err$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2811
+ "later_l_path": run_lib((a0) => { const r = $0m8(run_loop($later_l_path$($0m13(a0)))); $0m8(a0); return r; }, 1),
2812
+ "later_l": run_lib((a0) => { const r = $0m6(run_loop($later_l$($0m11(a0)))); $0m6(a0); return r; }, 1),
2813
+ "later_i_path": run_lib((a0) => { const r = $0m8(run_loop($later_i_path$($0m13(a0)))); $0m8(a0); return r; }, 1),
2814
+ "later_i": run_lib((a0) => { const r = $0m6(run_loop($later_i$($0m11(a0)))); $0m6(a0); return r; }, 1),
2815
+ "later_f_path": run_lib((a0) => { const r = $0m8(run_loop($later_f_path$($0m13(a0)))); $0m8(a0); return r; }, 1),
2816
+ "later_f": run_lib((a0) => { const r = $0m6(run_loop($later_f$($0m11(a0)))); $0m6(a0); return r; }, 1),
2817
+ "first": run_lib((a0, a1) => { const r = $0m6(run_loop($first$($0m11(a0), $0m11(a1)))); $0m6(a0); $0m6(a1); return r; }, 2),
2818
+ "missing_or": run_lib((a0, a1) => { const r = $0m5(run_loop($missing_or$($0m0(a0), $0m4(a1)))); $0m1(a0); $0m5(a1); return r; }, 2),
2819
+ "pick_err": run_lib((a0, a1, a2) => { const r = $0m6(run_loop($pick_err$((a0), $0m11(a1), $0m11(a2)))); (a0); $0m6(a1); $0m6(a2); return r; }, 3),
2820
+ "true_err": run_lib((a0) => { const r = $0m6(run_loop($true_err$((a0)))); (a0); return r; }, 1),
2821
+ "enum_err": run_lib((a0) => { const r = $0m6(run_loop($enum_err$((a0)))); (a0); return r; }, 1),
2822
+ "dup_err": run_lib((a0, a1) => { const r = $0m6(run_loop($dup_err$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2823
+ "extra_err": run_lib((a0, a1) => { const r = $0m6(run_loop($extra_err$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2824
+ "tag_err": run_lib((a0, a1) => { const r = $0m6(run_loop($tag_err$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2825
+ "count_err": run_lib((a0, a1, a2) => { const r = $0m6(run_loop($count_err$(nat_host(a0), nat_host(a1), $0m0(a2)))); BigInt(a0); BigInt(a1); $0m1(a2); return r; }, 3),
2826
+ "guard": run_lib((a0, a1) => { const r = $0m15(run_loop($guard$((a0), $0m14(a1)))); (a0); $0m15(a1); return r; }, 2),
2827
+ "nat_in_defect": run_lib((a0, a1, a2, a3) => { const r = $0m15(run_loop($nat_in_defect$(nat_host(a0), nat_host(a1), $0m0(a2), $0m13(a3)))); BigInt(a0); BigInt(a1); $0m1(a2); $0m8(a3); return r; }, 4),
2828
+ "bool_defect": run_lib((a0, a1) => { const r = $0m15(run_loop($bool_defect$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2829
+ "no_rule": run_lib((a0, a1) => { const r = $0m6(run_loop($no_rule$(nat_host(a0), $0m0(a1)))); BigInt(a0); $0m1(a1); return r; }, 2),
2830
+ "first_why": run_lib((a0, a1) => { const r = $0m15(run_loop($first_why$($0m14(a0), $0m14(a1)))); $0m15(a0); $0m15(a1); return r; }, 2),
2831
+ "step_eq": run_lib((a0, a1) => { const r = (run_loop($step_eq$($0m10(a0), $0m10(a1)))); $0m9(a0); $0m9(a1); return r; }, 2),
2832
+ "path_eq": run_lib((a0, a1) => { const r = (run_loop($path_eq$($0m13(a0), $0m13(a1)))); $0m8(a0); $0m8(a1); return r; }, 2),
2833
+ "rule_defect": run_lib((a0, a1) => { const r = $0m15(run_loop($rule_defect$($0m11(a0), $0m13(a1)))); $0m6(a0); $0m8(a1); return r; }, 2),
2834
+ "not_list": run_lib((a0, a1) => { const r = $0m15(run_loop($not_list$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2835
+ "not_object": run_lib((a0, a1) => { const r = $0m15(run_loop($not_object$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2836
+ "nat_defect": run_lib((a0, a1) => { const r = $0m15(run_loop($nat_defect$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2837
+ "str_defect": run_lib((a0, a1) => { const r = $0m15(run_loop($str_defect$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2838
+ "pick_why": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($pick_why$((a0), $0m14(a1), $0m14(a2)))); (a0); $0m15(a1); $0m15(a2); return r; }, 3),
2839
+ "true_defect": run_lib((a0, a1) => { const r = $0m15(run_loop($true_defect$($0m0(a0), $0m13(a1)))); $0m1(a0); $0m8(a1); return r; }, 2),
2840
+ "enum_defect": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($enum_defect$((a0), $0m0(a1), $0m13(a2)))); (a0); $0m1(a1); $0m8(a2); return r; }, 3),
2841
+ "no_variant": run_lib((a0) => { const r = $0m15(run_loop($no_variant$($0m13(a0)))); $0m8(a0); return r; }, 1),
2842
+ "dup_defect": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($dup_defect$($0m2(a0), $0m0(a1), $0m13(a2)))); $0m3(a0); $0m1(a1); $0m8(a2); return r; }, 3),
2843
+ "at_end": run_lib((a0, a1) => { const r = $0m15(run_loop($at_end$($0m4(a0), $0m13(a1)))); $0m5(a0); $0m8(a1); return r; }, 2),
2844
+ "extra_defect": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($extra_defect$((a0), $0m0(a1), $0m13(a2)))); (a0); $0m1(a1); $0m8(a2); return r; }, 3),
2845
+ "tag_defect": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($tag_defect$((a0), $0m0(a1), $0m13(a2)))); (a0); $0m1(a1); $0m8(a2); return r; }, 3),
2846
+ "tag_key_defect": run_lib((a0, a1, a2) => { const r = $0m15(run_loop($tag_key_defect$((a0), (a1), $0m13(a2)))); (a0); (a1); $0m8(a2); return r; }, 3),
2847
+ "check0": run_lib((a0, a1) => { const r = $0m6(run_loop($check0$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2848
+ "conforms0": run_lib((a0, a1) => { const r = (run_loop($conforms0$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2849
+ "is_chain": run_lib((a0) => { const r = (run_loop($is_chain$($0m2(a0)))); $0m3(a0); return r; }, 1),
2850
+ "is_object": run_lib((a0) => { const r = (run_loop($is_object$($0m0(a0)))); $0m1(a0); return r; }, 1),
2851
+ "one_if_there": run_lib((a0) => { const r = BigInt(run_loop($one_if_there$((a0)))); (a0); return r; }, 1),
2852
+ "count_present": run_lib((a0, a1) => { const r = BigInt(run_loop($count_present$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2853
+ "tuple_of": run_lib((a0) => { const r = $0m3(run_loop($tuple_of$($0m16(a0)))); $0m17(a0); return r; }, 1),
2854
+ "at_raw": run_lib((a0, a1) => { const r = $0m1(run_loop($at_raw$($0m0(a0), nat_host(a1)))); $0m1(a0); BigInt(a1); return r; }, 2),
2855
+ "count_unknown": run_lib((a0, a1) => { const r = BigInt(run_loop($count_unknown$((a0), $0m0(a1)))); (a0); $0m1(a1); return r; }, 2),
2856
+ "Meaning": run_lib((a0) => { const r = (run_loop($Meaning$($0m2(a0)))); $0m3(a0); return r; }, 1),
2857
+ "enc": run_lib((a0, a1) => { const r = $0m1(run_loop($enc$($0m2(a0), (a1)))); $0m3(a0); (a1); return r; }, 2),
2858
+ "lcons": run_lib((a0, a1) => { const r = (run_loop($lcons$((a0), (a1)))); (a0); (a1); return r; }, 2),
2859
+ "both": run_lib((a0, a1) => { const r = (run_loop($both$((a0), (a1)))); (a0); (a1); return r; }, 2),
2860
+ "opt_some": run_lib((a0) => { const r = (run_loop($opt_some$((a0)))); (a0); return r; }, 1),
2861
+ "map_inl": run_lib((a0) => { const r = (run_loop($map_inl$((a0)))); (a0); return r; }, 1),
2862
+ "map_inr": run_lib((a0) => { const r = (run_loop($map_inr$((a0)))); (a0); return r; }, 1),
2863
+ "pick_m": run_lib((a0, a1, a2) => { const r = (run_loop($pick_m$((a0), (a1), (a2)))); (a0); (a1); (a2); return r; }, 3),
2864
+ "true_unit": run_lib((a0) => { const r = (run_loop($true_unit$((a0)))); (a0); return r; }, 1),
2865
+ "nullish": run_lib((a0) => { const r = (run_loop($nullish$($0m0(a0)))); $0m1(a0); return r; }, 1),
2866
+ "dec": run_lib((a0, a1) => { const r = (run_loop($dec$($0m2(a0), $0m0(a1)))); $0m3(a0); $0m1(a1); return r; }, 2),
2867
+ "opt_at": run_lib((a0) => { const r = (run_loop($opt_at$($0m2(a0)))); $0m3(a0); return r; }, 1),
2868
+ "nullable": run_lib((a0) => { const r = (run_loop($nullable$($0m2(a0)))); $0m3(a0); return r; }, 1),
2869
+ "no_key": run_lib((a0, a1) => { const r = (run_loop($no_key$((a0), $0m2(a1)))); (a0); $0m3(a1); return r; }, 2),
2870
+ "fresh_f": run_lib((a0, a1) => { const r = (run_loop($fresh_f$((a0), $0m2(a1)))); (a0); $0m3(a1); return r; }, 2),
2871
+ "fresh_v": run_lib((a0, a1) => { const r = (run_loop($fresh_v$((a0), $0m2(a1)))); (a0); $0m3(a1); return r; }, 2),
2872
+ "is_keyed": run_lib((a0) => { const r = (run_loop($is_keyed$($0m2(a0)))); $0m3(a0); return r; }, 1),
2873
+ "fresh_t": run_lib((a0, a1, a2) => { const r = (run_loop($fresh_t$((a0), (a1), $0m2(a2)))); (a0); (a1); $0m3(a2); return r; }, 3),
2874
+ "wf": run_lib((a0) => { const r = (run_loop($wf$($0m2(a0)))); $0m3(a0); return r; }, 1),
2875
+ "names_ok": run_lib((a0, a1) => { const r = (run_loop($names_ok$($0m2(a0), (a1)))); $0m3(a0); (a1); return r; }, 2),
2876
+ "bounds_ok": run_lib((a0, a1) => { const r = (run_loop($bounds_ok$($0m2(a0), (a1)))); $0m3(a0); (a1); return r; }, 2),
2877
+ };
2878
+ export default $bend_emit;
2879
+ export const pick_raw = $bend_emit["pick_raw"];
2880
+ export const lookup = $bend_emit["lookup"];
2881
+ export const pick_bool = $bend_emit["pick_bool"];
2882
+ export const is_rnil = $bend_emit["is_rnil"];
2883
+ export const is_missing = $bend_emit["is_missing"];
2884
+ export const in_names = $bend_emit["in_names"];
2885
+ export const none_present = $bend_emit["none_present"];
2886
+ export const key_names = $bend_emit["key_names"];
2887
+ export const no_extra = $bend_emit["no_extra"];
2888
+ export const drop_key = $bend_emit["drop_key"];
2889
+ export const is_str = $bend_emit["is_str"];
2890
+ export const is_tag = $bend_emit["is_tag"];
2891
+ export const in_err = $bend_emit["in_err"];
2892
+ export const str_len_ok = $bend_emit["str_len_ok"];
2893
+ export const num_ok = $bend_emit["num_ok"];
2894
+ export const len_ok = $bend_emit["len_ok"];
2895
+ export const str_len_in = $bend_emit["str_len_in"];
2896
+ export const nat_in = $bend_emit["nat_in"];
2897
+ export const is_bool = $bend_emit["is_bool"];
2898
+ export const raw_list = $bend_emit["raw_list"];
2899
+ export const raw_len = $bend_emit["raw_len"];
2900
+ export const count_ok = $bend_emit["count_ok"];
2901
+ export const list_len_ok = $bend_emit["list_len_ok"];
2902
+ export const has_key = $bend_emit["has_key"];
2903
+ export const key_once_at = $bend_emit["key_once_at"];
2904
+ export const key_once = $bend_emit["key_once"];
2905
+ export const key_err = $bend_emit["key_err"];
2906
+ export const here = $bend_emit["here"];
2907
+ export const under = $bend_emit["under"];
2908
+ export const len_err = $bend_emit["len_err"];
2909
+ export const later_l_path = $bend_emit["later_l_path"];
2910
+ export const later_l = $bend_emit["later_l"];
2911
+ export const later_i_path = $bend_emit["later_i_path"];
2912
+ export const later_i = $bend_emit["later_i"];
2913
+ export const later_f_path = $bend_emit["later_f_path"];
2914
+ export const later_f = $bend_emit["later_f"];
2915
+ export const first = $bend_emit["first"];
2916
+ export const missing_or = $bend_emit["missing_or"];
2917
+ export const pick_err = $bend_emit["pick_err"];
2918
+ export const true_err = $bend_emit["true_err"];
2919
+ export const enum_err = $bend_emit["enum_err"];
2920
+ export const dup_err = $bend_emit["dup_err"];
2921
+ export const extra_err = $bend_emit["extra_err"];
2922
+ export const tag_err = $bend_emit["tag_err"];
2923
+ export const count_err = $bend_emit["count_err"];
2924
+ export const guard = $bend_emit["guard"];
2925
+ export const nat_in_defect = $bend_emit["nat_in_defect"];
2926
+ export const bool_defect = $bend_emit["bool_defect"];
2927
+ export const no_rule = $bend_emit["no_rule"];
2928
+ export const first_why = $bend_emit["first_why"];
2929
+ export const step_eq = $bend_emit["step_eq"];
2930
+ export const path_eq = $bend_emit["path_eq"];
2931
+ export const rule_defect = $bend_emit["rule_defect"];
2932
+ export const not_list = $bend_emit["not_list"];
2933
+ export const not_object = $bend_emit["not_object"];
2934
+ export const nat_defect = $bend_emit["nat_defect"];
2935
+ export const str_defect = $bend_emit["str_defect"];
2936
+ export const pick_why = $bend_emit["pick_why"];
2937
+ export const true_defect = $bend_emit["true_defect"];
2938
+ export const enum_defect = $bend_emit["enum_defect"];
2939
+ export const no_variant = $bend_emit["no_variant"];
2940
+ export const dup_defect = $bend_emit["dup_defect"];
2941
+ export const at_end = $bend_emit["at_end"];
2942
+ export const extra_defect = $bend_emit["extra_defect"];
2943
+ export const tag_defect = $bend_emit["tag_defect"];
2944
+ export const tag_key_defect = $bend_emit["tag_key_defect"];
2945
+ export const check0 = $bend_emit["check0"];
2946
+ export const conforms0 = $bend_emit["conforms0"];
2947
+ export const is_chain = $bend_emit["is_chain"];
2948
+ export const is_object = $bend_emit["is_object"];
2949
+ export const one_if_there = $bend_emit["one_if_there"];
2950
+ export const count_present = $bend_emit["count_present"];
2951
+ export const tuple_of = $bend_emit["tuple_of"];
2952
+ export const at_raw = $bend_emit["at_raw"];
2953
+ export const count_unknown = $bend_emit["count_unknown"];
2954
+ export const Meaning = $bend_emit["Meaning"];
2955
+ export const enc = $bend_emit["enc"];
2956
+ export const lcons = $bend_emit["lcons"];
2957
+ export const both = $bend_emit["both"];
2958
+ export const opt_some = $bend_emit["opt_some"];
2959
+ export const map_inl = $bend_emit["map_inl"];
2960
+ export const map_inr = $bend_emit["map_inr"];
2961
+ export const pick_m = $bend_emit["pick_m"];
2962
+ export const true_unit = $bend_emit["true_unit"];
2963
+ export const nullish = $bend_emit["nullish"];
2964
+ export const dec = $bend_emit["dec"];
2965
+ export const opt_at = $bend_emit["opt_at"];
2966
+ export const nullable = $bend_emit["nullable"];
2967
+ export const no_key = $bend_emit["no_key"];
2968
+ export const fresh_f = $bend_emit["fresh_f"];
2969
+ export const fresh_v = $bend_emit["fresh_v"];
2970
+ export const is_keyed = $bend_emit["is_keyed"];
2971
+ export const fresh_t = $bend_emit["fresh_t"];
2972
+ export const wf = $bend_emit["wf"];
2973
+ export const names_ok = $bend_emit["names_ok"];
2974
+ export const bounds_ok = $bend_emit["bounds_ok"];