@explorable-viz/fluid 0.11.4 → 0.12.2

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.
Files changed (71) hide show
  1. package/README.md +22 -9
  2. package/dist/fluid/fluid/lib/graphics.fld +60 -60
  3. package/dist/fluid/fluid/lib/matrix.fld +17 -17
  4. package/dist/fluid/fluid/lib/prelude.fld +36 -35
  5. package/dist/fluid/fluid/lib/stats.fld +19 -19
  6. package/dist/fluid/shared/fluid.mjs +1044 -2141
  7. package/dist/fluid/shared/load-figure.js +1123 -2147
  8. package/dist/fluid/shared/webtest-lib.js +124 -124
  9. package/package.json +1 -1
  10. package/website/article/css/styles.css +3 -3
  11. package/website/article/fluid/1805.02474v1-10.fld +2 -2
  12. package/website/article/fluid/bar-chart-line-chart.fld +1 -1
  13. package/website/article/fluid/convolution.fld +14 -17
  14. package/website/article/fluid/dataset/scigen/_1805_02474v1_10.fld +1 -1
  15. package/website/article/fluid/methane_data.fld +1 -1
  16. package/website/article/fluid/moving-average.fld +1 -1
  17. package/website/article/fluid/non-renewables.fld +1 -1
  18. package/website/article/fluid/nonRenewables.fld +2 -2
  19. package/website/article/fluid/renewables.fld +1 -1
  20. package/website/article/fluid/scigen.fld +3 -3
  21. package/website/article/fluid/util.fld +4 -4
  22. package/.spago/aff/v7.0.0/.editorconfig +0 -13
  23. package/.spago/aff/v7.0.0/.eslintrc.json +0 -28
  24. package/.spago/aff/v7.0.0/.gitignore +0 -14
  25. package/.spago/aff/v7.0.0/.tidyrc.json +0 -10
  26. package/.spago/argonaut-codecs/v9.0.0/.editorconfig +0 -13
  27. package/.spago/argonaut-codecs/v9.0.0/.gitignore +0 -9
  28. package/.spago/argonaut-codecs/v9.0.0/.tidyrc.json +0 -10
  29. package/.spago/arrays/v7.0.0/.eslintrc.json +0 -26
  30. package/.spago/arrays/v7.0.0/.gitignore +0 -9
  31. package/.spago/console/v6.0.0/.eslintrc.json +0 -30
  32. package/.spago/console/v6.0.0/.gitignore +0 -9
  33. package/.spago/debug/v6.0.0/.eslintrc.json +0 -36
  34. package/.spago/debug/v6.0.0/.gitignore +0 -8
  35. package/.spago/enums/v6.0.0/.gitignore +0 -7
  36. package/.spago/foreign-object/v4.0.0/.eslintrc.json +0 -26
  37. package/.spago/foreign-object/v4.0.0/.gitignore +0 -8
  38. package/.spago/free/v7.0.0/.gitignore +0 -8
  39. package/.spago/graphs/v8.0.0/.gitignore +0 -7
  40. package/.spago/js-uri/v3.0.0/.eslintrc.json +0 -30
  41. package/.spago/js-uri/v3.0.0/.gitignore +0 -14
  42. package/.spago/js-uri/v3.0.0/.tidyrc.json +0 -10
  43. package/.spago/node-buffer/v8.0.0/.eslintrc.json +0 -26
  44. package/.spago/node-buffer/v8.0.0/.gitignore +0 -8
  45. package/.spago/node-child-process/v9.0.0/.eslintrc.json +0 -29
  46. package/.spago/node-child-process/v9.0.0/.gitignore +0 -8
  47. package/.spago/node-process/v10.0.0/.eslintrc.json +0 -29
  48. package/.spago/node-process/v10.0.0/.gitignore +0 -8
  49. package/.spago/node-streams/v7.0.0/.eslintrc.json +0 -29
  50. package/.spago/node-streams/v7.0.0/.gitignore +0 -8
  51. package/.spago/optparse/v5.0.0/.gitignore +0 -8
  52. package/.spago/optparse/v5.0.0/.npmrc +0 -1
  53. package/.spago/ordered-collections/v3.0.0/.gitignore +0 -8
  54. package/.spago/parallel/v6.0.0/.gitignore +0 -7
  55. package/.spago/parsing/v10.0.0/.editorconfig +0 -13
  56. package/.spago/parsing/v10.0.0/.gitignore +0 -10
  57. package/.spago/parsing/v10.0.0/.tidyoperators +0 -231
  58. package/.spago/parsing/v10.0.0/.tidyrc.json +0 -10
  59. package/.spago/prelude/v6.0.0/.eslintrc.json +0 -26
  60. package/.spago/prelude/v6.0.0/.gitignore +0 -8
  61. package/.spago/st/v6.0.0/.eslintrc.json +0 -26
  62. package/.spago/st/v6.0.0/.gitignore +0 -8
  63. package/.spago/strings/v6.0.0/.eslintrc.json +0 -26
  64. package/.spago/strings/v6.0.0/.gitignore +0 -8
  65. package/.spago/tailrec/v6.0.0/.gitignore +0 -7
  66. package/.spago/web-html/v4.0.0/.eslintrc.json +0 -29
  67. package/.spago/web-html/v4.0.0/.gitignore +0 -8
  68. package/.spago/web-xhr/v5.0.0/.eslintrc.json +0 -29
  69. package/.spago/web-xhr/v5.0.0/.gitignore +0 -8
  70. package/website/article/.DS_Store +0 -0
  71. package/website/article/dataset/.DS_Store +0 -0
@@ -5043,8 +5043,8 @@ function dynamicFacetSlot(addresses2, facet, providers) {
5043
5043
  for (let i = 0; i < providerAddrs.length; i++) {
5044
5044
  let value = getAddr(state, providerAddrs[i]);
5045
5045
  if (providerTypes[i] == 2)
5046
- for (let val of value)
5047
- values2.push(val);
5046
+ for (let val2 of value)
5047
+ values2.push(val2);
5048
5048
  else
5049
5049
  values2.push(value);
5050
5050
  }
@@ -5742,7 +5742,7 @@ var EditorState = class _EditorState {
5742
5742
  if (effect.is(Compartment.reconfigure)) {
5743
5743
  if (conf) {
5744
5744
  compartments = /* @__PURE__ */ new Map();
5745
- conf.compartments.forEach((val, key) => compartments.set(key, val));
5745
+ conf.compartments.forEach((val2, key) => compartments.set(key, val2));
5746
5746
  conf = null;
5747
5747
  }
5748
5748
  compartments.set(effect.value.compartment, effect.value.extension);
@@ -6117,30 +6117,30 @@ var Chunk = class _Chunk {
6117
6117
  map(offset, changes) {
6118
6118
  let value = [], from = [], to = [], newPos = -1, maxPoint = -1;
6119
6119
  for (let i = 0; i < this.value.length; i++) {
6120
- let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo;
6120
+ let val2 = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo;
6121
6121
  if (curFrom == curTo) {
6122
- let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);
6122
+ let mapped = changes.mapPos(curFrom, val2.startSide, val2.mapMode);
6123
6123
  if (mapped == null)
6124
6124
  continue;
6125
6125
  newFrom = newTo = mapped;
6126
- if (val.startSide != val.endSide) {
6127
- newTo = changes.mapPos(curFrom, val.endSide);
6126
+ if (val2.startSide != val2.endSide) {
6127
+ newTo = changes.mapPos(curFrom, val2.endSide);
6128
6128
  if (newTo < newFrom)
6129
6129
  continue;
6130
6130
  }
6131
6131
  } else {
6132
- newFrom = changes.mapPos(curFrom, val.startSide);
6133
- newTo = changes.mapPos(curTo, val.endSide);
6134
- if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)
6132
+ newFrom = changes.mapPos(curFrom, val2.startSide);
6133
+ newTo = changes.mapPos(curTo, val2.endSide);
6134
+ if (newFrom > newTo || newFrom == newTo && val2.startSide > 0 && val2.endSide <= 0)
6135
6135
  continue;
6136
6136
  }
6137
- if ((newTo - newFrom || val.endSide - val.startSide) < 0)
6137
+ if ((newTo - newFrom || val2.endSide - val2.startSide) < 0)
6138
6138
  continue;
6139
6139
  if (newPos < 0)
6140
6140
  newPos = newFrom;
6141
- if (val.point)
6141
+ if (val2.point)
6142
6142
  maxPoint = Math.max(maxPoint, newTo - newFrom);
6143
- value.push(val);
6143
+ value.push(val2);
6144
6144
  from.push(newFrom - newPos);
6145
6145
  to.push(newTo - newPos);
6146
6146
  }
@@ -6932,19 +6932,19 @@ var StyleSet = class {
6932
6932
  let sheet = this.sheet;
6933
6933
  let pos = 0, j = 0;
6934
6934
  for (let i = 0; i < modules.length; i++) {
6935
- let mod = modules[i], index2 = this.modules.indexOf(mod);
6935
+ let mod2 = modules[i], index2 = this.modules.indexOf(mod2);
6936
6936
  if (index2 < j && index2 > -1) {
6937
6937
  this.modules.splice(index2, 1);
6938
6938
  j--;
6939
6939
  index2 = -1;
6940
6940
  }
6941
6941
  if (index2 == -1) {
6942
- this.modules.splice(j++, 0, mod);
6943
- if (sheet) for (let k = 0; k < mod.rules.length; k++)
6944
- sheet.insertRule(mod.rules[k], pos++);
6942
+ this.modules.splice(j++, 0, mod2);
6943
+ if (sheet) for (let k = 0; k < mod2.rules.length; k++)
6944
+ sheet.insertRule(mod2.rules[k], pos++);
6945
6945
  } else {
6946
6946
  while (j < index2) pos += this.modules[j++].rules.length;
6947
- pos += mod.rules.length;
6947
+ pos += mod2.rules.length;
6948
6948
  j++;
6949
6949
  }
6950
6950
  }
@@ -11908,12 +11908,12 @@ var HeightMap = class _HeightMap {
11908
11908
  return new HeightMapBranch(_HeightMap.of(nodes.slice(0, i)), brk, _HeightMap.of(nodes.slice(j)));
11909
11909
  }
11910
11910
  };
11911
- function replace(old, val) {
11912
- if (old == val)
11911
+ function replace(old, val2) {
11912
+ if (old == val2)
11913
11913
  return old;
11914
- if (old.constructor != val.constructor)
11914
+ if (old.constructor != val2.constructor)
11915
11915
  heightChangeFlag = true;
11916
- return val;
11916
+ return val2;
11917
11917
  }
11918
11918
  HeightMap.prototype.size = 1;
11919
11919
  var HeightMapBlock = class extends HeightMap {
@@ -12908,9 +12908,9 @@ function findFraction(structure, pos) {
12908
12908
  return counted / structure.total;
12909
12909
  }
12910
12910
  function find2(array2, f) {
12911
- for (let val of array2)
12912
- if (f(val))
12913
- return val;
12911
+ for (let val2 of array2)
12912
+ if (f(val2))
12913
+ return val2;
12914
12914
  return void 0;
12915
12915
  }
12916
12916
  var IdScaler = {
@@ -14185,10 +14185,10 @@ var EditorView = class _EditorView {
14185
14185
  }
14186
14186
  docViewUpdate() {
14187
14187
  for (let plugin of this.plugins) {
14188
- let val = plugin.value;
14189
- if (val && val.docViewUpdate) {
14188
+ let val2 = plugin.value;
14189
+ if (val2 && val2.docViewUpdate) {
14190
14190
  try {
14191
- val.docViewUpdate(this);
14191
+ val2.docViewUpdate(this);
14192
14192
  } catch (e) {
14193
14193
  logException(this.state, e, "doc view update listener");
14194
14194
  }
@@ -14346,8 +14346,8 @@ var EditorView = class _EditorView {
14346
14346
  if (first)
14347
14347
  this.announceDOM.textContent = "";
14348
14348
  first = false;
14349
- let div = this.announceDOM.appendChild(document.createElement("div"));
14350
- div.textContent = effect.value;
14349
+ let div2 = this.announceDOM.appendChild(document.createElement("div"));
14350
+ div2.textContent = effect.value;
14351
14351
  }
14352
14352
  }
14353
14353
  mountStyles() {
@@ -14882,22 +14882,22 @@ function normalizeKeyName(name3, platform) {
14882
14882
  result = " ";
14883
14883
  let alt2, ctrl, shift2, meta2;
14884
14884
  for (let i = 0; i < parts.length - 1; ++i) {
14885
- const mod = parts[i];
14886
- if (/^(cmd|meta|m)$/i.test(mod))
14885
+ const mod2 = parts[i];
14886
+ if (/^(cmd|meta|m)$/i.test(mod2))
14887
14887
  meta2 = true;
14888
- else if (/^a(lt)?$/i.test(mod))
14888
+ else if (/^a(lt)?$/i.test(mod2))
14889
14889
  alt2 = true;
14890
- else if (/^(c|ctrl|control)$/i.test(mod))
14890
+ else if (/^(c|ctrl|control)$/i.test(mod2))
14891
14891
  ctrl = true;
14892
- else if (/^s(hift)?$/i.test(mod))
14892
+ else if (/^s(hift)?$/i.test(mod2))
14893
14893
  shift2 = true;
14894
- else if (/^mod$/i.test(mod)) {
14894
+ else if (/^mod$/i.test(mod2)) {
14895
14895
  if (platform == "mac")
14896
14896
  meta2 = true;
14897
14897
  else
14898
14898
  ctrl = true;
14899
14899
  } else
14900
- throw new Error("Unrecognized modifier name: " + mod);
14900
+ throw new Error("Unrecognized modifier name: " + mod2);
14901
14901
  }
14902
14902
  if (alt2)
14903
14903
  result = "Alt-" + result;
@@ -15310,8 +15310,8 @@ var gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
15310
15310
  return view2.textDirection == Direction.LTR ? { left: before, right: after } : { right: before, left: after };
15311
15311
  })
15312
15312
  });
15313
- function asArray2(val) {
15314
- return Array.isArray(val) ? val : [val];
15313
+ function asArray2(val2) {
15314
+ return Array.isArray(val2) ? val2 : [val2];
15315
15315
  }
15316
15316
  function advanceCursor(cursor2, collect, pos) {
15317
15317
  while (cursor2.value && cursor2.from <= pos) {
@@ -16213,10 +16213,10 @@ var TreeNode = class _TreeNode extends BaseNode {
16213
16213
  return this.nextChild(0, 1, pos, side, mode);
16214
16214
  }
16215
16215
  nextSignificantParent() {
16216
- let val = this;
16217
- while (val.type.isAnonymous && val._parent)
16218
- val = val._parent;
16219
- return val;
16216
+ let val2 = this;
16217
+ while (val2.type.isAnonymous && val2._parent)
16218
+ val2 = val2._parent;
16219
+ return val2;
16220
16220
  }
16221
16221
  get parent() {
16222
16222
  return this._parent ? this._parent.nextSignificantParent() : null;
@@ -17237,9 +17237,9 @@ var Tag = class _Tag {
17237
17237
  }
17238
17238
  toString() {
17239
17239
  let { name: name3 } = this;
17240
- for (let mod of this.modified)
17241
- if (mod.name)
17242
- name3 = `${mod.name}(${name3})`;
17240
+ for (let mod2 of this.modified)
17241
+ if (mod2.name)
17242
+ name3 = `${mod2.name}(${name3})`;
17243
17243
  return name3;
17244
17244
  }
17245
17245
  static define(nameOrParent, parent) {
@@ -17268,11 +17268,11 @@ var Tag = class _Tag {
17268
17268
  `m1(m3(t1)`, and so on.
17269
17269
  */
17270
17270
  static defineModifier(name3) {
17271
- let mod = new Modifier(name3);
17271
+ let mod2 = new Modifier(name3);
17272
17272
  return (tag) => {
17273
- if (tag.modified.indexOf(mod) > -1)
17273
+ if (tag.modified.indexOf(mod2) > -1)
17274
17274
  return tag;
17275
- return Modifier.get(tag.base || tag, tag.modified.concat(mod).sort((a, b) => a.id - b.id));
17275
+ return Modifier.get(tag.base || tag, tag.modified.concat(mod2).sort((a, b) => a.id - b.id));
17276
17276
  };
17277
17277
  }
17278
17278
  };
@@ -17887,9 +17887,9 @@ var tags = {
17887
17887
  special: Tag.defineModifier("special")
17888
17888
  };
17889
17889
  for (let name3 in tags) {
17890
- let val = tags[name3];
17891
- if (val instanceof Tag)
17892
- val.name = name3;
17890
+ let val2 = tags[name3];
17891
+ if (val2 instanceof Tag)
17892
+ val2.name = name3;
17893
17893
  }
17894
17894
  var classHighlighter = tagHighlighter([
17895
17895
  { tag: tags.link, class: "tok-link" },
@@ -22404,7 +22404,7 @@ var snippetState = /* @__PURE__ */ StateField.define({
22404
22404
  value = null;
22405
22405
  return value;
22406
22406
  },
22407
- provide: (f) => EditorView.decorations.from(f, (val) => val ? val.deco : Decoration.none)
22407
+ provide: (f) => EditorView.decorations.from(f, (val2) => val2 ? val2.deco : Decoration.none)
22408
22408
  });
22409
22409
  function fieldSelection(ranges, field) {
22410
22410
  return EditorSelection.create(ranges.filter((r) => r.field == field).map((r) => EditorSelection.range(r.from, r.to)));
@@ -23071,10 +23071,10 @@ function getContentsLength_(ed) {
23071
23071
  }
23072
23072
  function addEditorView_(id4) {
23073
23073
  return () => {
23074
- const div = select_default2("#" + id4).node();
23074
+ const div2 = select_default2("#" + id4).node();
23075
23075
  return new EditorView({
23076
23076
  state: startState,
23077
- parent: div
23077
+ parent: div2
23078
23078
  });
23079
23079
  };
23080
23080
  }
@@ -23250,7 +23250,6 @@ var showArrayImpl = function(f) {
23250
23250
  };
23251
23251
 
23252
23252
  // output-es/Data.Show/index.js
23253
- var showUnit = { show: (v) => "unit" };
23254
23253
  var showString = { show: showStringImpl };
23255
23254
  var showInt = { show: showIntImpl };
23256
23255
  var showBoolean = {
@@ -23502,6 +23501,50 @@ var pushAllImpl = function(as, xs) {
23502
23501
  // output-es/Data.Array.ST/index.js
23503
23502
  var push = (a) => runSTFn2(pushAllImpl)([a]);
23504
23503
 
23504
+ // output-es/Data.Array.ST.Iterator/index.js
23505
+ var $Iterator = (_1, _2) => ({ tag: "Iterator", _1, _2 });
23506
+ var pushWhile = (p) => (iter) => (array2) => () => {
23507
+ let $$break = false;
23508
+ const $0 = iter._2;
23509
+ while (/* @__PURE__ */ (() => {
23510
+ const $1 = $$break;
23511
+ return !$1;
23512
+ })()) {
23513
+ const i = $0.value;
23514
+ const mx = iter._1(i);
23515
+ if (mx.tag === "Just" && p(mx._1)) {
23516
+ array2.push(mx._1);
23517
+ iter._2.value;
23518
+ const $1 = iter._2.value;
23519
+ iter._2.value = $1 + 1 | 0;
23520
+ continue;
23521
+ }
23522
+ $$break = true;
23523
+ }
23524
+ };
23525
+ var iterate = (iter) => (f) => () => {
23526
+ let $$break = false;
23527
+ const $0 = iter._2;
23528
+ while (/* @__PURE__ */ (() => {
23529
+ const $1 = $$break;
23530
+ return !$1;
23531
+ })()) {
23532
+ const i = $0.value;
23533
+ const $1 = $0.value;
23534
+ $0.value = $1 + 1 | 0;
23535
+ const mx = iter._1(i);
23536
+ if (mx.tag === "Just") {
23537
+ f(mx._1)();
23538
+ continue;
23539
+ }
23540
+ if (mx.tag === "Nothing") {
23541
+ $$break = true;
23542
+ continue;
23543
+ }
23544
+ fail();
23545
+ }
23546
+ };
23547
+
23505
23548
  // output-es/Data.Foldable/foreign.js
23506
23549
  var foldrArray = function(f) {
23507
23550
  return function(init5) {
@@ -24025,6 +24068,26 @@ var nubBy = (comp) => (xs) => {
24025
24068
  }
24026
24069
  return [];
24027
24070
  };
24071
+ var groupBy = (op) => (xs) => {
24072
+ const result = [];
24073
+ const $0 = { value: 0 };
24074
+ const iter = $Iterator(
24075
+ (v) => {
24076
+ if (v >= 0 && v < xs.length) {
24077
+ return $Maybe("Just", xs[v]);
24078
+ }
24079
+ return Nothing;
24080
+ },
24081
+ $0
24082
+ );
24083
+ iterate(iter)((x2) => () => {
24084
+ const sub1 = [];
24085
+ sub1.push(x2);
24086
+ pushWhile(op(x2))(iter)(sub1)();
24087
+ result.push(sub1);
24088
+ })();
24089
+ return result;
24090
+ };
24028
24091
  var transpose = (xs) => {
24029
24092
  const go = (go$a0$copy) => (go$a1$copy) => {
24030
24093
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
@@ -24274,12 +24337,6 @@ var ringNumber = { sub: numSub, Semiring0: () => semiringNumber };
24274
24337
  var ringInt = { sub: intSub, Semiring0: () => semiringInt };
24275
24338
 
24276
24339
  // output-es/Data.EuclideanRing/foreign.js
24277
- var intDiv2 = function(x2) {
24278
- return function(y2) {
24279
- if (y2 === 0) return 0;
24280
- return y2 > 0 ? Math.floor(x2 / y2) : -Math.floor(x2 / -y2);
24281
- };
24282
- };
24283
24340
  var intMod = function(x2) {
24284
24341
  return function(y2) {
24285
24342
  if (y2 === 0) return 0;
@@ -24320,6 +24377,16 @@ var _charAt = function(just) {
24320
24377
  var length2 = function(s) {
24321
24378
  return s.length;
24322
24379
  };
24380
+ var _indexOf = function(just) {
24381
+ return function(nothing) {
24382
+ return function(x2) {
24383
+ return function(s) {
24384
+ var i = s.indexOf(x2);
24385
+ return i === -1 ? nothing : just(i);
24386
+ };
24387
+ };
24388
+ };
24389
+ };
24323
24390
  var take = function(n) {
24324
24391
  return function(s) {
24325
24392
  return s.substr(0, n);
@@ -24344,6 +24411,7 @@ var stripPrefix = (v) => (str) => {
24344
24411
  }
24345
24412
  return Nothing;
24346
24413
  };
24414
+ var indexOf = /* @__PURE__ */ _indexOf(Just)(Nothing);
24347
24415
  var charAt2 = /* @__PURE__ */ _charAt(Just)(Nothing);
24348
24416
 
24349
24417
  // output-es/Data.String.Common/foreign.js
@@ -24528,6 +24596,13 @@ var unsafeCodePointAt0Fallback = (s) => {
24528
24596
  };
24529
24597
  var unsafeCodePointAt0 = /* @__PURE__ */ _unsafeCodePointAt0(unsafeCodePointAt0Fallback);
24530
24598
  var toCodePointArray = /* @__PURE__ */ _toCodePointArray(toCodePointArrayFallback)(unsafeCodePointAt0);
24599
+ var indexOf2 = (p) => (s) => {
24600
+ const $0 = indexOf(p)(s);
24601
+ if ($0.tag === "Just") {
24602
+ return $Maybe("Just", toCodePointArray(take($0._1)(s)).length);
24603
+ }
24604
+ return Nothing;
24605
+ };
24531
24606
  var fromCharCode2 = (x2) => singleton((() => {
24532
24607
  if (x2 >= 0 && x2 <= 65535) {
24533
24608
  return fromCharCode(x2);
@@ -25036,10 +25111,6 @@ var showList = (dictShow) => {
25036
25111
  }
25037
25112
  };
25038
25113
  };
25039
- var showNonEmptyList = (dictShow) => {
25040
- const $0 = showList(dictShow);
25041
- return { show: (v) => "(NonEmptyList (NonEmpty " + dictShow.show(v._1) + " " + $0.show(v._2) + "))" };
25042
- };
25043
25114
  var traversableList = {
25044
25115
  traverse: (dictApplicative) => {
25045
25116
  const Apply0 = dictApplicative.Apply0();
@@ -26541,6 +26612,12 @@ var spyWhen = (v) => (v1) => (v2) => (v3) => {
26541
26612
  };
26542
26613
  var spyFunWhenM = (dictFunctor) => (b) => (s) => (showIn) => (showOut) => (f) => (x2) => dictFunctor.map(spyWhen(b)(s + " output")(showOut))(f(spyWhen(b)(s + " input")(showIn)(x2)));
26543
26614
  var spyFunWhen = (b) => (s) => (showIn) => (showOut) => (f) => spyFunWhenM(functorIdentity)(b)(s)(showIn)(showOut)((x2) => f(x2));
26615
+ var traceWhen = (dictApplicative) => (v) => (v1) => {
26616
+ if (v) {
26617
+ return _trace(v1, (v2) => dictApplicative.pure());
26618
+ }
26619
+ return dictApplicative.pure();
26620
+ };
26544
26621
  var check = (dictMonadThrow) => (v) => {
26545
26622
  if (!v) {
26546
26623
  return $$throw(dictMonadThrow);
@@ -28816,23 +28893,37 @@ var makeParser = (term) => (ops) => {
28816
28893
  };
28817
28894
 
28818
28895
  // output-es/Primitive.Parse/index.js
28819
- var opDefs = /* @__PURE__ */ fromFoldable2(ordString)(foldableArray)([
28820
- /* @__PURE__ */ $Tuple(".", { op: ".", prec: 8, assoc: AssocLeft }),
28821
- /* @__PURE__ */ $Tuple("!", { op: "!", prec: 8, assoc: AssocLeft }),
28822
- /* @__PURE__ */ $Tuple("**", { op: "**", prec: 8, assoc: AssocRight }),
28823
- /* @__PURE__ */ $Tuple("*", { op: "*", prec: 7, assoc: AssocLeft }),
28824
- /* @__PURE__ */ $Tuple("/", { op: "/", prec: 7, assoc: AssocLeft }),
28825
- /* @__PURE__ */ $Tuple("+", { op: "+", prec: 6, assoc: AssocLeft }),
28826
- /* @__PURE__ */ $Tuple("-", { op: "-", prec: 6, assoc: AssocLeft }),
28827
- /* @__PURE__ */ $Tuple(":", { op: ":", prec: 6, assoc: AssocRight }),
28828
- /* @__PURE__ */ $Tuple("++", { op: "++", prec: 5, assoc: AssocRight }),
28829
- /* @__PURE__ */ $Tuple("==", { op: "==", prec: 4, assoc: AssocNone }),
28830
- /* @__PURE__ */ $Tuple("/=", { op: "/=", prec: 4, assoc: AssocNone }),
28831
- /* @__PURE__ */ $Tuple("<", { op: "<", prec: 4, assoc: AssocLeft }),
28832
- /* @__PURE__ */ $Tuple(">", { op: ">", prec: 4, assoc: AssocLeft }),
28833
- /* @__PURE__ */ $Tuple("<=", { op: "<=", prec: 4, assoc: AssocLeft }),
28834
- /* @__PURE__ */ $Tuple(">=", { op: ">=", prec: 4, assoc: AssocLeft })
28835
- ]);
28896
+ var $InfixParser = (tag) => tag;
28897
+ var $OpDef = (_1, _2, _3, _4) => ({ tag: "Infix", _1, _2, _3, _4 });
28898
+ var $$Symbol = /* @__PURE__ */ $InfixParser("Symbol");
28899
+ var Ident = /* @__PURE__ */ $InfixParser("Ident");
28900
+ var ConsOp = /* @__PURE__ */ $InfixParser("ConsOp");
28901
+ var Custom = /* @__PURE__ */ $InfixParser("Custom");
28902
+ var opDefs = [
28903
+ /* @__PURE__ */ $OpDef($$Symbol, "!", AssocLeft, 9),
28904
+ /* @__PURE__ */ $OpDef($$Symbol, "**", AssocRight, 8),
28905
+ /* @__PURE__ */ $OpDef($$Symbol, "*", AssocLeft, 7),
28906
+ /* @__PURE__ */ $OpDef($$Symbol, "/", AssocLeft, 7),
28907
+ /* @__PURE__ */ $OpDef($$Symbol, "//", AssocLeft, 7),
28908
+ /* @__PURE__ */ $OpDef($$Symbol, "%", AssocLeft, 7),
28909
+ /* @__PURE__ */ $OpDef($$Symbol, "+", AssocLeft, 6),
28910
+ /* @__PURE__ */ $OpDef($$Symbol, "-", AssocLeft, 6),
28911
+ /* @__PURE__ */ $OpDef(ConsOp, ":", AssocRight, 5),
28912
+ /* @__PURE__ */ $OpDef($$Symbol, "++", AssocRight, 4),
28913
+ /* @__PURE__ */ $OpDef(Custom, "|x|", AssocLeft, 3),
28914
+ /* @__PURE__ */ $OpDef($$Symbol, "==", AssocNone, 2),
28915
+ /* @__PURE__ */ $OpDef($$Symbol, "/=", AssocNone, 2),
28916
+ /* @__PURE__ */ $OpDef($$Symbol, "<", AssocLeft, 2),
28917
+ /* @__PURE__ */ $OpDef($$Symbol, ">", AssocLeft, 2),
28918
+ /* @__PURE__ */ $OpDef($$Symbol, "<=", AssocLeft, 2),
28919
+ /* @__PURE__ */ $OpDef($$Symbol, ">=", AssocLeft, 2),
28920
+ /* @__PURE__ */ $OpDef(Ident, "and", AssocLeft, 1),
28921
+ /* @__PURE__ */ $OpDef(Ident, "or", AssocLeft, 0)
28922
+ ];
28923
+ var opMap = /* @__PURE__ */ fromFoldable2(ordString)(foldableArray)(/* @__PURE__ */ arrayMap((def) => $Tuple(
28924
+ def._2,
28925
+ def
28926
+ ))(opDefs));
28836
28927
 
28837
28928
  // output-es/Bind/index.js
28838
28929
  var union3 = /* @__PURE__ */ (() => setSet(ordString).union)();
@@ -33030,7 +33121,6 @@ var Dictionary = (value0) => (value1) => $Expr("Dictionary", value0, value1);
33030
33121
  var Constr = (value0) => (value1) => (value2) => $Expr("Constr", value0, value1, value2);
33031
33122
  var Matrix = (value0) => (value1) => (value2) => (value3) => $Expr("Matrix", value0, value1, value2, value3);
33032
33123
  var Lambda = (value0) => (value1) => $Expr("Lambda", value0, value1);
33033
- var Project = (value0) => (value1) => $Expr("Project", value0, value1);
33034
33124
  var DProject = (value0) => (value1) => $Expr("DProject", value0, value1);
33035
33125
  var App2 = (value0) => (value1) => $Expr("App", value0, value1);
33036
33126
  var Let = (value0) => (value1) => $Expr("Let", value0, value1);
@@ -33077,9 +33167,6 @@ var verticesExprVertex = {
33077
33167
  if (v.tag === "Lambda") {
33078
33168
  return union4($$$Map("Node", 1, 1, $Tuple(v._1, pack12(v)), void 0, Leaf, Leaf))(verticesElimVertex.vertices(v._2));
33079
33169
  }
33080
- if (v.tag === "Project") {
33081
- return verticesExprVertex.vertices(v._1);
33082
- }
33083
33170
  if (v.tag === "DProject") {
33084
33171
  return union4(verticesExprVertex.vertices(v._1))(verticesExprVertex.vertices(v._2));
33085
33172
  }
@@ -33172,9 +33259,6 @@ var functorExpr = {
33172
33259
  if (m.tag === "Lambda") {
33173
33260
  return $Expr("Lambda", f(m._1), functorElim.map(f)(m._2));
33174
33261
  }
33175
- if (m.tag === "Project") {
33176
- return $Expr("Project", functorExpr.map(f)(m._1), m._2);
33177
- }
33178
33262
  if (m.tag === "DProject") {
33179
33263
  return $Expr("DProject", functorExpr.map(f)(m._1), functorExpr.map(f)(m._2));
33180
33264
  }
@@ -33318,9 +33402,6 @@ var foldableExpr = {
33318
33402
  if (m.tag === "Lambda") {
33319
33403
  return foldableElim.foldl(f)(f(z)(m._1))(m._2);
33320
33404
  }
33321
- if (m.tag === "Project") {
33322
- return foldableExpr.foldl(f)(z)(m._1);
33323
- }
33324
33405
  if (m.tag === "DProject") {
33325
33406
  return foldableExpr.foldl(f)(foldableExpr.foldl(f)(z)(m._1))(m._2);
33326
33407
  }
@@ -33373,9 +33454,6 @@ var foldableExpr = {
33373
33454
  if (m.tag === "Lambda") {
33374
33455
  return f(m._1)(foldableElim.foldr(f)(z)(m._2));
33375
33456
  }
33376
- if (m.tag === "Project") {
33377
- return foldableExpr.foldr(f)(z)(m._1);
33378
- }
33379
33457
  if (m.tag === "DProject") {
33380
33458
  return foldableExpr.foldr(f)(foldableExpr.foldr(f)(z)(m._2))(m._1);
33381
33459
  }
@@ -33425,9 +33503,6 @@ var foldableExpr = {
33425
33503
  if (m.tag === "Lambda") {
33426
33504
  return $0.append(f(m._1))(foldableElim.foldMap(dictMonoid)(f)(m._2));
33427
33505
  }
33428
- if (m.tag === "Project") {
33429
- return foldableExpr.foldMap(dictMonoid)(f)(m._1);
33430
- }
33431
33506
  if (m.tag === "DProject") {
33432
33507
  return $0.append(foldableExpr.foldMap(dictMonoid)(f)(m._1))(foldableExpr.foldMap(dictMonoid)(f)(m._2));
33433
33508
  }
@@ -33578,10 +33653,6 @@ var traversableExpr = {
33578
33653
  if (m.tag === "Lambda") {
33579
33654
  return Apply0.apply($0.map((v2) => (v3) => $Expr("Lambda", v2, v3))(f(m._1)))(traversableElim.traverse(dictApplicative)(f)(m._2));
33580
33655
  }
33581
- if (m.tag === "Project") {
33582
- const $1 = m._2;
33583
- return $0.map((v2) => $Expr("Project", v2, $1))(traversableExpr.traverse(dictApplicative)(f)(m._1));
33584
- }
33585
33656
  if (m.tag === "DProject") {
33586
33657
  return Apply0.apply($0.map((v2) => (v3) => $Expr("DProject", v2, v3))(traversableExpr.traverse(dictApplicative)(f)(m._1)))(traversableExpr.traverse(dictApplicative)(f)(m._2));
33587
33658
  }
@@ -33703,9 +33774,6 @@ var eqExpr = (dictEq) => ({
33703
33774
  if (x2.tag === "Lambda") {
33704
33775
  return y2.tag === "Lambda" && dictEq.eq(x2._1)(y2._1) && eqElim(dictEq).eq(x2._2)(y2._2);
33705
33776
  }
33706
- if (x2.tag === "Project") {
33707
- return y2.tag === "Project" && eqExpr(dictEq).eq(x2._1)(y2._1) && x2._2 === y2._2;
33708
- }
33709
33777
  if (x2.tag === "DProject") {
33710
33778
  return y2.tag === "DProject" && eqExpr(dictEq).eq(x2._1)(y2._1) && eqExpr(dictEq).eq(x2._2)(y2._2);
33711
33779
  }
@@ -33944,22 +34012,6 @@ var ordExpr = (dictOrd) => {
33944
34012
  if (y2.tag === "Lambda") {
33945
34013
  return GT;
33946
34014
  }
33947
- if (x2.tag === "Project") {
33948
- if (y2.tag === "Project") {
33949
- const v = ordExpr(dictOrd).compare(x2._1)(y2._1);
33950
- if (v === "LT") {
33951
- return LT;
33952
- }
33953
- if (v === "GT") {
33954
- return GT;
33955
- }
33956
- return ordString.compare(x2._2)(y2._2);
33957
- }
33958
- return LT;
33959
- }
33960
- if (y2.tag === "Project") {
33961
- return GT;
33962
- }
33963
34015
  if (x2.tag === "DProject") {
33964
34016
  if (y2.tag === "DProject") {
33965
34017
  const v = ordExpr(dictOrd).compare(x2._1)(y2._1);
@@ -34281,12 +34333,6 @@ var applyExpr = {
34281
34333
  }
34282
34334
  return throwException(error("Shape mismatch"))();
34283
34335
  }
34284
- if (v.tag === "Project") {
34285
- if (v1.tag === "Project") {
34286
- return $Expr("Project", applyExpr.apply(v._1)(v1._1), v._2);
34287
- }
34288
- return throwException(error("Shape mismatch"))();
34289
- }
34290
34336
  if (v.tag === "DProject") {
34291
34337
  if (v1.tag === "DProject") {
34292
34338
  return $Expr("DProject", applyExpr.apply(v._1)(v1._1), applyExpr.apply(v._2)(v1._2));
@@ -34500,9 +34546,6 @@ var fVExpr = {
34500
34546
  if (v.tag === "Lambda") {
34501
34547
  return fVElim.fv(v._2);
34502
34548
  }
34503
- if (v.tag === "Project") {
34504
- return fVExpr.fv(v._1);
34505
- }
34506
34549
  if (v.tag === "DProject") {
34507
34550
  return setSet2.union(fVExpr.fv(v._1))(fVExpr.fv(v._2));
34508
34551
  }
@@ -34625,86 +34668,6 @@ var genericShowSum3 = /* @__PURE__ */ (() => {
34625
34668
  });
34626
34669
  })();
34627
34670
  var PListNextIsSymbol = { reflectSymbol: () => "PListNext" };
34628
- var VarDefIsSymbol = { reflectSymbol: () => "VarDef" };
34629
- var ListCompGuardIsSymbol = { reflectSymbol: () => "ListCompGuard" };
34630
- var ListCompGenIsSymbol = { reflectSymbol: () => "ListCompGen" };
34631
- var ListCompDeclIsSymbol = { reflectSymbol: () => "ListCompDecl" };
34632
- var genericShowSum4 = /* @__PURE__ */ (() => {
34633
- const $0 = genericShowConstructor(genericShowArgsArgument)({ reflectSymbol: () => "Token" });
34634
- return (dictGenericShow1) => ({
34635
- "genericShow'": (v) => {
34636
- if (v.tag === "Inl") {
34637
- return $0["genericShow'"](v._1);
34638
- }
34639
- if (v.tag === "Inr") {
34640
- return dictGenericShow1["genericShow'"](v._1);
34641
- }
34642
- fail();
34643
- }
34644
- });
34645
- })();
34646
- var UnquoteIsSymbol = { reflectSymbol: () => "Unquote" };
34647
- var EndIsSymbol = { reflectSymbol: () => "End" };
34648
- var NextIsSymbol = { reflectSymbol: () => "Next" };
34649
- var genericShowSum5 = /* @__PURE__ */ (() => {
34650
- const $0 = genericShowConstructor(genericShowArgsArgument)({ reflectSymbol: () => "Var" });
34651
- return (dictGenericShow1) => ({
34652
- "genericShow'": (v) => {
34653
- if (v.tag === "Inl") {
34654
- return $0["genericShow'"](v._1);
34655
- }
34656
- if (v.tag === "Inr") {
34657
- return dictGenericShow1["genericShow'"](v._1);
34658
- }
34659
- fail();
34660
- }
34661
- });
34662
- })();
34663
- var genericShowSum6 = /* @__PURE__ */ (() => {
34664
- const $0 = genericShowConstructor(genericShowArgsArgument)({ reflectSymbol: () => "Op" });
34665
- return (dictGenericShow1) => ({
34666
- "genericShow'": (v) => {
34667
- if (v.tag === "Inl") {
34668
- return $0["genericShow'"](v._1);
34669
- }
34670
- if (v.tag === "Inr") {
34671
- return dictGenericShow1["genericShow'"](v._1);
34672
- }
34673
- fail();
34674
- }
34675
- });
34676
- })();
34677
- var genericShowArgsArgument1 = { genericShowArgs: (v) => [showIntImpl(v)] };
34678
- var IntIsSymbol = { reflectSymbol: () => "Int" };
34679
- var genericShowArgsArgument2 = { genericShowArgs: (v) => [showNumberImpl(v)] };
34680
- var FloatIsSymbol = { reflectSymbol: () => "Float" };
34681
- var StrIsSymbol = { reflectSymbol: () => "Str" };
34682
- var ConstrIsSymbol = { reflectSymbol: () => "Constr" };
34683
- var DictionaryIsSymbol = { reflectSymbol: () => "Dictionary" };
34684
- var genericShowArgsProduct1 = /* @__PURE__ */ genericShowArgsProduct(/* @__PURE__ */ (() => {
34685
- const $0 = showTuple(showString);
34686
- return { genericShowArgs: (v) => [$0.show(v)] };
34687
- })());
34688
- var MatrixIsSymbol = { reflectSymbol: () => "Matrix" };
34689
- var LambdaIsSymbol = { reflectSymbol: () => "Lambda" };
34690
- var ProjectIsSymbol = { reflectSymbol: () => "Project" };
34691
- var DProjectIsSymbol = { reflectSymbol: () => "DProject" };
34692
- var AppIsSymbol = { reflectSymbol: () => "App" };
34693
- var BinaryAppIsSymbol = { reflectSymbol: () => "BinaryApp" };
34694
- var MatchAsIsSymbol = { reflectSymbol: () => "MatchAs" };
34695
- var IfElseIsSymbol = { reflectSymbol: () => "IfElse" };
34696
- var ParagraphIsSymbol = { reflectSymbol: () => "Paragraph" };
34697
- var ListEmptyIsSymbol = { reflectSymbol: () => "ListEmpty" };
34698
- var ListNonEmptyIsSymbol = { reflectSymbol: () => "ListNonEmpty" };
34699
- var ListEnumIsSymbol = { reflectSymbol: () => "ListEnum" };
34700
- var ListCompIsSymbol = { reflectSymbol: () => "ListComp" };
34701
- var LetIsSymbol = { reflectSymbol: () => "Let" };
34702
- var LetRecIsSymbol = { reflectSymbol: () => "LetRec" };
34703
- var DocExprIsSymbol = { reflectSymbol: () => "DocExpr" };
34704
- var ExprKeyIsSymbol = { reflectSymbol: () => "ExprKey" };
34705
- var VarKeyIsSymbol = { reflectSymbol: () => "VarKey" };
34706
- var ClausesIsSymbol = { reflectSymbol: () => "Clauses" };
34707
- var ClauseIsSymbol = { reflectSymbol: () => "Clause" };
34708
34671
  var difference2 = /* @__PURE__ */ difference(eqString);
34709
34672
  var toUnfoldable3 = (x2) => {
34710
34673
  const go = (m$p, z$p) => {
@@ -34833,1189 +34796,6 @@ var showListRestPattern = {
34833
34796
  fail();
34834
34797
  })())
34835
34798
  };
34836
- var showTuple1 = (dictShow1) => ({ show: (v) => "(Tuple " + showPattern1.show(v._1) + " " + dictShow1.show(v._2) + ")" });
34837
- var showTuple2 = /* @__PURE__ */ (() => {
34838
- const $0 = showNonEmptyList(showPattern1);
34839
- return (dictShow1) => ({ show: (v) => "(Tuple " + $0.show(v._1) + " " + dictShow1.show(v._2) + ")" });
34840
- })();
34841
- var genericExpr_ = {
34842
- to: (x2) => {
34843
- if (x2.tag === "Inl") {
34844
- return $Expr2("Var", x2._1);
34845
- }
34846
- if (x2.tag === "Inr") {
34847
- if (x2._1.tag === "Inl") {
34848
- return $Expr2("Op", x2._1._1);
34849
- }
34850
- if (x2._1.tag === "Inr") {
34851
- if (x2._1._1.tag === "Inl") {
34852
- return $Expr2("Int", x2._1._1._1._1, x2._1._1._1._2);
34853
- }
34854
- if (x2._1._1.tag === "Inr") {
34855
- if (x2._1._1._1.tag === "Inl") {
34856
- return $Expr2("Float", x2._1._1._1._1._1, x2._1._1._1._1._2);
34857
- }
34858
- if (x2._1._1._1.tag === "Inr") {
34859
- if (x2._1._1._1._1.tag === "Inl") {
34860
- return $Expr2("Str", x2._1._1._1._1._1._1, x2._1._1._1._1._1._2);
34861
- }
34862
- if (x2._1._1._1._1.tag === "Inr") {
34863
- if (x2._1._1._1._1._1.tag === "Inl") {
34864
- return $Expr2("Constr", x2._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._2._1, x2._1._1._1._1._1._1._2._2);
34865
- }
34866
- if (x2._1._1._1._1._1.tag === "Inr") {
34867
- if (x2._1._1._1._1._1._1.tag === "Inl") {
34868
- return $Expr2("Dictionary", x2._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._2);
34869
- }
34870
- if (x2._1._1._1._1._1._1.tag === "Inr") {
34871
- if (x2._1._1._1._1._1._1._1.tag === "Inl") {
34872
- return $Expr2("Matrix", x2._1._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._1._2._1, x2._1._1._1._1._1._1._1._1._2._2._1, x2._1._1._1._1._1._1._1._1._2._2._2);
34873
- }
34874
- if (x2._1._1._1._1._1._1._1.tag === "Inr") {
34875
- if (x2._1._1._1._1._1._1._1._1.tag === "Inl") {
34876
- return $Expr2("Lambda", x2._1._1._1._1._1._1._1._1._1);
34877
- }
34878
- if (x2._1._1._1._1._1._1._1._1.tag === "Inr") {
34879
- if (x2._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34880
- return $Expr2("Project", x2._1._1._1._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._1._1._1._2);
34881
- }
34882
- if (x2._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34883
- if (x2._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34884
- return $Expr2("DProject", x2._1._1._1._1._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._1._1._1._1._2);
34885
- }
34886
- if (x2._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34887
- if (x2._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34888
- return $Expr2("App", x2._1._1._1._1._1._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._1._1._1._1._1._2);
34889
- }
34890
- if (x2._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34891
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34892
- return $Expr2(
34893
- "BinaryApp",
34894
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34895
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._2._1,
34896
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._2._2
34897
- );
34898
- }
34899
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34900
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34901
- return $Expr2("MatchAs", x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1, x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2);
34902
- }
34903
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34904
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34905
- return $Expr2(
34906
- "IfElse",
34907
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34908
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._1,
34909
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._2
34910
- );
34911
- }
34912
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34913
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34914
- return $Expr2("Paragraph", x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
34915
- }
34916
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34917
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34918
- return $Expr2("ListEmpty", x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
34919
- }
34920
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34921
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34922
- return $Expr2(
34923
- "ListNonEmpty",
34924
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34925
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._1,
34926
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._2
34927
- );
34928
- }
34929
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34930
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34931
- return $Expr2(
34932
- "ListEnum",
34933
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34934
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2
34935
- );
34936
- }
34937
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34938
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34939
- return $Expr2(
34940
- "ListComp",
34941
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34942
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._1,
34943
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2._2
34944
- );
34945
- }
34946
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34947
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34948
- return $Expr2(
34949
- "Let",
34950
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34951
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2
34952
- );
34953
- }
34954
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34955
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
34956
- return $Expr2(
34957
- "LetRec",
34958
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34959
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2
34960
- );
34961
- }
34962
- if (x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
34963
- return $Expr2(
34964
- "DocExpr",
34965
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1,
34966
- x2._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._2
34967
- );
34968
- }
34969
- }
34970
- }
34971
- }
34972
- }
34973
- }
34974
- }
34975
- }
34976
- }
34977
- }
34978
- }
34979
- }
34980
- }
34981
- }
34982
- }
34983
- }
34984
- }
34985
- }
34986
- }
34987
- }
34988
- }
34989
- }
34990
- fail();
34991
- },
34992
- from: (x2) => {
34993
- if (x2.tag === "Var") {
34994
- return $Sum("Inl", x2._1);
34995
- }
34996
- if (x2.tag === "Op") {
34997
- return $Sum("Inr", $Sum("Inl", x2._1));
34998
- }
34999
- if (x2.tag === "Int") {
35000
- return $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))));
35001
- }
35002
- if (x2.tag === "Float") {
35003
- return $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2)))));
35004
- }
35005
- if (x2.tag === "Str") {
35006
- return $Sum(
35007
- "Inr",
35008
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2)))))
35009
- );
35010
- }
35011
- if (x2.tag === "Constr") {
35012
- return $Sum(
35013
- "Inr",
35014
- $Sum(
35015
- "Inr",
35016
- $Sum(
35017
- "Inr",
35018
- $Sum(
35019
- "Inr",
35020
- $Sum("Inr", $Sum("Inl", $Product(x2._1, $Product(x2._2, x2._3))))
35021
- )
35022
- )
35023
- )
35024
- );
35025
- }
35026
- if (x2.tag === "Dictionary") {
35027
- return $Sum(
35028
- "Inr",
35029
- $Sum(
35030
- "Inr",
35031
- $Sum(
35032
- "Inr",
35033
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2)))))
35034
- )
35035
- )
35036
- );
35037
- }
35038
- if (x2.tag === "Matrix") {
35039
- return $Sum(
35040
- "Inr",
35041
- $Sum(
35042
- "Inr",
35043
- $Sum(
35044
- "Inr",
35045
- $Sum(
35046
- "Inr",
35047
- $Sum(
35048
- "Inr",
35049
- $Sum(
35050
- "Inr",
35051
- $Sum(
35052
- "Inr",
35053
- $Sum("Inl", $Product(x2._1, $Product(x2._2, $Product(x2._3, x2._4))))
35054
- )
35055
- )
35056
- )
35057
- )
35058
- )
35059
- )
35060
- );
35061
- }
35062
- if (x2.tag === "Lambda") {
35063
- return $Sum(
35064
- "Inr",
35065
- $Sum(
35066
- "Inr",
35067
- $Sum(
35068
- "Inr",
35069
- $Sum(
35070
- "Inr",
35071
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", x2._1)))))
35072
- )
35073
- )
35074
- )
35075
- );
35076
- }
35077
- if (x2.tag === "Project") {
35078
- return $Sum(
35079
- "Inr",
35080
- $Sum(
35081
- "Inr",
35082
- $Sum(
35083
- "Inr",
35084
- $Sum(
35085
- "Inr",
35086
- $Sum(
35087
- "Inr",
35088
- $Sum(
35089
- "Inr",
35090
- $Sum(
35091
- "Inr",
35092
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35093
- )
35094
- )
35095
- )
35096
- )
35097
- )
35098
- )
35099
- );
35100
- }
35101
- if (x2.tag === "DProject") {
35102
- return $Sum(
35103
- "Inr",
35104
- $Sum(
35105
- "Inr",
35106
- $Sum(
35107
- "Inr",
35108
- $Sum(
35109
- "Inr",
35110
- $Sum(
35111
- "Inr",
35112
- $Sum(
35113
- "Inr",
35114
- $Sum(
35115
- "Inr",
35116
- $Sum(
35117
- "Inr",
35118
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35119
- )
35120
- )
35121
- )
35122
- )
35123
- )
35124
- )
35125
- )
35126
- );
35127
- }
35128
- if (x2.tag === "App") {
35129
- return $Sum(
35130
- "Inr",
35131
- $Sum(
35132
- "Inr",
35133
- $Sum(
35134
- "Inr",
35135
- $Sum(
35136
- "Inr",
35137
- $Sum(
35138
- "Inr",
35139
- $Sum(
35140
- "Inr",
35141
- $Sum(
35142
- "Inr",
35143
- $Sum(
35144
- "Inr",
35145
- $Sum(
35146
- "Inr",
35147
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35148
- )
35149
- )
35150
- )
35151
- )
35152
- )
35153
- )
35154
- )
35155
- )
35156
- );
35157
- }
35158
- if (x2.tag === "BinaryApp") {
35159
- return $Sum(
35160
- "Inr",
35161
- $Sum(
35162
- "Inr",
35163
- $Sum(
35164
- "Inr",
35165
- $Sum(
35166
- "Inr",
35167
- $Sum(
35168
- "Inr",
35169
- $Sum(
35170
- "Inr",
35171
- $Sum(
35172
- "Inr",
35173
- $Sum(
35174
- "Inr",
35175
- $Sum(
35176
- "Inr",
35177
- $Sum(
35178
- "Inr",
35179
- $Sum(
35180
- "Inr",
35181
- $Sum("Inr", $Sum("Inl", $Product(x2._1, $Product(x2._2, x2._3))))
35182
- )
35183
- )
35184
- )
35185
- )
35186
- )
35187
- )
35188
- )
35189
- )
35190
- )
35191
- )
35192
- );
35193
- }
35194
- if (x2.tag === "MatchAs") {
35195
- return $Sum(
35196
- "Inr",
35197
- $Sum(
35198
- "Inr",
35199
- $Sum(
35200
- "Inr",
35201
- $Sum(
35202
- "Inr",
35203
- $Sum(
35204
- "Inr",
35205
- $Sum(
35206
- "Inr",
35207
- $Sum(
35208
- "Inr",
35209
- $Sum(
35210
- "Inr",
35211
- $Sum(
35212
- "Inr",
35213
- $Sum(
35214
- "Inr",
35215
- $Sum(
35216
- "Inr",
35217
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35218
- )
35219
- )
35220
- )
35221
- )
35222
- )
35223
- )
35224
- )
35225
- )
35226
- )
35227
- )
35228
- );
35229
- }
35230
- if (x2.tag === "IfElse") {
35231
- return $Sum(
35232
- "Inr",
35233
- $Sum(
35234
- "Inr",
35235
- $Sum(
35236
- "Inr",
35237
- $Sum(
35238
- "Inr",
35239
- $Sum(
35240
- "Inr",
35241
- $Sum(
35242
- "Inr",
35243
- $Sum(
35244
- "Inr",
35245
- $Sum(
35246
- "Inr",
35247
- $Sum(
35248
- "Inr",
35249
- $Sum(
35250
- "Inr",
35251
- $Sum(
35252
- "Inr",
35253
- $Sum(
35254
- "Inr",
35255
- $Sum(
35256
- "Inr",
35257
- $Sum("Inr", $Sum("Inl", $Product(x2._1, $Product(x2._2, x2._3))))
35258
- )
35259
- )
35260
- )
35261
- )
35262
- )
35263
- )
35264
- )
35265
- )
35266
- )
35267
- )
35268
- )
35269
- )
35270
- );
35271
- }
35272
- if (x2.tag === "Paragraph") {
35273
- return $Sum(
35274
- "Inr",
35275
- $Sum(
35276
- "Inr",
35277
- $Sum(
35278
- "Inr",
35279
- $Sum(
35280
- "Inr",
35281
- $Sum(
35282
- "Inr",
35283
- $Sum(
35284
- "Inr",
35285
- $Sum(
35286
- "Inr",
35287
- $Sum(
35288
- "Inr",
35289
- $Sum(
35290
- "Inr",
35291
- $Sum(
35292
- "Inr",
35293
- $Sum(
35294
- "Inr",
35295
- $Sum(
35296
- "Inr",
35297
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", x2._1))))
35298
- )
35299
- )
35300
- )
35301
- )
35302
- )
35303
- )
35304
- )
35305
- )
35306
- )
35307
- )
35308
- )
35309
- );
35310
- }
35311
- if (x2.tag === "ListEmpty") {
35312
- return $Sum(
35313
- "Inr",
35314
- $Sum(
35315
- "Inr",
35316
- $Sum(
35317
- "Inr",
35318
- $Sum(
35319
- "Inr",
35320
- $Sum(
35321
- "Inr",
35322
- $Sum(
35323
- "Inr",
35324
- $Sum(
35325
- "Inr",
35326
- $Sum(
35327
- "Inr",
35328
- $Sum(
35329
- "Inr",
35330
- $Sum(
35331
- "Inr",
35332
- $Sum(
35333
- "Inr",
35334
- $Sum(
35335
- "Inr",
35336
- $Sum(
35337
- "Inr",
35338
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Sum("Inl", x2._1))))
35339
- )
35340
- )
35341
- )
35342
- )
35343
- )
35344
- )
35345
- )
35346
- )
35347
- )
35348
- )
35349
- )
35350
- )
35351
- );
35352
- }
35353
- if (x2.tag === "ListNonEmpty") {
35354
- return $Sum(
35355
- "Inr",
35356
- $Sum(
35357
- "Inr",
35358
- $Sum(
35359
- "Inr",
35360
- $Sum(
35361
- "Inr",
35362
- $Sum(
35363
- "Inr",
35364
- $Sum(
35365
- "Inr",
35366
- $Sum(
35367
- "Inr",
35368
- $Sum(
35369
- "Inr",
35370
- $Sum(
35371
- "Inr",
35372
- $Sum(
35373
- "Inr",
35374
- $Sum(
35375
- "Inr",
35376
- $Sum(
35377
- "Inr",
35378
- $Sum(
35379
- "Inr",
35380
- $Sum(
35381
- "Inr",
35382
- $Sum(
35383
- "Inr",
35384
- $Sum(
35385
- "Inr",
35386
- $Sum("Inr", $Sum("Inl", $Product(x2._1, $Product(x2._2, x2._3))))
35387
- )
35388
- )
35389
- )
35390
- )
35391
- )
35392
- )
35393
- )
35394
- )
35395
- )
35396
- )
35397
- )
35398
- )
35399
- )
35400
- )
35401
- )
35402
- );
35403
- }
35404
- if (x2.tag === "ListEnum") {
35405
- return $Sum(
35406
- "Inr",
35407
- $Sum(
35408
- "Inr",
35409
- $Sum(
35410
- "Inr",
35411
- $Sum(
35412
- "Inr",
35413
- $Sum(
35414
- "Inr",
35415
- $Sum(
35416
- "Inr",
35417
- $Sum(
35418
- "Inr",
35419
- $Sum(
35420
- "Inr",
35421
- $Sum(
35422
- "Inr",
35423
- $Sum(
35424
- "Inr",
35425
- $Sum(
35426
- "Inr",
35427
- $Sum(
35428
- "Inr",
35429
- $Sum(
35430
- "Inr",
35431
- $Sum(
35432
- "Inr",
35433
- $Sum(
35434
- "Inr",
35435
- $Sum(
35436
- "Inr",
35437
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35438
- )
35439
- )
35440
- )
35441
- )
35442
- )
35443
- )
35444
- )
35445
- )
35446
- )
35447
- )
35448
- )
35449
- )
35450
- )
35451
- )
35452
- )
35453
- );
35454
- }
35455
- if (x2.tag === "ListComp") {
35456
- return $Sum(
35457
- "Inr",
35458
- $Sum(
35459
- "Inr",
35460
- $Sum(
35461
- "Inr",
35462
- $Sum(
35463
- "Inr",
35464
- $Sum(
35465
- "Inr",
35466
- $Sum(
35467
- "Inr",
35468
- $Sum(
35469
- "Inr",
35470
- $Sum(
35471
- "Inr",
35472
- $Sum(
35473
- "Inr",
35474
- $Sum(
35475
- "Inr",
35476
- $Sum(
35477
- "Inr",
35478
- $Sum(
35479
- "Inr",
35480
- $Sum(
35481
- "Inr",
35482
- $Sum(
35483
- "Inr",
35484
- $Sum(
35485
- "Inr",
35486
- $Sum(
35487
- "Inr",
35488
- $Sum(
35489
- "Inr",
35490
- $Sum(
35491
- "Inr",
35492
- $Sum("Inr", $Sum("Inl", $Product(x2._1, $Product(x2._2, x2._3))))
35493
- )
35494
- )
35495
- )
35496
- )
35497
- )
35498
- )
35499
- )
35500
- )
35501
- )
35502
- )
35503
- )
35504
- )
35505
- )
35506
- )
35507
- )
35508
- )
35509
- )
35510
- );
35511
- }
35512
- if (x2.tag === "Let") {
35513
- return $Sum(
35514
- "Inr",
35515
- $Sum(
35516
- "Inr",
35517
- $Sum(
35518
- "Inr",
35519
- $Sum(
35520
- "Inr",
35521
- $Sum(
35522
- "Inr",
35523
- $Sum(
35524
- "Inr",
35525
- $Sum(
35526
- "Inr",
35527
- $Sum(
35528
- "Inr",
35529
- $Sum(
35530
- "Inr",
35531
- $Sum(
35532
- "Inr",
35533
- $Sum(
35534
- "Inr",
35535
- $Sum(
35536
- "Inr",
35537
- $Sum(
35538
- "Inr",
35539
- $Sum(
35540
- "Inr",
35541
- $Sum(
35542
- "Inr",
35543
- $Sum(
35544
- "Inr",
35545
- $Sum(
35546
- "Inr",
35547
- $Sum(
35548
- "Inr",
35549
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35550
- )
35551
- )
35552
- )
35553
- )
35554
- )
35555
- )
35556
- )
35557
- )
35558
- )
35559
- )
35560
- )
35561
- )
35562
- )
35563
- )
35564
- )
35565
- )
35566
- )
35567
- );
35568
- }
35569
- if (x2.tag === "LetRec") {
35570
- return $Sum(
35571
- "Inr",
35572
- $Sum(
35573
- "Inr",
35574
- $Sum(
35575
- "Inr",
35576
- $Sum(
35577
- "Inr",
35578
- $Sum(
35579
- "Inr",
35580
- $Sum(
35581
- "Inr",
35582
- $Sum(
35583
- "Inr",
35584
- $Sum(
35585
- "Inr",
35586
- $Sum(
35587
- "Inr",
35588
- $Sum(
35589
- "Inr",
35590
- $Sum(
35591
- "Inr",
35592
- $Sum(
35593
- "Inr",
35594
- $Sum(
35595
- "Inr",
35596
- $Sum(
35597
- "Inr",
35598
- $Sum(
35599
- "Inr",
35600
- $Sum(
35601
- "Inr",
35602
- $Sum(
35603
- "Inr",
35604
- $Sum(
35605
- "Inr",
35606
- $Sum(
35607
- "Inr",
35608
- $Sum("Inr", $Sum("Inr", $Sum("Inl", $Product(x2._1, x2._2))))
35609
- )
35610
- )
35611
- )
35612
- )
35613
- )
35614
- )
35615
- )
35616
- )
35617
- )
35618
- )
35619
- )
35620
- )
35621
- )
35622
- )
35623
- )
35624
- )
35625
- )
35626
- )
35627
- );
35628
- }
35629
- if (x2.tag === "DocExpr") {
35630
- return $Sum(
35631
- "Inr",
35632
- $Sum(
35633
- "Inr",
35634
- $Sum(
35635
- "Inr",
35636
- $Sum(
35637
- "Inr",
35638
- $Sum(
35639
- "Inr",
35640
- $Sum(
35641
- "Inr",
35642
- $Sum(
35643
- "Inr",
35644
- $Sum(
35645
- "Inr",
35646
- $Sum(
35647
- "Inr",
35648
- $Sum(
35649
- "Inr",
35650
- $Sum(
35651
- "Inr",
35652
- $Sum(
35653
- "Inr",
35654
- $Sum(
35655
- "Inr",
35656
- $Sum(
35657
- "Inr",
35658
- $Sum(
35659
- "Inr",
35660
- $Sum(
35661
- "Inr",
35662
- $Sum(
35663
- "Inr",
35664
- $Sum(
35665
- "Inr",
35666
- $Sum(
35667
- "Inr",
35668
- $Sum("Inr", $Sum("Inr", $Sum("Inr", $Product(x2._1, x2._2))))
35669
- )
35670
- )
35671
- )
35672
- )
35673
- )
35674
- )
35675
- )
35676
- )
35677
- )
35678
- )
35679
- )
35680
- )
35681
- )
35682
- )
35683
- )
35684
- )
35685
- )
35686
- )
35687
- );
35688
- }
35689
- fail();
35690
- }
35691
- };
35692
- var showVarDef = (dictShow) => ({
35693
- show: (c) => genericShowConstructor(genericShowArgsProduct({ genericShowArgs: (v) => [showPattern1.show(v)] })((() => {
35694
- const $0 = showExpr(dictShow);
35695
- return { genericShowArgs: (v) => [$0.show(v)] };
35696
- })()))(VarDefIsSymbol)["genericShow'"]($Product(c._1, c._2))
35697
- });
35698
- var showQualifier = (dictShow) => ({
35699
- show: (c) => {
35700
- const $0 = genericShowConstructor((() => {
35701
- const $02 = showExpr(dictShow);
35702
- return { genericShowArgs: (v) => [$02.show(v)] };
35703
- })())(ListCompGuardIsSymbol);
35704
- const $1 = genericShowConstructor(genericShowArgsProduct({ genericShowArgs: (v) => [showPattern1.show(v)] })((() => {
35705
- const $12 = showExpr(dictShow);
35706
- return { genericShowArgs: (v) => [$12.show(v)] };
35707
- })()))(ListCompGenIsSymbol);
35708
- const $2 = genericShowConstructor((() => {
35709
- const $22 = showVarDef(dictShow);
35710
- return { genericShowArgs: (v) => [$22.show(v)] };
35711
- })())(ListCompDeclIsSymbol);
35712
- if (c.tag === "ListCompGuard") {
35713
- return $0["genericShow'"](c._1);
35714
- }
35715
- if (c.tag === "ListCompGen") {
35716
- return $1["genericShow'"]($Product(c._1, c._2));
35717
- }
35718
- if (c.tag === "ListCompDecl") {
35719
- return $2["genericShow'"](c._1);
35720
- }
35721
- fail();
35722
- }
35723
- });
35724
- var showParagraphElem = (dictShow) => ({
35725
- show: (c) => genericShowSum4(genericShowConstructor((() => {
35726
- const $0 = showExpr(dictShow);
35727
- return { genericShowArgs: (v) => [$0.show(v)] };
35728
- })())(UnquoteIsSymbol))["genericShow'"]((() => {
35729
- if (c.tag === "Token") {
35730
- return $Sum("Inl", c._1);
35731
- }
35732
- if (c.tag === "Unquote") {
35733
- return $Sum("Inr", c._1);
35734
- }
35735
- fail();
35736
- })())
35737
- });
35738
- var showListRest = (dictShow) => {
35739
- const genericShowArgsArgument3 = { genericShowArgs: (v) => [dictShow.show(v)] };
35740
- const $0 = genericShowConstructor(genericShowArgsArgument3)(EndIsSymbol);
35741
- return {
35742
- show: (c) => {
35743
- const $1 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsProduct((() => {
35744
- const $12 = showExpr(dictShow);
35745
- return { genericShowArgs: (v) => [$12.show(v)] };
35746
- })())((() => {
35747
- const $12 = showListRest(dictShow);
35748
- return { genericShowArgs: (v) => [$12.show(v)] };
35749
- })())))(NextIsSymbol);
35750
- if (c.tag === "End") {
35751
- return $0["genericShow'"](c._1);
35752
- }
35753
- if (c.tag === "Next") {
35754
- return $1["genericShow'"]($Product(c._1, $Product(c._2, c._3)));
35755
- }
35756
- fail();
35757
- }
35758
- };
35759
- };
35760
- var showExpr = (dictShow) => {
35761
- const genericShowArgsArgument3 = { genericShowArgs: (v) => [dictShow.show(v)] };
35762
- const $0 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsArgument1))(IntIsSymbol);
35763
- const $1 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsArgument2))(FloatIsSymbol);
35764
- const $2 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsArgument))(StrIsSymbol);
35765
- const $3 = genericShowConstructor(genericShowArgsArgument3)(ListEmptyIsSymbol);
35766
- return {
35767
- show: (c) => genericShowSum5(genericShowSum6((() => {
35768
- const $4 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsProduct(genericShowArgsArgument)((() => {
35769
- const $42 = showList(showExpr(dictShow));
35770
- return { genericShowArgs: (v) => [$42.show(v)] };
35771
- })())))(ConstrIsSymbol);
35772
- const $5 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)((() => {
35773
- const $52 = showList((() => {
35774
- const $53 = showDictEntry(dictShow);
35775
- const $62 = showExpr(dictShow);
35776
- return { show: (v) => "(Tuple " + $53.show(v._1) + " " + $62.show(v._2) + ")" };
35777
- })());
35778
- return { genericShowArgs: (v) => [$52.show(v)] };
35779
- })()))(DictionaryIsSymbol);
35780
- const $6 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsProduct((() => {
35781
- const $62 = showExpr(dictShow);
35782
- return { genericShowArgs: (v) => [$62.show(v)] };
35783
- })())(genericShowArgsProduct1((() => {
35784
- const $62 = showExpr(dictShow);
35785
- return { genericShowArgs: (v) => [$62.show(v)] };
35786
- })()))))(MatrixIsSymbol);
35787
- const $7 = genericShowConstructor((() => {
35788
- const $72 = showClauses(dictShow);
35789
- return { genericShowArgs: (v) => [$72.show(v)] };
35790
- })())(LambdaIsSymbol);
35791
- const $8 = genericShowConstructor(genericShowArgsProduct((() => {
35792
- const $82 = showExpr(dictShow);
35793
- return { genericShowArgs: (v) => [$82.show(v)] };
35794
- })())(genericShowArgsArgument))(ProjectIsSymbol);
35795
- const $9 = genericShowConstructor(genericShowArgsProduct((() => {
35796
- const $92 = showExpr(dictShow);
35797
- return { genericShowArgs: (v) => [$92.show(v)] };
35798
- })())((() => {
35799
- const $92 = showExpr(dictShow);
35800
- return { genericShowArgs: (v) => [$92.show(v)] };
35801
- })()))(DProjectIsSymbol);
35802
- const $10 = genericShowConstructor(genericShowArgsProduct((() => {
35803
- const $102 = showExpr(dictShow);
35804
- return { genericShowArgs: (v) => [$102.show(v)] };
35805
- })())((() => {
35806
- const $102 = showExpr(dictShow);
35807
- return { genericShowArgs: (v) => [$102.show(v)] };
35808
- })()))(AppIsSymbol);
35809
- const $11 = genericShowConstructor(genericShowArgsProduct((() => {
35810
- const $112 = showExpr(dictShow);
35811
- return { genericShowArgs: (v) => [$112.show(v)] };
35812
- })())(genericShowArgsProduct(genericShowArgsArgument)((() => {
35813
- const $112 = showExpr(dictShow);
35814
- return { genericShowArgs: (v) => [$112.show(v)] };
35815
- })())))(BinaryAppIsSymbol);
35816
- const $12 = genericShowConstructor(genericShowArgsProduct((() => {
35817
- const $122 = showExpr(dictShow);
35818
- return { genericShowArgs: (v) => [$122.show(v)] };
35819
- })())((() => {
35820
- const $122 = showNonEmptyList(showTuple1(showExpr(dictShow)));
35821
- return { genericShowArgs: (v) => [$122.show(v)] };
35822
- })()))(MatchAsIsSymbol);
35823
- const $13 = genericShowConstructor(genericShowArgsProduct((() => {
35824
- const $132 = showExpr(dictShow);
35825
- return { genericShowArgs: (v) => [$132.show(v)] };
35826
- })())(genericShowArgsProduct((() => {
35827
- const $132 = showExpr(dictShow);
35828
- return { genericShowArgs: (v) => [$132.show(v)] };
35829
- })())((() => {
35830
- const $132 = showExpr(dictShow);
35831
- return { genericShowArgs: (v) => [$132.show(v)] };
35832
- })())))(IfElseIsSymbol);
35833
- const $14 = genericShowConstructor((() => {
35834
- const $142 = showList(showParagraphElem(dictShow));
35835
- return { genericShowArgs: (v) => [$142.show(v)] };
35836
- })())(ParagraphIsSymbol);
35837
- const $15 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsProduct((() => {
35838
- const $152 = showExpr(dictShow);
35839
- return { genericShowArgs: (v) => [$152.show(v)] };
35840
- })())((() => {
35841
- const $152 = showListRest(dictShow);
35842
- return { genericShowArgs: (v) => [$152.show(v)] };
35843
- })())))(ListNonEmptyIsSymbol);
35844
- const $16 = genericShowConstructor(genericShowArgsProduct((() => {
35845
- const $162 = showExpr(dictShow);
35846
- return { genericShowArgs: (v) => [$162.show(v)] };
35847
- })())((() => {
35848
- const $162 = showExpr(dictShow);
35849
- return { genericShowArgs: (v) => [$162.show(v)] };
35850
- })()))(ListEnumIsSymbol);
35851
- const $17 = genericShowConstructor(genericShowArgsProduct(genericShowArgsArgument3)(genericShowArgsProduct((() => {
35852
- const $172 = showExpr(dictShow);
35853
- return { genericShowArgs: (v) => [$172.show(v)] };
35854
- })())((() => {
35855
- const $172 = showList(showQualifier(dictShow));
35856
- return { genericShowArgs: (v) => [$172.show(v)] };
35857
- })())))(ListCompIsSymbol);
35858
- const $18 = genericShowConstructor(genericShowArgsProduct((() => {
35859
- const $182 = showNonEmptyList(showVarDef(dictShow));
35860
- return { genericShowArgs: (v) => [$182.show(v)] };
35861
- })())((() => {
35862
- const $182 = showExpr(dictShow);
35863
- return { genericShowArgs: (v) => [$182.show(v)] };
35864
- })()))(LetIsSymbol);
35865
- const $19 = genericShowConstructor(genericShowArgsProduct((() => {
35866
- const $192 = showNonEmptyList(showTuple(showClause(dictShow)));
35867
- return { genericShowArgs: (v) => [$192.show(v)] };
35868
- })())((() => {
35869
- const $192 = showExpr(dictShow);
35870
- return { genericShowArgs: (v) => [$192.show(v)] };
35871
- })()))(LetRecIsSymbol);
35872
- const $20 = genericShowConstructor(genericShowArgsProduct((() => {
35873
- const $202 = showExpr(dictShow);
35874
- return { genericShowArgs: (v) => [$202.show(v)] };
35875
- })())((() => {
35876
- const $202 = showExpr(dictShow);
35877
- return { genericShowArgs: (v) => [$202.show(v)] };
35878
- })()))(DocExprIsSymbol);
35879
- return {
35880
- "genericShow'": (v) => {
35881
- if (v.tag === "Inl") {
35882
- return $0["genericShow'"](v._1);
35883
- }
35884
- if (v.tag === "Inr") {
35885
- if (v._1.tag === "Inl") {
35886
- return $1["genericShow'"](v._1._1);
35887
- }
35888
- if (v._1.tag === "Inr") {
35889
- if (v._1._1.tag === "Inl") {
35890
- return $2["genericShow'"](v._1._1._1);
35891
- }
35892
- if (v._1._1.tag === "Inr") {
35893
- if (v._1._1._1.tag === "Inl") {
35894
- return $4["genericShow'"](v._1._1._1._1);
35895
- }
35896
- if (v._1._1._1.tag === "Inr") {
35897
- if (v._1._1._1._1.tag === "Inl") {
35898
- return $5["genericShow'"](v._1._1._1._1._1);
35899
- }
35900
- if (v._1._1._1._1.tag === "Inr") {
35901
- if (v._1._1._1._1._1.tag === "Inl") {
35902
- return $6["genericShow'"](v._1._1._1._1._1._1);
35903
- }
35904
- if (v._1._1._1._1._1.tag === "Inr") {
35905
- if (v._1._1._1._1._1._1.tag === "Inl") {
35906
- return $7["genericShow'"](v._1._1._1._1._1._1._1);
35907
- }
35908
- if (v._1._1._1._1._1._1.tag === "Inr") {
35909
- if (v._1._1._1._1._1._1._1.tag === "Inl") {
35910
- return $8["genericShow'"](v._1._1._1._1._1._1._1._1);
35911
- }
35912
- if (v._1._1._1._1._1._1._1.tag === "Inr") {
35913
- if (v._1._1._1._1._1._1._1._1.tag === "Inl") {
35914
- return $9["genericShow'"](v._1._1._1._1._1._1._1._1._1);
35915
- }
35916
- if (v._1._1._1._1._1._1._1._1.tag === "Inr") {
35917
- if (v._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35918
- return $10["genericShow'"](v._1._1._1._1._1._1._1._1._1._1);
35919
- }
35920
- if (v._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35921
- if (v._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35922
- return $11["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1);
35923
- }
35924
- if (v._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35925
- if (v._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35926
- return $12["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1);
35927
- }
35928
- if (v._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35929
- if (v._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35930
- return $13["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1);
35931
- }
35932
- if (v._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35933
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35934
- return $14["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35935
- }
35936
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35937
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35938
- return $3["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35939
- }
35940
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35941
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35942
- return $15["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35943
- }
35944
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35945
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35946
- return $16["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35947
- }
35948
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35949
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35950
- return $17["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35951
- }
35952
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35953
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35954
- return $18["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35955
- }
35956
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35957
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inl") {
35958
- return $19["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35959
- }
35960
- if (v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.tag === "Inr") {
35961
- return $20["genericShow'"](v._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1);
35962
- }
35963
- }
35964
- }
35965
- }
35966
- }
35967
- }
35968
- }
35969
- }
35970
- }
35971
- }
35972
- }
35973
- }
35974
- }
35975
- }
35976
- }
35977
- }
35978
- }
35979
- }
35980
- }
35981
- }
35982
- fail();
35983
- }
35984
- };
35985
- })()))["genericShow'"](genericExpr_.from(c))
35986
- };
35987
- };
35988
- var showDictEntry = (dictShow) => {
35989
- const genericShowConstructor2 = genericShowConstructor(genericShowArgsProduct({ genericShowArgs: (v) => [dictShow.show(v)] })(genericShowArgsArgument))(VarKeyIsSymbol);
35990
- return {
35991
- show: (c) => {
35992
- const $0 = genericShowConstructor((() => {
35993
- const $02 = showExpr(dictShow);
35994
- return { genericShowArgs: (v) => [$02.show(v)] };
35995
- })())(ExprKeyIsSymbol);
35996
- if (c.tag === "ExprKey") {
35997
- return $0["genericShow'"](c._1);
35998
- }
35999
- if (c.tag === "VarKey") {
36000
- return genericShowConstructor2["genericShow'"]($Product(c._1, c._2));
36001
- }
36002
- fail();
36003
- }
36004
- };
36005
- };
36006
- var showClauses = (dictShow) => ({
36007
- show: (c) => genericShowConstructor((() => {
36008
- const $0 = showNonEmptyList(showClause(dictShow));
36009
- return { genericShowArgs: (v) => [$0.show(v)] };
36010
- })())(ClausesIsSymbol)["genericShow'"](c)
36011
- });
36012
- var showClause = (dictShow) => ({
36013
- show: (c) => genericShowConstructor((() => {
36014
- const $0 = showTuple2(showExpr(dictShow));
36015
- return { genericShowArgs: (v) => [$0.show(v)] };
36016
- })())(ClauseIsSymbol)["genericShow'"](c)
36017
- });
36018
- var show2 = /* @__PURE__ */ (() => showExpr(showUnit).show)();
36019
34799
  var functorVarDef2 = { map: (f) => (m) => $VarDef2(m._1, functorExpr2.map(f)(m._2)) };
36020
34800
  var functorQualifier = {
36021
34801
  map: (f) => (m) => {
@@ -36113,7 +34893,15 @@ var functorExpr2 = {
36113
34893
  );
36114
34894
  }
36115
34895
  if (m.tag === "IfElse") {
36116
- return $Expr2("IfElse", functorExpr2.map(f)(m._1), functorExpr2.map(f)(m._2), functorExpr2.map(f)(m._3));
34896
+ return $Expr2(
34897
+ "IfElse",
34898
+ (() => {
34899
+ const $0 = functorExpr2.map(f);
34900
+ const $1 = functorExpr2.map(f);
34901
+ return $NonEmpty($Tuple($0(m._1._1._1), $1(m._1._1._2)), listMap((v) => $Tuple($0(v._1), $1(v._2)))(m._1._2));
34902
+ })(),
34903
+ functorExpr2.map(f)(m._2)
34904
+ );
36117
34905
  }
36118
34906
  if (m.tag === "Paragraph") {
36119
34907
  return $Expr2("Paragraph", listMap(functorParagraphElem.map(f))(m._1));
@@ -37386,7 +36174,7 @@ var listCompFwd = (dictMonadError) => {
37386
36174
  );
37387
36175
  })()))((\u03C3) => Functor0.map(App2($Expr(
37388
36176
  "App",
37389
- $Expr("Var", "concatMap"),
36177
+ $Expr("Var", "concat_map"),
37390
36178
  $Expr("Lambda", $1, \u03C3.tag === "ContElim" ? \u03C3._1 : throwException(error("Eliminator expected"))())
37391
36179
  )))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())($0)));
37392
36180
  }
@@ -37446,7 +36234,7 @@ var listCompBwd = (dictBoundedJoinSemilattice) => {
37446
36234
  }
37447
36235
  return throwException(error("absurd"))();
37448
36236
  }
37449
- if (v._1.tag === "App" && v._1._1.tag === "Var" && v._1._1._1 === "concatMap" && v._1._2.tag === "Lambda" && v1._1._1.tag === "ListCompGen") {
36237
+ if (v._1.tag === "App" && v._1._1.tag === "Var" && v._1._1._1 === "concat_map" && v._1._2.tag === "Lambda" && v1._1._1.tag === "ListCompGen") {
37450
36238
  const $2 = orElseBwd1($Tuple(
37451
36239
  $List("Cons", $Either("Left", v1._1._1._1), Nil),
37452
36240
  $Expr2("ListComp", void 0, v1._2, v1._1._2)
@@ -37489,6 +36277,73 @@ var listCompBwd = (dictBoundedJoinSemilattice) => {
37489
36277
  return throwException(error("absurd"))();
37490
36278
  };
37491
36279
  };
36280
+ var ifElseFwd = (dictBoundedLattice) => {
36281
+ const top3 = dictBoundedLattice.BoundedMeetSemilattice1().top;
36282
+ return (dictMonadError) => {
36283
+ const Apply0 = dictMonadError.MonadThrow0().Monad0().Bind1().Apply0();
36284
+ const $0 = Apply0.Functor0();
36285
+ return (v) => {
36286
+ const $1 = (v1, e3) => Apply0.apply($0.map(App2)($0.map(Lambda(top3))(Apply0.apply($0.map(elimBool)($0.map(ContExpr)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v1._2))))($0.map(ContExpr)(e3)))))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v1._1));
36287
+ return $1(
36288
+ v._1._1,
36289
+ foldableList.foldr(($2) => ($3) => $1($2, $3))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2))(v._1._2)
36290
+ );
36291
+ };
36292
+ };
36293
+ };
36294
+ var ifElseBwd = (dictBoundedJoinSemilattice) => {
36295
+ const botOf = functorExpr2.map((() => {
36296
+ const $0 = dictBoundedJoinSemilattice.bot;
36297
+ return (v) => $0;
36298
+ })());
36299
+ return (v) => (v1) => {
36300
+ if (v.tag === "App" && v._1.tag === "Lambda" && v._1._2.tag === "ElimConstr") {
36301
+ const $0 = v._1._2._1;
36302
+ const bwdWhen = (c) => {
36303
+ if (Object.hasOwn($0, c)) {
36304
+ return exprBwd(dictBoundedJoinSemilattice)((() => {
36305
+ const $1 = $$get(showString)(mapDictString)(c)($0);
36306
+ if ($1.tag === "ContExpr") {
36307
+ return $1._1;
36308
+ }
36309
+ return throwException(error("Expression expected"))();
36310
+ })());
36311
+ }
36312
+ return botOf;
36313
+ };
36314
+ if (v1._1._2.tag === "Nil") {
36315
+ return $Tuple(
36316
+ nonEmptyListNonEmptyList.nonEmpty($List(
36317
+ "Cons",
36318
+ $Tuple(exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1._1._1), bwdWhen("True")(v1._1._1._2)),
36319
+ Nil
36320
+ )),
36321
+ bwdWhen("False")(v1._2)
36322
+ );
36323
+ }
36324
+ const v3 = bwdWhen("False")($Expr2("IfElse", nonEmptyListNonEmptyList.nonEmpty(v1._1._2), v1._2));
36325
+ if (v3.tag === "IfElse") {
36326
+ return $Tuple(
36327
+ nonEmptyListNonEmptyList.nonEmpty($List(
36328
+ "Cons",
36329
+ $Tuple(exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1._1._1), bwdWhen("True")(v1._1._1._2)),
36330
+ $List("Cons", v3._1._1, v3._1._2)
36331
+ )),
36332
+ v3._2
36333
+ );
36334
+ }
36335
+ return $Tuple(
36336
+ nonEmptyListNonEmptyList.nonEmpty($List(
36337
+ "Cons",
36338
+ $Tuple(exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1._1._1), bwdWhen("True")(v1._1._1._2)),
36339
+ throwException(error("absurd"))()._1
36340
+ )),
36341
+ throwException(error("absurd"))()._2
36342
+ );
36343
+ }
36344
+ return throwException(error("absurd"))();
36345
+ };
36346
+ };
37492
36347
  var exprFwd = (dictBoundedLattice) => {
37493
36348
  const top3 = dictBoundedLattice.BoundedMeetSemilattice1().top;
37494
36349
  const JoinSemilattice0 = dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0();
@@ -37575,8 +36430,7 @@ var exprFwd = (dictBoundedLattice) => {
37575
36430
  return Functor0.map(Lambda(top3))(desugarableClausesElim.desug(dictMonadError)(dictBoundedLattice)(v._1));
37576
36431
  }
37577
36432
  if (v.tag === "Project") {
37578
- const $0 = v._2;
37579
- return Functor0.map((f) => f($0))(Functor0.map(Project)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1)));
36433
+ return Functor0.map((f) => f($Expr("Str", top3, v._2)))(Functor0.map(DProject)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1)));
37580
36434
  }
37581
36435
  if (v.tag === "DProject") {
37582
36436
  return Apply0.apply(Functor0.map(DProject)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1)))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2));
@@ -37594,7 +36448,7 @@ var exprFwd = (dictBoundedLattice) => {
37594
36448
  )))))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1));
37595
36449
  }
37596
36450
  if (v.tag === "IfElse") {
37597
- return Apply0.apply(Functor0.map(App2)(Functor0.map(Lambda(top3))(Apply0.apply(Functor0.map(elimBool)(Functor0.map(ContExpr)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2))))(Functor0.map(ContExpr)(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._3))))))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1));
36451
+ return ifElseFwd(dictBoundedLattice)(dictMonadError)($Tuple(v._1, v._2));
37598
36452
  }
37599
36453
  if (v.tag === "Paragraph") {
37600
36454
  return paragraphFwd(dictBoundedLattice)(dictMonadError)(v._1);
@@ -37607,7 +36461,11 @@ var exprFwd = (dictBoundedLattice) => {
37607
36461
  return Apply0.apply(Functor0.map((e) => (e$p) => $Expr("Constr", $0, ":", $List("Cons", e, $List("Cons", e$p, Nil))))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2)))(desugarableListRestExpr.desug(dictMonadError)(dictBoundedLattice)(v._3));
37608
36462
  }
37609
36463
  if (v.tag === "ListEnum") {
37610
- return Apply0.apply(Functor0.map(App2)(Functor0.map(App2($Expr("Var", "enumFromTo")))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1))))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2));
36464
+ return Apply0.apply(Functor0.map(App2)(Functor0.map(App2($Expr("Var", "range")))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._1))))(Functor0.map((f) => f($Expr(
36465
+ "Int",
36466
+ top3,
36467
+ 1
36468
+ )))(Functor0.map(App2)(Functor0.map(App2($Expr("Op", "+")))(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0())(v._2)))));
37611
36469
  }
37612
36470
  if (v.tag === "ListComp") {
37613
36471
  if (v._3.tag === "Cons" && v._3._1.tag === "ListCompGen") {
@@ -37636,339 +36494,314 @@ var exprFwd = (dictBoundedLattice) => {
37636
36494
  };
37637
36495
  };
37638
36496
  };
37639
- var exprBwd = (dictBoundedJoinSemilattice) => {
37640
- const $0 = functorExpr2.map((() => {
37641
- const $02 = dictBoundedJoinSemilattice.bot;
37642
- return (v) => $02;
37643
- })());
37644
- return (v) => (v1) => {
37645
- const $1 = (e, q, qs, s) => {
37646
- const v2 = listCompBwd(dictBoundedJoinSemilattice)(e)($Tuple($List("Cons", q, qs), s));
37647
- return $Expr2("ListComp", v2._1, v2._2._2, v2._2._1);
37648
- };
37649
- const $2 = (e, qs, s) => {
37650
- const v2 = listCompBwd(dictBoundedJoinSemilattice)(e)($Tuple(qs, s));
37651
- return $Expr2("ListComp", v2._1, v2._2._2, v2._2._1);
37652
- };
37653
- if (v.tag === "Var") {
37654
- if (v1.tag === "Var") {
37655
- return $Expr2("Var", v1._1);
37656
- }
37657
- if (v1.tag === "ListComp") {
37658
- return $2(v, v1._3, v1._2);
37659
- }
37660
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36497
+ var exprBwd = (dictBoundedJoinSemilattice) => (v) => (v1) => {
36498
+ const $0 = (e, q, qs, s) => {
36499
+ const v2 = listCompBwd(dictBoundedJoinSemilattice)(e)($Tuple($List("Cons", q, qs), s));
36500
+ return $Expr2("ListComp", v2._1, v2._2._2, v2._2._1);
36501
+ };
36502
+ const $1 = (e, qs, s) => {
36503
+ const v2 = listCompBwd(dictBoundedJoinSemilattice)(e)($Tuple(qs, s));
36504
+ return $Expr2("ListComp", v2._1, v2._2._2, v2._2._1);
36505
+ };
36506
+ if (v.tag === "Var") {
36507
+ if (v1.tag === "Var") {
36508
+ return $Expr2("Var", v1._1);
37661
36509
  }
37662
- if (v.tag === "Op") {
37663
- if (v1.tag === "Op") {
37664
- return $Expr2("Op", v1._1);
37665
- }
37666
- if (v1.tag === "ListComp") {
37667
- return $2(v, v1._3, v1._2);
37668
- }
37669
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36510
+ if (v1.tag === "ListComp") {
36511
+ return $1(v, v1._3, v1._2);
37670
36512
  }
37671
- if (v.tag === "Int") {
37672
- if (v1.tag === "Int") {
37673
- return $Expr2("Int", v._1, v1._2);
37674
- }
37675
- if (v1.tag === "ListComp") {
37676
- return $2(v, v1._3, v1._2);
37677
- }
37678
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36513
+ return throwException(error("absurd"))();
36514
+ }
36515
+ if (v.tag === "Op") {
36516
+ if (v1.tag === "Op") {
36517
+ return $Expr2("Op", v1._1);
37679
36518
  }
37680
- if (v.tag === "Float") {
37681
- if (v1.tag === "Float") {
37682
- return $Expr2("Float", v._1, v1._2);
37683
- }
37684
- if (v1.tag === "ListComp") {
37685
- return $2(v, v1._3, v1._2);
37686
- }
37687
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36519
+ if (v1.tag === "ListComp") {
36520
+ return $1(v, v1._3, v1._2);
37688
36521
  }
37689
- if (v.tag === "Str") {
37690
- if (v1.tag === "Str") {
37691
- return $Expr2("Str", v._1, v1._2);
37692
- }
37693
- if (v1.tag === "ListComp") {
37694
- return $2(v, v1._3, v1._2);
37695
- }
37696
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36522
+ return throwException(error("absurd"))();
36523
+ }
36524
+ if (v.tag === "Int") {
36525
+ if (v1.tag === "Int") {
36526
+ return $Expr2("Int", v._1, v1._2);
36527
+ }
36528
+ if (v1.tag === "ListComp") {
36529
+ return $1(v, v1._3, v1._2);
36530
+ }
36531
+ return throwException(error("absurd"))();
36532
+ }
36533
+ if (v.tag === "Float") {
36534
+ if (v1.tag === "Float") {
36535
+ return $Expr2("Float", v._1, v1._2);
36536
+ }
36537
+ if (v1.tag === "ListComp") {
36538
+ return $1(v, v1._3, v1._2);
36539
+ }
36540
+ return throwException(error("absurd"))();
36541
+ }
36542
+ if (v.tag === "Str") {
36543
+ if (v1.tag === "Str") {
36544
+ return $Expr2("Str", v._1, v1._2);
36545
+ }
36546
+ if (v1.tag === "ListComp") {
36547
+ return $1(v, v1._3, v1._2);
37697
36548
  }
37698
- if (v.tag === "Constr") {
37699
- if (v1.tag === "Constr") {
37700
- return $Expr2(
37701
- "Constr",
37702
- v._1,
37703
- v1._2,
37704
- listMap((() => {
37705
- const $3 = exprBwd(dictBoundedJoinSemilattice);
37706
- return (v$1) => $3(v$1._1)(v$1._2);
37707
- })())((() => {
37708
- const go = (go$a0$copy) => (go$a1$copy) => (go$a2$copy) => {
37709
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$a2 = go$a2$copy, go$c = true, go$r;
37710
- while (go$c) {
37711
- const v$1 = go$a0, v1$1 = go$a1, v2 = go$a2;
37712
- if (v$1.tag === "Nil") {
37713
- go$c = false;
37714
- go$r = v2;
37715
- continue;
37716
- }
37717
- if (v1$1.tag === "Nil") {
37718
- go$c = false;
37719
- go$r = v2;
37720
- continue;
37721
- }
37722
- if (v$1.tag === "Cons" && v1$1.tag === "Cons") {
37723
- go$a0 = v$1._2;
37724
- go$a1 = v1$1._2;
37725
- go$a2 = $List("Cons", $Tuple(v$1._1, v1$1._1), v2);
37726
- continue;
37727
- }
37728
- fail();
36549
+ return throwException(error("absurd"))();
36550
+ }
36551
+ if (v.tag === "Constr") {
36552
+ if (v1.tag === "Constr") {
36553
+ return $Expr2(
36554
+ "Constr",
36555
+ v._1,
36556
+ v1._2,
36557
+ listMap((() => {
36558
+ const $2 = exprBwd(dictBoundedJoinSemilattice);
36559
+ return (v$1) => $2(v$1._1)(v$1._2);
36560
+ })())((() => {
36561
+ const go = (go$a0$copy) => (go$a1$copy) => (go$a2$copy) => {
36562
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$a2 = go$a2$copy, go$c = true, go$r;
36563
+ while (go$c) {
36564
+ const v$1 = go$a0, v1$1 = go$a1, v2 = go$a2;
36565
+ if (v$1.tag === "Nil") {
36566
+ go$c = false;
36567
+ go$r = v2;
36568
+ continue;
37729
36569
  }
37730
- return go$r;
37731
- };
37732
- const go$1 = (go$1$a0$copy) => (go$1$a1$copy) => {
37733
- let go$1$a0 = go$1$a0$copy, go$1$a1 = go$1$a1$copy, go$1$c = true, go$1$r;
37734
- while (go$1$c) {
37735
- const v$1 = go$1$a0, v1$1 = go$1$a1;
37736
- if (v1$1.tag === "Nil") {
37737
- go$1$c = false;
37738
- go$1$r = v$1;
37739
- continue;
37740
- }
37741
- if (v1$1.tag === "Cons") {
37742
- go$1$a0 = $List("Cons", v1$1._1, v$1);
37743
- go$1$a1 = v1$1._2;
37744
- continue;
37745
- }
37746
- fail();
36570
+ if (v1$1.tag === "Nil") {
36571
+ go$c = false;
36572
+ go$r = v2;
36573
+ continue;
37747
36574
  }
37748
- return go$1$r;
37749
- };
37750
- return go$1(Nil)(go(v._3)(v1._3)(Nil));
37751
- })())
37752
- );
37753
- }
37754
- if (v._3.tag === "Cons") {
37755
- if (v._3._2.tag === "Nil") {
37756
- if (v1.tag === "Paragraph") {
37757
- if (v._2 === "Paragraph") {
37758
- return $Expr2("Paragraph", paragraphElemsBwd(dictBoundedJoinSemilattice)(v._3._1)(v1._1));
36575
+ if (v$1.tag === "Cons" && v1$1.tag === "Cons") {
36576
+ go$a0 = v$1._2;
36577
+ go$a1 = v1$1._2;
36578
+ go$a2 = $List("Cons", $Tuple(v$1._1, v1$1._1), v2);
36579
+ continue;
36580
+ }
36581
+ fail();
37759
36582
  }
37760
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37761
- }
37762
- if (v1.tag === "ListComp") {
37763
- return $2(v, v1._3, v1._2);
36583
+ return go$r;
36584
+ };
36585
+ const go$1 = (go$1$a0$copy) => (go$1$a1$copy) => {
36586
+ let go$1$a0 = go$1$a0$copy, go$1$a1 = go$1$a1$copy, go$1$c = true, go$1$r;
36587
+ while (go$1$c) {
36588
+ const v$1 = go$1$a0, v1$1 = go$1$a1;
36589
+ if (v1$1.tag === "Nil") {
36590
+ go$1$c = false;
36591
+ go$1$r = v$1;
36592
+ continue;
36593
+ }
36594
+ if (v1$1.tag === "Cons") {
36595
+ go$1$a0 = $List("Cons", v1$1._1, v$1);
36596
+ go$1$a1 = v1$1._2;
36597
+ continue;
36598
+ }
36599
+ fail();
36600
+ }
36601
+ return go$1$r;
36602
+ };
36603
+ return go$1(Nil)(go(v._3)(v1._3)(Nil));
36604
+ })())
36605
+ );
36606
+ }
36607
+ if (v._3.tag === "Cons") {
36608
+ if (v._3._2.tag === "Nil") {
36609
+ if (v1.tag === "Paragraph") {
36610
+ if (v._2 === "Paragraph") {
36611
+ return $Expr2("Paragraph", paragraphElemsBwd(dictBoundedJoinSemilattice)(v._3._1)(v1._1));
37764
36612
  }
37765
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37766
- }
37767
- if (v._3._2.tag === "Cons" && v._3._2._2.tag === "Nil" && v1.tag === "ListNonEmpty") {
37768
- return $Expr2("ListNonEmpty", v._1, exprBwd(dictBoundedJoinSemilattice)(v._3._1)(v1._2), desugarableListRestExpr.desugBwd(dictBoundedJoinSemilattice)(v._3._2._1)(v1._3));
36613
+ return throwException(error("absurd"))();
37769
36614
  }
37770
36615
  if (v1.tag === "ListComp") {
37771
- return $2(v, v1._3, v1._2);
36616
+ return $1(v, v1._3, v1._2);
37772
36617
  }
37773
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36618
+ return throwException(error("absurd"))();
37774
36619
  }
37775
- if (v._3.tag === "Nil" && v1.tag === "ListEmpty") {
37776
- return $Expr2("ListEmpty", v._1);
36620
+ if (v._3._2.tag === "Cons" && v._3._2._2.tag === "Nil" && v1.tag === "ListNonEmpty") {
36621
+ return $Expr2("ListNonEmpty", v._1, exprBwd(dictBoundedJoinSemilattice)(v._3._1)(v1._2), desugarableListRestExpr.desugBwd(dictBoundedJoinSemilattice)(v._3._2._1)(v1._3));
37777
36622
  }
37778
36623
  if (v1.tag === "ListComp") {
37779
- return $2(v, v1._3, v1._2);
36624
+ return $1(v, v1._3, v1._2);
37780
36625
  }
37781
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36626
+ return throwException(error("absurd"))();
37782
36627
  }
37783
- if (v.tag === "Dictionary") {
37784
- if (v1.tag === "Dictionary") {
37785
- return $Expr2(
37786
- "Dictionary",
37787
- v._1,
37788
- (() => {
37789
- const go = (go$a0$copy) => (go$a1$copy) => (go$a2$copy) => {
37790
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$a2 = go$a2$copy, go$c = true, go$r;
37791
- while (go$c) {
37792
- const v$1 = go$a0, v1$1 = go$a1, v2 = go$a2;
37793
- if (v$1.tag === "Nil") {
37794
- go$c = false;
37795
- go$r = v2;
37796
- continue;
37797
- }
37798
- if (v1$1.tag === "Nil") {
37799
- go$c = false;
37800
- go$r = v2;
37801
- continue;
37802
- }
37803
- if (v$1.tag === "Cons" && v1$1.tag === "Cons") {
37804
- go$a0 = v$1._2;
37805
- go$a1 = v1$1._2;
37806
- go$a2 = $List(
37807
- "Cons",
37808
- $Tuple(
37809
- desugarableDictEntryExpr.desugBwd(dictBoundedJoinSemilattice)(v$1._1._1)(v1$1._1._1),
37810
- exprBwd(dictBoundedJoinSemilattice)(v$1._1._2)(v1$1._1._2)
37811
- ),
37812
- v2
37813
- );
37814
- continue;
37815
- }
37816
- fail();
36628
+ if (v._3.tag === "Nil" && v1.tag === "ListEmpty") {
36629
+ return $Expr2("ListEmpty", v._1);
36630
+ }
36631
+ if (v1.tag === "ListComp") {
36632
+ return $1(v, v1._3, v1._2);
36633
+ }
36634
+ return throwException(error("absurd"))();
36635
+ }
36636
+ if (v.tag === "Dictionary") {
36637
+ if (v1.tag === "Dictionary") {
36638
+ return $Expr2(
36639
+ "Dictionary",
36640
+ v._1,
36641
+ (() => {
36642
+ const go = (go$a0$copy) => (go$a1$copy) => (go$a2$copy) => {
36643
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$a2 = go$a2$copy, go$c = true, go$r;
36644
+ while (go$c) {
36645
+ const v$1 = go$a0, v1$1 = go$a1, v2 = go$a2;
36646
+ if (v$1.tag === "Nil") {
36647
+ go$c = false;
36648
+ go$r = v2;
36649
+ continue;
37817
36650
  }
37818
- return go$r;
37819
- };
37820
- const go$1 = (go$1$a0$copy) => (go$1$a1$copy) => {
37821
- let go$1$a0 = go$1$a0$copy, go$1$a1 = go$1$a1$copy, go$1$c = true, go$1$r;
37822
- while (go$1$c) {
37823
- const v$1 = go$1$a0, v1$1 = go$1$a1;
37824
- if (v1$1.tag === "Nil") {
37825
- go$1$c = false;
37826
- go$1$r = v$1;
37827
- continue;
37828
- }
37829
- if (v1$1.tag === "Cons") {
37830
- go$1$a0 = $List("Cons", v1$1._1, v$1);
37831
- go$1$a1 = v1$1._2;
37832
- continue;
37833
- }
37834
- fail();
36651
+ if (v1$1.tag === "Nil") {
36652
+ go$c = false;
36653
+ go$r = v2;
36654
+ continue;
37835
36655
  }
37836
- return go$1$r;
37837
- };
37838
- return go$1(Nil)(go(v._2)(v1._2)(Nil));
37839
- })()
37840
- );
37841
- }
37842
- if (v1.tag === "ListComp") {
37843
- return $2(v, v1._3, v1._2);
37844
- }
37845
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36656
+ if (v$1.tag === "Cons" && v1$1.tag === "Cons") {
36657
+ go$a0 = v$1._2;
36658
+ go$a1 = v1$1._2;
36659
+ go$a2 = $List(
36660
+ "Cons",
36661
+ $Tuple(
36662
+ desugarableDictEntryExpr.desugBwd(dictBoundedJoinSemilattice)(v$1._1._1)(v1$1._1._1),
36663
+ exprBwd(dictBoundedJoinSemilattice)(v$1._1._2)(v1$1._1._2)
36664
+ ),
36665
+ v2
36666
+ );
36667
+ continue;
36668
+ }
36669
+ fail();
36670
+ }
36671
+ return go$r;
36672
+ };
36673
+ const go$1 = (go$1$a0$copy) => (go$1$a1$copy) => {
36674
+ let go$1$a0 = go$1$a0$copy, go$1$a1 = go$1$a1$copy, go$1$c = true, go$1$r;
36675
+ while (go$1$c) {
36676
+ const v$1 = go$1$a0, v1$1 = go$1$a1;
36677
+ if (v1$1.tag === "Nil") {
36678
+ go$1$c = false;
36679
+ go$1$r = v$1;
36680
+ continue;
36681
+ }
36682
+ if (v1$1.tag === "Cons") {
36683
+ go$1$a0 = $List("Cons", v1$1._1, v$1);
36684
+ go$1$a1 = v1$1._2;
36685
+ continue;
36686
+ }
36687
+ fail();
36688
+ }
36689
+ return go$1$r;
36690
+ };
36691
+ return go$1(Nil)(go(v._2)(v1._2)(Nil));
36692
+ })()
36693
+ );
37846
36694
  }
37847
- if (v.tag === "Matrix") {
37848
- if (v1.tag === "Matrix") {
37849
- return $Expr2("Matrix", v._1, exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2), $Tuple(v1._3._1, v1._3._2), exprBwd(dictBoundedJoinSemilattice)(v._4)(v1._4));
37850
- }
37851
- if (v1.tag === "ListComp") {
37852
- return $2(v, v1._3, v1._2);
37853
- }
37854
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36695
+ if (v1.tag === "ListComp") {
36696
+ return $1(v, v1._3, v1._2);
37855
36697
  }
37856
- if (v.tag === "Lambda") {
37857
- if (v1.tag === "Lambda") {
37858
- return $Expr2("Lambda", toClausesStateBwd(clausesStateBwd(dictBoundedJoinSemilattice)($Cont("ContElim", v._2))(toClausesStateFwd(v1._1))));
37859
- }
37860
- if (v1.tag === "ListComp") {
37861
- return $2(v, v1._3, v1._2);
37862
- }
37863
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36698
+ return throwException(error("absurd"))();
36699
+ }
36700
+ if (v.tag === "Matrix") {
36701
+ if (v1.tag === "Matrix") {
36702
+ return $Expr2("Matrix", v._1, exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2), $Tuple(v1._3._1, v1._3._2), exprBwd(dictBoundedJoinSemilattice)(v._4)(v1._4));
37864
36703
  }
37865
- if (v.tag === "Project") {
37866
- if (v1.tag === "Project") {
37867
- return $Expr2("Project", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), v._2);
37868
- }
37869
- if (v1.tag === "ListComp") {
37870
- return $2(v, v1._3, v1._2);
37871
- }
37872
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36704
+ if (v1.tag === "ListComp") {
36705
+ return $1(v, v1._3, v1._2);
37873
36706
  }
37874
- if (v.tag === "DProject") {
37875
- if (v1.tag === "DProject") {
37876
- return $Expr2("DProject", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
37877
- }
37878
- if (v1.tag === "ListComp") {
37879
- return $2(v, v1._3, v1._2);
37880
- }
37881
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36707
+ return throwException(error("absurd"))();
36708
+ }
36709
+ if (v.tag === "Lambda") {
36710
+ if (v1.tag === "Lambda") {
36711
+ return $Expr2("Lambda", toClausesStateBwd(clausesStateBwd(dictBoundedJoinSemilattice)($Cont("ContElim", v._2))(toClausesStateFwd(v1._1))));
37882
36712
  }
37883
- if (v.tag === "App") {
37884
- if (v1.tag === "App") {
37885
- return $Expr2("App", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
37886
- }
37887
- if (v._1.tag === "App") {
37888
- if (v._1._1.tag === "Op") {
37889
- if (v1.tag === "BinaryApp") {
37890
- return $Expr2("BinaryApp", exprBwd(dictBoundedJoinSemilattice)(v._1._2)(v1._1), v1._2, exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._3));
37891
- }
37892
- if (v1.tag === "ListComp") {
37893
- if (v1._3.tag === "Cons" && v1._3._1.tag === "ListCompGen") {
37894
- return $1(v, v1._3._1, v1._3._2, v1._2);
37895
- }
37896
- return $2(v, v1._3, v1._2);
37897
- }
37898
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37899
- }
37900
- if (v._1._1.tag === "Var" && v._1._1._1 === "enumFromTo" && v1.tag === "ListEnum") {
37901
- return $Expr2("ListEnum", exprBwd(dictBoundedJoinSemilattice)(v._1._2)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36713
+ if (v1.tag === "ListComp") {
36714
+ return $1(v, v1._3, v1._2);
36715
+ }
36716
+ return throwException(error("absurd"))();
36717
+ }
36718
+ if (v.tag === "DProject") {
36719
+ if (v1.tag === "Project") {
36720
+ return $Expr2("Project", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), v1._2);
36721
+ }
36722
+ if (v1.tag === "DProject") {
36723
+ return $Expr2("DProject", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36724
+ }
36725
+ if (v1.tag === "ListComp") {
36726
+ return $1(v, v1._3, v1._2);
36727
+ }
36728
+ return throwException(error("absurd"))();
36729
+ }
36730
+ if (v.tag === "App") {
36731
+ if (v1.tag === "App") {
36732
+ return $Expr2("App", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36733
+ }
36734
+ if (v._1.tag === "App") {
36735
+ if (v._1._1.tag === "Op") {
36736
+ if (v1.tag === "BinaryApp") {
36737
+ return $Expr2("BinaryApp", exprBwd(dictBoundedJoinSemilattice)(v._1._2)(v1._1), v1._2, exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._3));
37902
36738
  }
37903
36739
  if (v1.tag === "ListComp") {
37904
36740
  if (v1._3.tag === "Cons" && v1._3._1.tag === "ListCompGen") {
37905
- return $1(v, v1._3._1, v1._3._2, v1._2);
36741
+ return $0(v, v1._3._1, v1._3._2, v1._2);
37906
36742
  }
37907
- return $2(v, v1._3, v1._2);
36743
+ return $1(v, v1._3, v1._2);
37908
36744
  }
37909
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
36745
+ return throwException(error("absurd"))();
37910
36746
  }
37911
- if (v._1.tag === "Lambda") {
37912
- if (v1.tag === "MatchAs") {
37913
- return $Expr2(
37914
- "MatchAs",
37915
- exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1),
37916
- (() => {
37917
- const $3 = toClausesStateBwd(clausesStateBwd(dictBoundedJoinSemilattice)($Cont("ContElim", v._1._2))(toClausesStateFwd($NonEmpty(
37918
- $Tuple($NonEmpty(v1._2._1._1, Nil), v1._2._1._2),
37919
- listMap((x2) => $Tuple($NonEmpty(x2._1, Nil), x2._2))(v1._2._2)
37920
- ))));
37921
- return $NonEmpty($Tuple($3._1._1._1, $3._1._2), listMap((x2) => $Tuple(x2._1._1, x2._2))($3._2));
37922
- })()
37923
- );
37924
- }
37925
- if (v._1._2.tag === "ElimConstr" && v1.tag === "IfElse") {
37926
- return $Expr2(
37927
- "IfElse",
37928
- exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1),
37929
- Object.hasOwn(v._1._2._1, "True") ? exprBwd(dictBoundedJoinSemilattice)((() => {
37930
- const $3 = $$get(showString)(mapDictString)("True")(v._1._2._1);
37931
- if ($3.tag === "ContExpr") {
37932
- return $3._1;
37933
- }
37934
- return throwException(error("Expression expected"))();
37935
- })())(v1._2) : $0(v1._2),
37936
- Object.hasOwn(v._1._2._1, "False") ? exprBwd(dictBoundedJoinSemilattice)((() => {
37937
- const $3 = $$get(showString)(mapDictString)("False")(v._1._2._1);
37938
- if ($3.tag === "ContExpr") {
37939
- return $3._1;
37940
- }
37941
- return throwException(error("Expression expected"))();
37942
- })())(v1._3) : $0(v1._3)
37943
- );
36747
+ if (v._1._1.tag === "Var" && v._1._1._1 === "range" && v1.tag === "ListEnum") {
36748
+ if (v._2.tag === "App" && v._2._1.tag === "App") {
36749
+ return $Expr2("ListEnum", exprBwd(dictBoundedJoinSemilattice)(v._1._2)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2._1._2)(v1._2));
37944
36750
  }
36751
+ return throwException(error("absurd"))();
37945
36752
  }
37946
36753
  if (v1.tag === "ListComp") {
37947
- return $2(v, v1._3, v1._2);
36754
+ if (v1._3.tag === "Cons" && v1._3._1.tag === "ListCompGen") {
36755
+ return $0(v, v1._3._1, v1._3._2, v1._2);
36756
+ }
36757
+ return $1(v, v1._3, v1._2);
37948
36758
  }
37949
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37950
- }
37951
- if (v1.tag === "ListComp") {
37952
- return $2(v, v1._3, v1._2);
36759
+ return throwException(error("absurd"))();
37953
36760
  }
37954
- if (v.tag === "Let") {
37955
- if (v1.tag === "Let") {
37956
- const v2 = varDefsBwd(dictBoundedJoinSemilattice)($Expr("Let", v._1, v._2))($Tuple(v1._1, v1._2));
37957
- return $Expr2("Let", v2._1, v2._2);
36761
+ if (v._1.tag === "Lambda") {
36762
+ if (v1.tag === "MatchAs") {
36763
+ return $Expr2(
36764
+ "MatchAs",
36765
+ exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._1),
36766
+ (() => {
36767
+ const $2 = toClausesStateBwd(clausesStateBwd(dictBoundedJoinSemilattice)($Cont("ContElim", v._1._2))(toClausesStateFwd($NonEmpty(
36768
+ $Tuple($NonEmpty(v1._2._1._1, Nil), v1._2._1._2),
36769
+ listMap((x2) => $Tuple($NonEmpty(x2._1, Nil), x2._2))(v1._2._2)
36770
+ ))));
36771
+ return $NonEmpty($Tuple($2._1._1._1, $2._1._2), listMap((x2) => $Tuple(x2._1._1, x2._2))($2._2));
36772
+ })()
36773
+ );
37958
36774
  }
37959
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37960
- }
37961
- if (v.tag === "LetRec") {
37962
- if (v1.tag === "LetRec") {
37963
- return $Expr2("LetRec", recDefsBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36775
+ if (v._1._2.tag === "ElimConstr" && v1.tag === "IfElse") {
36776
+ const v2 = ifElseBwd(dictBoundedJoinSemilattice)(v)($Tuple(v1._1, v1._2));
36777
+ return $Expr2("IfElse", v2._1, v2._2);
37964
36778
  }
37965
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37966
36779
  }
37967
- if (v.tag === "DocExpr" && v1.tag === "DocExpr") {
37968
- return $Expr2("DocExpr", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36780
+ if (v1.tag === "ListComp") {
36781
+ return $1(v, v1._3, v1._2);
37969
36782
  }
37970
- return throwException(error("ExprBwd failed, s: " + show2(v1)))();
37971
- };
36783
+ return throwException(error("absurd"))();
36784
+ }
36785
+ if (v1.tag === "ListComp") {
36786
+ return $1(v, v1._3, v1._2);
36787
+ }
36788
+ if (v.tag === "Let") {
36789
+ if (v1.tag === "Let") {
36790
+ const v2 = varDefsBwd(dictBoundedJoinSemilattice)($Expr("Let", v._1, v._2))($Tuple(v1._1, v1._2));
36791
+ return $Expr2("Let", v2._1, v2._2);
36792
+ }
36793
+ return throwException(error("absurd"))();
36794
+ }
36795
+ if (v.tag === "LetRec") {
36796
+ if (v1.tag === "LetRec") {
36797
+ return $Expr2("LetRec", recDefsBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36798
+ }
36799
+ return throwException(error("absurd"))();
36800
+ }
36801
+ if (v.tag === "DocExpr" && v1.tag === "DocExpr") {
36802
+ return $Expr2("DocExpr", exprBwd(dictBoundedJoinSemilattice)(v._1)(v1._1), exprBwd(dictBoundedJoinSemilattice)(v._2)(v1._2));
36803
+ }
36804
+ return throwException(error("absurd"))();
37972
36805
  };
37973
36806
  var clausesStateFwd = (dictBoundedLattice) => {
37974
36807
  const top3 = dictBoundedLattice.BoundedMeetSemilattice1().top;
@@ -38271,9 +37104,9 @@ var vcommas = (v) => {
38271
37104
  };
38272
37105
  var prettyP = (dictPretty) => (x2) => renderWithIndent(Stmt)(0)(0)(dictPretty.pretty(x2))._1;
38273
37106
  var getPrec = (x2) => {
38274
- const v = lookup2(x2)(opDefs);
37107
+ const v = lookup2(x2)(opMap);
38275
37108
  if (v.tag === "Just") {
38276
- return v._1.prec;
37109
+ return v._1._4;
38277
37110
  }
38278
37111
  if (v.tag === "Nothing") {
38279
37112
  return -1;
@@ -39808,6 +38641,10 @@ var applyEnvExpr = {
39808
38641
  apply: (v) => (v1) => $EnvExpr(intersectionWith_Object(apply)(_fmapObject(v._1, applyVal.apply))(v1._1), applyExpr.apply(v._2)(v1._2)),
39809
38642
  Functor0: () => functorEnvExpr
39810
38643
  };
38644
+ var val = (dictMonadWithGraphAlloc) => {
38645
+ const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
38646
+ return (doc_opt) => $$new((a) => Val(a)(doc_opt));
38647
+ };
39811
38648
  var unrestrictGC = (dictBoundedMeetSemilattice) => (\u03B3) => (xs) => {
39812
38649
  const unfound = setSet1.difference(xs)(mapObjectString.keys(\u03B3));
39813
38650
  return assertWith("Variable(s) " + joinWith(", ")(arrayMap(showStringImpl)(fromFoldableImpl(
@@ -39857,25 +38694,23 @@ var reaches = (\u03C1) => (xs) => {
39857
38694
  return go(toUnfoldable12(xs))(setSet1.empty);
39858
38695
  };
39859
38696
  var matrixPut = (i) => (j) => (\u03B4v) => (v) => {
39860
- const vs_i = unsafeArrayArray.unsafeIndex(v._1)(i - 1 | 0);
38697
+ const vs_i = unsafeArrayArray.unsafeIndex(v._1)(i);
39861
38698
  return $Tuple(
39862
38699
  definitely("index within bounds")(_updateAt(
39863
38700
  Just,
39864
38701
  Nothing,
39865
- i - 1 | 0,
39866
- definitely("index within bounds")(_updateAt(Just, Nothing, j - 1 | 0, \u03B4v(unsafeArrayArray.unsafeIndex(vs_i)(j - 1 | 0)), vs_i)),
38702
+ i,
38703
+ definitely("index within bounds")(_updateAt(Just, Nothing, j, \u03B4v(unsafeArrayArray.unsafeIndex(vs_i)(j)), vs_i)),
39867
38704
  v._1
39868
38705
  )),
39869
38706
  $Tuple(v._2._1, v._2._2)
39870
38707
  );
39871
38708
  };
39872
38709
  var matrixGet = (i) => (j) => (v) => definitely("index out of bounds!")((() => {
39873
- const $0 = i - 1 | 0;
39874
- if ($0 >= 0 && $0 < v._1.length) {
39875
- const $1 = v._1[$0];
39876
- const $2 = j - 1 | 0;
39877
- if ($2 >= 0 && $2 < $1.length) {
39878
- return $Maybe("Just", $1[$2]);
38710
+ if (i >= 0 && i < v._1.length) {
38711
+ const $0 = v._1[i];
38712
+ if (j >= 0 && j < $0.length) {
38713
+ return $Maybe("Just", $0[j]);
39879
38714
  }
39880
38715
  }
39881
38716
  return Nothing;
@@ -39919,11 +38754,10 @@ var unary = (dictBoundedJoinSemilattice) => {
39919
38754
  $ForeignOp$p({
39920
38755
  arity: 1,
39921
38756
  op: (dictMonadWithGraphAlloc) => {
39922
- const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
39923
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
38757
+ const val2 = val(dictMonadWithGraphAlloc);
38758
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (doc_opt) => (v) => {
39924
38759
  if (v.tag === "Cons" && v._2.tag === "Nil") {
39925
- const $0 = v._1._2;
39926
- return $$new((a) => Val(a)($0))($$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf))(f.o.pack(f.fwd(f.i.unpack(v._1._3))));
38760
+ return val2(doc_opt)($$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf))(f.o.pack(f.fwd(f.i.unpack(v._1._3))));
39927
38761
  }
39928
38762
  fail();
39929
38763
  };
@@ -40068,12 +38902,12 @@ var binaryZero = (dictBoundedJoinSemilattice) => {
40068
38902
  $ForeignOp$p({
40069
38903
  arity: 2,
40070
38904
  op: (dictMonadWithGraphAlloc) => {
40071
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
40072
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
38905
+ const val2 = val(dictMonadWithGraphAlloc);
38906
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (doc_opt) => (v) => {
40073
38907
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
40074
38908
  const $0 = f.i.unpack(v._1._3);
40075
38909
  const $1 = f.i.unpack(v._2._1._3);
40076
- return val((() => {
38910
+ return val2(doc_opt)((() => {
40077
38911
  if (dictIsZero.isZero($0)) {
40078
38912
  return $$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf);
40079
38913
  }
@@ -40118,10 +38952,10 @@ var binary = (dictBoundedJoinSemilattice) => {
40118
38952
  $ForeignOp$p({
40119
38953
  arity: 2,
40120
38954
  op: (dictMonadWithGraphAlloc) => {
40121
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
40122
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
38955
+ const val2 = val(dictMonadWithGraphAlloc);
38956
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (doc_opt) => (v) => {
40123
38957
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
40124
- return val(insert3(ordVertex)(v._2._1._1)()($$$Map(
38958
+ return val2(doc_opt)(insert3(ordVertex)(v._2._1._1)()($$$Map(
40125
38959
  "Node",
40126
38960
  1,
40127
38961
  1,
@@ -40182,7 +39016,7 @@ function type_(e) {
40182
39016
  var $SelState = (tag, _1) => ({ tag, _1 });
40183
39017
  var $SelectionType = (tag) => tag;
40184
39018
  var $\u{1D54A} = (tag) => tag;
40185
- var genericShowSum7 = /* @__PURE__ */ (() => {
39019
+ var genericShowSum4 = /* @__PURE__ */ (() => {
40186
39020
  const $0 = genericShowConstructor(genericShowArgsNoArguments)({ reflectSymbol: () => "Inert" });
40187
39021
  return (dictGenericShow1) => ({
40188
39022
  "genericShow'": (v) => {
@@ -40247,7 +39081,7 @@ var highlightableSelStates = (dictHighlightable) => (dictJoinSemilattice) => ({
40247
39081
  var prettyP2 = /* @__PURE__ */ prettyP(/* @__PURE__ */ prettyVal(/* @__PURE__ */ highlightableSelStates(highlightableBoolean)(joinSemilatticeBoolean)));
40248
39082
  var showSelState = (dictShow) => ({
40249
39083
  show: (() => {
40250
- const $0 = genericShowSum7(genericShowConstructor({ genericShowArgs: (v) => [dictShow.show(v)] })(ReactiveIsSymbol));
39084
+ const $0 = genericShowSum4(genericShowConstructor({ genericShowArgs: (v) => [dictShow.show(v)] })(ReactiveIsSymbol));
40251
39085
  return (x2) => $0["genericShow'"]((() => {
40252
39086
  if (x2.tag === "Inert") {
40253
39087
  return $Sum("Inl", NoArguments);
@@ -41707,14 +40541,14 @@ var draw = (dictViewable) => (v) => (v1) => (select$p) => {
41707
40541
  const childId = $0 + "-" + v1.suffix;
41708
40542
  const $2 = rootSelect("#" + $0);
41709
40543
  return () => {
41710
- const div = $2();
41711
- const a$p = isEmpty3(div)();
40544
+ const div2 = $2();
40545
+ const a$p = isEmpty3(div2)();
41712
40546
  check(monadThrowEffect)(!a$p)("Unable to insert figure: no div found with id " + $0)();
41713
- const maybeRootElement = select("#" + childId)(div)();
40547
+ const maybeRootElement = select("#" + childId)(div2)();
41714
40548
  const v2 = isEmpty3(maybeRootElement)();
41715
40549
  const $3 = (() => {
41716
40550
  if (v2) {
41717
- const a$p$1 = dictViewable.createElement()($1)(div)();
40551
+ const a$p$1 = dictViewable.createElement()($1)(div2)();
41718
40552
  return attrs(a$p$1)(fromFoldable7([$Tuple("id", childId)]))();
41719
40553
  }
41720
40554
  return maybeRootElement;
@@ -42767,7 +41601,7 @@ function setSelection_({
42767
41601
  return () => {
42768
41602
  var listener = eventListener2(withElement(select2))();
42769
41603
  rootElement.selectAll(".matrix-cell").each(function(cellRect) {
42770
- const sel = selState2(matrix.cells[cellRect.i - 1][cellRect.j - 1]);
41604
+ const sel = selState2(matrix.cells[cellRect.i][cellRect.j]);
42771
41605
  select_default2(this).classed(selClasses2, false).classed(selClassesFor2(sel), true).on("mousedown", (e) => {
42772
41606
  listener(e);
42773
41607
  }).on("mouseenter", (e) => {
@@ -42777,7 +41611,7 @@ function setSelection_({
42777
41611
  });
42778
41612
  });
42779
41613
  rootElement.selectAll(".matrix-cell-text").each(function(cellText) {
42780
- const sel = selState2(matrix.cells[cellText.i - 1][cellText.j - 1]);
41614
+ const sel = selState2(matrix.cells[cellText.i][cellText.j]);
42781
41615
  select_default2(this).classed(selClasses2, false).classed(selClassesFor2(sel), true);
42782
41616
  });
42783
41617
  rootElement.selectAll(".matrix-cell-hBorder").each(function(hBorder) {
@@ -42788,7 +41622,7 @@ function setSelection_({
42788
41622
  });
42789
41623
  };
42790
41624
  }
42791
- function createElement_({ val }, { title: title2, matrix }, parent) {
41625
+ function createElement_({ val: val2 }, { title: title2, matrix }, parent) {
42792
41626
  return () => {
42793
41627
  const strokeWidth = 0.5;
42794
41628
  const highlightStrokeWidth = 0.5;
@@ -42802,13 +41636,13 @@ function createElement_({ val }, { title: title2, matrix }, parent) {
42802
41636
  rootElement.append("text").text(title2 === "intermediate" ? " " : title2).attr("x", hMargin / 2).attr("y", vMargin / 2).attr("class", "title-text").attr("dominant-baseline", "middle").attr("text-anchor", "left");
42803
41637
  const matrixGrp = rootElement.append("g").attr("transform", `translate(${highlightStrokeWidth / 2 + hMargin / 2}, ${highlightStrokeWidth / 2 + vMargin})`).attr("fill", "currentColor").attr("stroke", "currentColor").attr("stroke-width", ".25");
42804
41638
  const rowGrp = matrixGrp.selectAll("g").data([...matrix.cells.entries()].map(([i, ns]) => {
42805
- return { i: i + 1, ns };
41639
+ return { i, ns };
42806
41640
  })).enter().append("g");
42807
41641
  const cells = rowGrp.selectAll("g").data(({ i, ns }) => [...ns.entries()].map(([j, n]) => {
42808
- return { i, j: j + 1, n };
41642
+ return { i, j, n };
42809
41643
  })).enter();
42810
- cells.append("rect").attr("x", ({ j }) => (j - 1) * w).attr("y", ({ i }) => (i - 1) * h).attr("width", w).attr("height", h).attr("class", "matrix-cell").attr("stroke-width", strokeWidth);
42811
- cells.append("text").text(({ n }) => val(n)).attr("x", ({ j }) => (j - 0.5) * w).attr("y", ({ i }) => (i - 0.5) * h).attr("class", "matrix-cell-text").attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("pointer-events", "none");
41644
+ cells.append("rect").attr("x", ({ j }) => j * w).attr("y", ({ i }) => i * h).attr("width", w).attr("height", h).attr("class", "matrix-cell").attr("stroke-width", strokeWidth);
41645
+ cells.append("text").text(({ n }) => val2(n)).attr("x", ({ j }) => (j + 0.5) * w).attr("y", ({ i }) => (i + 0.5) * h).attr("class", "matrix-cell-text").attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("pointer-events", "none");
42812
41646
  const bordersGrp = rootElement.append("g").attr("transform", `translate(${highlightStrokeWidth / 2 + hMargin / 2}, ${highlightStrokeWidth / 2 + vMargin})`).attr("fill", "currentColor").attr("stroke", highlightStrokeColor).attr("stroke-width", highlightStrokeWidth);
42813
41647
  const hBordersGrp = bordersGrp.append("g");
42814
41648
  const hBordersRowGrps = hBordersGrp.selectAll("g").data(range(matrix.i + 1)).enter().append("g");
@@ -43188,14 +42022,14 @@ function setSelection_2({ point_attrs, eventListener: eventListener2, withScatte
43188
42022
  });
43189
42023
  };
43190
42024
  }
43191
- function createElement_2({ val }, { caption, points, labels }, parent) {
42025
+ function createElement_2({ val: val2 }, { caption, points, labels }, parent) {
43192
42026
  return () => {
43193
42027
  var max_width = 280;
43194
42028
  var max_height = 200;
43195
- const x_max = Math.ceil(Math.max(...points.map((point2) => val(point2.x))));
43196
- const x_min = Math.ceil(Math.min(...points.map((point2) => val(point2.x))));
43197
- const y_max = Math.ceil(Math.max(...points.map((point2) => val(point2.y))));
43198
- const y_min = Math.ceil(Math.min(...points.map((point2) => val(point2.y))));
42029
+ const x_max = Math.ceil(Math.max(...points.map((point2) => val2(point2.x))));
42030
+ const x_min = Math.ceil(Math.min(...points.map((point2) => val2(point2.x))));
42031
+ const y_max = Math.ceil(Math.max(...points.map((point2) => val2(point2.y))));
42032
+ const y_min = Math.ceil(Math.min(...points.map((point2) => val2(point2.y))));
43199
42033
  const margin = { top: 20, right: 20, bottom: 40, left: 50 };
43200
42034
  const width2 = max_width - margin.left - margin.right, height = max_height - margin.top - margin.bottom;
43201
42035
  const rootElement = parent.append("svg").classed("center", true).attr("width", max_width + margin.left + margin.right).attr("height", max_height + margin.top).append("g").attr("transform", `translate(${margin.left}, ${margin.top})`);
@@ -43203,12 +42037,12 @@ function createElement_2({ val }, { caption, points, labels }, parent) {
43203
42037
  rootElement.append("g").attr("transform", "translate(0," + height + ")").call(axisBottom(x2).tickSizeOuter(0)).selectAll("text").style("text-anchor", "middle");
43204
42038
  const y2 = linear2().domain([Math.min(0, y_min), y_max]).range([height, 0]);
43205
42039
  rootElement.append("g").call(axisLeft(y2).tickSizeOuter(0));
43206
- rootElement.append("text").attr("x", width2).attr("y", height + 25).style("text-anchor", "end").style("font-size", "10px").text(val(labels.x));
43207
- rootElement.append("text").attr("transform", "rotate(-90)").attr("x", -margin.top).attr("y", -margin.left + 20).style("text-anchor", "end").style("font-size", "10px").text(val(labels.y));
42040
+ rootElement.append("text").attr("x", width2).attr("y", height + 25).style("text-anchor", "end").style("font-size", "10px").text(val2(labels.x));
42041
+ rootElement.append("text").attr("transform", "rotate(-90)").attr("x", -margin.top).attr("y", -margin.left + 20).style("text-anchor", "end").style("font-size", "10px").text(val2(labels.y));
43208
42042
  rootElement.append("g").selectAll("circle").data([...points.entries()].map(([i, point2]) => {
43209
42043
  return { i, point: point2 };
43210
- })).enter().append("circle").classed("scatterplot-point", true).attr("cx", ({ point: point2 }) => x2(val(point2.x))).attr("cy", ({ point: point2 }) => y2(val(point2.y))).attr("stroke-width", 0.5);
43211
- rootElement.append("text").text(val(caption)).attr("x", width2 / 2).attr("y", height + 40).attr("class", "title-text").attr("dominant-baseline", "bottom").attr("text-anchor", "middle");
42044
+ })).enter().append("circle").classed("scatterplot-point", true).attr("cx", ({ point: point2 }) => x2(val2(point2.x))).attr("cy", ({ point: point2 }) => y2(val2(point2.y))).attr("stroke-width", 0.5);
42045
+ rootElement.append("text").text(val2(caption)).attr("x", width2 / 2).attr("y", height + 40).attr("class", "title-text").attr("dominant-baseline", "bottom").attr("text-anchor", "middle");
43212
42046
  return rootElement;
43213
42047
  };
43214
42048
  }
@@ -44326,22 +43160,35 @@ var reflectDictSelStates\u{1D54A}$x215Val9 = {
44326
43160
  };
44327
43161
  var view = () => (options) => (title2) => (v) => {
44328
43162
  const $0 = (c) => {
44329
- const records = arrayMap(dict(identity27))(reflectValArrayVal.from()(v));
44330
- const colNames = headers(records);
44331
- return pack7({
44332
- title: title2,
44333
- rowFilter: (() => {
44334
- if (options.rowFilter.tag === "Nothing") {
44335
- return Interactive;
44336
- }
44337
- if (options.rowFilter.tag === "Just") {
44338
- return options.rowFilter._1;
44339
- }
44340
- fail();
44341
- })(),
44342
- colNames,
44343
- rows: arrayMap(arrayMap(snd))(arrayDictToArray2(colNames)(records))
44344
- });
43163
+ const vs = reflectValArrayVal.from()(v);
43164
+ if ((() => {
43165
+ const v2 = unconsImpl((v$1) => Nothing, (x2) => (xs) => $Maybe("Just", { head: x2, tail: xs }), vs);
43166
+ if (v2.tag === "Just") {
43167
+ return v2._1.head._3.tag === "Dictionary";
43168
+ }
43169
+ if (v2.tag === "Nothing") {
43170
+ return true;
43171
+ }
43172
+ fail();
43173
+ })()) {
43174
+ const records = arrayMap(dict(identity27))(vs);
43175
+ const colNames = headers(records);
43176
+ return pack7({
43177
+ title: title2,
43178
+ rowFilter: (() => {
43179
+ if (options.rowFilter.tag === "Nothing") {
43180
+ return Interactive;
43181
+ }
43182
+ if (options.rowFilter.tag === "Just") {
43183
+ return options.rowFilter._1;
43184
+ }
43185
+ fail();
43186
+ })(),
43187
+ colNames,
43188
+ rows: arrayMap(arrayMap(snd))(arrayDictToArray2(colNames)(records))
43189
+ });
43190
+ }
43191
+ return pack4($MultiView(arrayMap(view()(options)(""))(vs)));
44345
43192
  };
44346
43193
  if (v._3.tag === "Int") {
44347
43194
  return pack3($Tuple(showIntImpl(v._3._1), v._1));
@@ -45450,7 +44297,7 @@ var fromFoldable16 = /* @__PURE__ */ (() => {
45450
44297
  return go$1(x2, Nil);
45451
44298
  })());
45452
44299
  })();
45453
- var show22 = /* @__PURE__ */ (() => showSet(showString).show)();
44300
+ var show2 = /* @__PURE__ */ (() => showSet(showString).show)();
45454
44301
  var toUnfoldable8 = (x2) => {
45455
44302
  const go = (m$p, z$p) => {
45456
44303
  if (m$p.tag === "Leaf") {
@@ -45641,12 +44488,12 @@ var match = (dictMonadWithGraphAlloc) => {
45641
44488
  const $2 = v._3._1;
45642
44489
  const $3 = v._1;
45643
44490
  const $4 = v1._2;
45644
- return Bind1.bind(check(MonadThrow0)(unsafeDifference(ordString.compare, $1, fromFoldable16(mapObjectString.keys($2))).tag === "Leaf")("Pattern mismatch: found " + show22(mapObjectString.keys($2)) + ", expected " + show22($1)))(() => Bind1.bind(matchMany(dictMonadWithGraphAlloc)(listMap((k) => $$get(showString)(mapObjectString)(k)($2)._2)(toUnfoldable8($1)))($4))((v2) => $0.pure($Tuple(
44491
+ return Bind1.bind(check(MonadThrow0)(unsafeDifference(ordString.compare, $1, fromFoldable16(mapObjectString.keys($2))).tag === "Leaf")("Pattern mismatch: found " + show2(mapObjectString.keys($2)) + ", expected " + show2($1)))(() => Bind1.bind(matchMany(dictMonadWithGraphAlloc)(listMap((k) => $$get(showString)(mapObjectString)(k)($2)._2)(toUnfoldable8($1)))($4))((v2) => $0.pure($Tuple(
45645
44492
  v2._1,
45646
44493
  $Tuple(v2._2._1, insert3(ordVertex)($3)()(v2._2._2))
45647
44494
  ))));
45648
44495
  }
45649
- return MonadThrow0.throwError(error("Pattern mismatch: found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v))._1 + ", expected " + show22(v1._1)));
44496
+ return MonadThrow0.throwError(error("Pattern mismatch: found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v))._1 + ", expected " + show2(v1._1)));
45650
44497
  }
45651
44498
  fail();
45652
44499
  };
@@ -45684,10 +44531,10 @@ var graphGC = (dictGraph) => {
45684
44531
  var closeDefs = (dictMonadWithGraphAlloc) => {
45685
44532
  const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
45686
44533
  const traverse2$1 = traversableDict.traverse(Monad0.Applicative0());
45687
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
44534
+ const val2 = val(dictMonadWithGraphAlloc);
45688
44535
  return (\u03B3) => (\u03C1) => (\u03B1s) => Monad0.Bind1().Apply0().Functor0().map(Env)(traverse2$1((\u03C3) => {
45689
44536
  const \u03C1$p = forDefs(\u03C1)(\u03C3);
45690
- return val(\u03B1s)($BaseVal(
44537
+ return val2(Nothing)(\u03B1s)($BaseVal(
45691
44538
  "Fun",
45692
44539
  $Fun(
45693
44540
  "Closure",
@@ -45729,7 +44576,7 @@ var evalVal = (dictMonadWithGraphAlloc) => {
45729
44576
  if (v1.tag === "Dictionary") {
45730
44577
  const $1 = v1._1;
45731
44578
  return Bind1.bind($0.map(unzip3)(traverse3(traverse4((() => {
45732
- const $2 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
44579
+ const $2 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(v);
45733
44580
  return (a) => $2(a)(v2);
45734
44581
  })()))(v1._2)))((v3) => {
45735
44582
  const v4 = unzip2(listMap((v$1) => $Tuple(v$1._3.tag === "Str" ? v$1._3._1 : typeError(v$1._3)("Str"), v$1._1))(v3._1));
@@ -45856,7 +44703,7 @@ var evalVal = (dictMonadWithGraphAlloc) => {
45856
44703
  };
45857
44704
  return go(0)($2);
45858
44705
  })()))(() => Bind1.bind(traverse3((() => {
45859
- const $4 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
44706
+ const $4 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(v);
45860
44707
  return (a) => $4(a)(v2);
45861
44708
  })())($2))((vs) => Applicative0.pure($Maybe("Just", $Tuple($3, $BaseVal("Constr", $1, vs))))));
45862
44709
  }
@@ -45865,7 +44712,7 @@ var evalVal = (dictMonadWithGraphAlloc) => {
45865
44712
  const $2 = v1._3._1;
45866
44713
  const $3 = v1._3._2;
45867
44714
  const $4 = v1._1;
45868
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._4)(v2))((v3) => {
44715
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(v)(v1._4)(v2))((v3) => {
45869
44716
  const v5 = intPair.unpack(v3._3);
45870
44717
  const $5 = v5._1._1;
45871
44718
  const $6 = v5._2._1;
@@ -45874,9 +44721,9 @@ var evalVal = (dictMonadWithGraphAlloc) => {
45874
44721
  return Bind1.bind(check2(greaterThanOrEq($Tuple($5, $6))($Tuple(1, 1)))("array must be at least (" + show3($Tuple(1, 1)) + "); got (" + show3($Tuple(
45875
44722
  $5,
45876
44723
  $6
45877
- )) + ")"))(() => Bind1.bind(sequence1(arrayBind(rangeImpl(1, $5))((i) => [
45878
- sequence1(arrayBind(rangeImpl(1, $6))((j) => [
45879
- $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity16)(v)(disjointUnion2((() => {
44724
+ )) + ")"))(() => Bind1.bind(sequence1(arrayBind(rangeImpl(0, $5 - 1 | 0))((i) => [
44725
+ sequence1(arrayBind(rangeImpl(0, $6 - 1 | 0))((j) => [
44726
+ $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(unionWith((v$1) => identity16)(v)(disjointUnion2((() => {
45880
44727
  const $9 = {};
45881
44728
  $9[$2] = $Val($7, Nothing, $BaseVal("Int", i));
45882
44729
  return $9;
@@ -45920,17 +44767,17 @@ var evalVal = (dictMonadWithGraphAlloc) => {
45920
44767
  };
45921
44768
  };
45922
44769
  var $$eval = (dictMonadWithGraphAlloc) => {
45923
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
44770
+ const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
45924
44771
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
45925
44772
  const withMsg2 = withMsg(MonadError1);
45926
44773
  const MonadThrow0 = MonadError1.MonadThrow0();
45927
44774
  const match1 = match(dictMonadWithGraphAlloc);
45928
44775
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
45929
- const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
45930
44776
  return (dictMonadReader) => (dictMonadAff) => {
45931
44777
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
45932
- const $0 = Monad0.Bind1();
45933
- return (dictLoadFile) => (\u03B3) => (e0) => (\u03B1s) => {
44778
+ const Bind1 = Monad0.Bind1();
44779
+ const traceWhen2 = traceWhen(Monad0.Applicative0());
44780
+ return (dictLoadFile) => (doc_opt) => (\u03B3) => (e0) => (\u03B1s) => {
45934
44781
  const funName = (funName$a0$copy) => {
45935
44782
  let funName$a0 = funName$a0$copy, funName$c = true, funName$r;
45936
44783
  while (funName$c) {
@@ -45954,35 +44801,47 @@ var $$eval = (dictMonadWithGraphAlloc) => {
45954
44801
  }
45955
44802
  return funName$r;
45956
44803
  };
45957
- return $0.bind(evalVal(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)(e0)(\u03B1s))((\u03B1u_opt) => {
44804
+ return Bind1.bind(evalVal(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)(e0)(\u03B1s))((\u03B1u_opt) => {
45958
44805
  if (\u03B1u_opt.tag === "Just") {
45959
- return val(insert3(ordVertex)(\u03B1u_opt._1._1)()(\u03B1s))(\u03B1u_opt._1._2);
44806
+ return $$new((a) => Val(a)(doc_opt))(insert3(ordVertex)(\u03B1u_opt._1._1)()(\u03B1s))(\u03B1u_opt._1._2);
45960
44807
  }
45961
44808
  if (\u03B1u_opt.tag === "Nothing") {
45962
44809
  if (e0.tag === "Var") {
45963
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(e0._1)(\u03B3));
44810
+ const $0 = e0._1;
44811
+ return Bind1.bind(traceWhen2((() => {
44812
+ if (doc_opt.tag === "Nothing") {
44813
+ return false;
44814
+ }
44815
+ if (doc_opt.tag === "Just") {
44816
+ return true;
44817
+ }
44818
+ fail();
44819
+ })())("Discarding doc (variable " + $0 + ")"))(() => withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)($0)(\u03B3)));
45964
44820
  }
45965
44821
  if (e0.tag === "Op") {
45966
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(e0._1)(\u03B3));
45967
- }
45968
- if (e0.tag === "Project") {
45969
- const $1 = e0._2;
45970
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)(e0._1)(\u03B1s))((v) => {
45971
- if (v._3.tag === "Dictionary") {
45972
- return withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $1 + '" not found')((() => {
45973
- const $2 = _lookup(Nothing, Just, $1, v._3._1);
45974
- if ($2.tag === "Just") {
45975
- return $Maybe("Just", $2._1._2);
45976
- }
45977
- return Nothing;
45978
- })()));
44822
+ const $0 = e0._1;
44823
+ return Bind1.bind(traceWhen2((() => {
44824
+ if (doc_opt.tag === "Nothing") {
44825
+ return false;
45979
44826
  }
45980
- return MonadThrow0.throwError(error("Found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v))._1 + ", expected dictionary"));
45981
- });
44827
+ if (doc_opt.tag === "Just") {
44828
+ return true;
44829
+ }
44830
+ fail();
44831
+ })())("Discarding doc (operator " + $0 + ")"))(() => withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)($0)(\u03B3)));
45982
44832
  }
45983
44833
  if (e0.tag === "DProject") {
44834
+ const $0 = e0._1;
45984
44835
  const $1 = e0._2;
45985
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)(e0._1)(\u03B1s))((v) => $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($1)(\u03B1s))((v$p) => {
44836
+ return Bind1.bind(traceWhen2((() => {
44837
+ if (doc_opt.tag === "Nothing") {
44838
+ return false;
44839
+ }
44840
+ if (doc_opt.tag === "Just") {
44841
+ return true;
44842
+ }
44843
+ fail();
44844
+ })())("Discarding doc (projection)"))(() => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)($0)(\u03B1s))((v) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)($1)(\u03B1s))((v$p) => {
45986
44845
  if (v._3.tag === "Dictionary") {
45987
44846
  if (v$p._3.tag === "Str") {
45988
44847
  return withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
@@ -45996,45 +44855,45 @@ var $$eval = (dictMonadWithGraphAlloc) => {
45996
44855
  return MonadThrow0.throwError(error("Found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v$p))._1 + ", expected string"));
45997
44856
  }
45998
44857
  return MonadThrow0.throwError(error("Found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v))._1 + ", expected dict"));
45999
- }));
44858
+ })));
46000
44859
  }
46001
44860
  if (e0.tag === "App") {
46002
- const $1 = e0._1;
46003
- const $2 = e0._2;
46004
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($1)(\u03B1s))((v) => $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($2)(\u03B1s))((v$p) => withMsg2("In " + funName($1))(apply2(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p))));
44861
+ const $0 = e0._1;
44862
+ const $1 = e0._2;
44863
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)($0)(\u03B1s))((v) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)($1)(\u03B1s))((v$p) => withMsg2("In " + funName($0))(apply2(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(doc_opt)(v)(v$p))));
46005
44864
  }
46006
44865
  if (e0.tag === "Let") {
46007
- const $1 = e0._2;
46008
- const $2 = e0._1._1;
46009
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)(e0._1._2)(\u03B1s))((v) => $0.bind(withMsg2("In variable def")(match1(v)($2)))((v1) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity16)(\u03B3)(v1._1))($1)(v1._2._2)));
44866
+ const $0 = e0._2;
44867
+ const $1 = e0._1._1;
44868
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)(e0._1._2)(\u03B1s))((v) => Bind1.bind(withMsg2("In variable def")(match1(v)($1)))((v1) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(doc_opt)(unionWith((v$1) => identity16)(\u03B3)(v1._1))($0)(v1._2._2)));
46010
44869
  }
46011
44870
  if (e0.tag === "LetRec") {
46012
- const $1 = e0._2;
46013
- const $2 = e0._1._1;
46014
- return $0.bind(closeDefs1(\u03B3)(e0._1._2)(insert3(ordVertex)($2)()(\u03B1s)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v) => identity16)(\u03B3)(\u03B3$p))($1)(insert3(ordVertex)($2)()(\u03B1s)));
44871
+ const $0 = e0._2;
44872
+ const $1 = e0._1._1;
44873
+ return Bind1.bind(closeDefs1(\u03B3)(e0._1._2)(insert3(ordVertex)($1)()(\u03B1s)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(doc_opt)(unionWith((v) => identity16)(\u03B3)(\u03B3$p))($0)(insert3(ordVertex)($1)()(\u03B1s)));
46015
44874
  }
46016
44875
  if (e0.tag === "DocExpr") {
46017
- const $1 = e0._1;
46018
- const $2 = e0._2;
46019
- return $0.bind(evalVal(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($2)(\u03B1s))((\u03B1u_opt$p) => {
46020
- if (\u03B1u_opt$p.tag === "Just") {
46021
- const $3 = \u03B1u_opt$p._1._2;
46022
- const $4 = \u03B1u_opt$p._1._1;
46023
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($1)(\u03B1s))((v) => $$new((a) => Val(a)($Maybe("Just", v)))(insert3(ordVertex)($4)()(\u03B1s))($3));
44876
+ const $0 = e0._2;
44877
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(Nothing)(\u03B3)(e0._1)(\u03B1s))((v) => Bind1.bind(traceWhen2((() => {
44878
+ if (doc_opt.tag === "Nothing") {
44879
+ return false;
46024
44880
  }
46025
- if (\u03B1u_opt$p.tag === "Nothing") {
46026
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($2)(\u03B1s))((v) => {
46027
- const $3 = v._3;
46028
- const $4 = v._1;
46029
- return $0.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(\u03B3)($1)(\u03B1s))((v1) => Monad0.Applicative0().pure($Val(
46030
- $4,
46031
- $Maybe("Just", v1),
46032
- $3
46033
- )));
46034
- });
44881
+ if (doc_opt.tag === "Just") {
44882
+ return true;
46035
44883
  }
46036
44884
  fail();
46037
- });
44885
+ })())("Outer doc trumps inner doc"))(() => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)($Maybe(
44886
+ "Just",
44887
+ (() => {
44888
+ if (doc_opt.tag === "Nothing") {
44889
+ return v;
44890
+ }
44891
+ if (doc_opt.tag === "Just") {
44892
+ return doc_opt._1;
44893
+ }
44894
+ fail();
44895
+ })()
44896
+ ))(\u03B3)($0)(\u03B1s)));
46038
44897
  }
46039
44898
  return throwException(error("absurd"))();
46040
44899
  }
@@ -46046,23 +44905,23 @@ var $$eval = (dictMonadWithGraphAlloc) => {
46046
44905
  var apply2 = (dictMonadWithGraphAlloc) => {
46047
44906
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
46048
44907
  const match1 = match(dictMonadWithGraphAlloc);
46049
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
44908
+ const val2 = val(dictMonadWithGraphAlloc);
46050
44909
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
46051
44910
  const MonadThrow0 = MonadError1.MonadThrow0();
46052
44911
  return (dictMonadReader) => (dictMonadAff) => {
46053
44912
  const Bind1 = dictMonadAff.MonadEffect0().Monad0().Bind1();
46054
- return (dictLoadFile) => (v) => (v1) => {
46055
- const $0 = (v2) => MonadThrow0.throwError(error("Found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v2))._1 + ", expected function"));
46056
- if (v._3.tag === "Fun") {
46057
- if (v._3._1.tag === "Closure") {
46058
- const $1 = v._1;
46059
- const $2 = v._3._1._1;
46060
- const $3 = v._3._1._3;
46061
- return Bind1.bind(closeDefs1($2)(v._3._1._2)($$$Map("Node", 1, 1, $1, void 0, Leaf, Leaf)))((\u03B32) => Bind1.bind(match1(v1)($3))((v3) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity16)(unionWith((v$1) => identity16)($2)(\u03B32))(v3._1))(v3._2._1.tag === "ContExpr" ? v3._2._1._1 : throwException(error("Expression expected"))())(insert3(ordVertex)($1)()(v3._2._2))));
46062
- }
46063
- if (v._3._1.tag === "Foreign") {
46064
- const $1 = v._3._1._1._2;
46065
- const vs$p = foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2);
44913
+ return (dictLoadFile) => (v) => (v1) => (v2) => {
44914
+ const $0 = (v3) => MonadThrow0.throwError(error("Found " + renderWithIndent(Stmt)(0)(0)(prettyVal(highlightableVertex).pretty(v3))._1 + ", expected function"));
44915
+ if (v1._3.tag === "Fun") {
44916
+ if (v1._3._1.tag === "Closure") {
44917
+ const $1 = v1._1;
44918
+ const $2 = v1._3._1._1;
44919
+ const $3 = v1._3._1._3;
44920
+ return Bind1.bind(closeDefs1($2)(v1._3._1._2)($$$Map("Node", 1, 1, $1, void 0, Leaf, Leaf)))((\u03B32) => Bind1.bind(match1(v2)($3))((v4) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(unionWith((v$1) => identity16)(unionWith((v$1) => identity16)($2)(\u03B32))(v4._1))(v4._2._1.tag === "ContExpr" ? v4._2._1._1 : throwException(error("Expression expected"))())(insert3(ordVertex)($1)()(v4._2._2))));
44921
+ }
44922
+ if (v1._3._1.tag === "Foreign") {
44923
+ const $1 = v1._3._1._1._2;
44924
+ const vs$p = foldableList.foldr(Cons)($List("Cons", v2, Nil))(v1._3._1._2);
46066
44925
  if ((() => {
46067
44926
  const go = (go$a0$copy) => (go$a1$copy) => {
46068
44927
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
@@ -46084,16 +44943,16 @@ var apply2 = (dictMonadWithGraphAlloc) => {
46084
44943
  };
46085
44944
  return $1._1.arity > go(0)(vs$p);
46086
44945
  })()) {
46087
- return val($$$Map("Node", 1, 1, v._1, void 0, Leaf, Leaf))($BaseVal(
44946
+ return val2(v)($$$Map("Node", 1, 1, v1._1, void 0, Leaf, Leaf))($BaseVal(
46088
44947
  "Fun",
46089
- $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
44948
+ $Fun("Foreign", $Tuple(v1._3._1._1._1, $1), vs$p)
46090
44949
  ));
46091
44950
  }
46092
- return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadAff)(dictMonadReader)(dictLoadFile)(vs$p);
44951
+ return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadAff)(dictMonadReader)(dictLoadFile)(v)(vs$p);
46093
44952
  }
46094
- if (v._3._1.tag === "PartialConstr") {
46095
- const $1 = v._1;
46096
- const n = defined(arity(monadThrowExceptT(monadIdentity))(v._3._1._1));
44953
+ if (v1._3._1.tag === "PartialConstr") {
44954
+ const $1 = v1._1;
44955
+ const n = defined(arity(monadThrowExceptT(monadIdentity))(v1._3._1._1));
46097
44956
  const v$p = (() => {
46098
44957
  const go = (go$a0$copy) => (go$a1$copy) => {
46099
44958
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
@@ -46113,18 +44972,18 @@ var apply2 = (dictMonadWithGraphAlloc) => {
46113
44972
  }
46114
44973
  return go$r;
46115
44974
  };
46116
- return go(0)(v._3._1._2) < (n - 1 | 0);
44975
+ return go(0)(v1._3._1._2) < (n - 1 | 0);
46117
44976
  })() ? $BaseVal(
46118
44977
  "Fun",
46119
44978
  $Fun(
46120
44979
  "PartialConstr",
46121
- v._3._1._1,
46122
- foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
44980
+ v1._3._1._1,
44981
+ foldableList.foldr(Cons)($List("Cons", v2, Nil))(v1._3._1._2)
46123
44982
  )
46124
44983
  ) : $BaseVal(
46125
44984
  "Constr",
46126
- v._3._1._1,
46127
- foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
44985
+ v1._3._1._1,
44986
+ foldableList.foldr(Cons)($List("Cons", v2, Nil))(v1._3._1._2)
46128
44987
  );
46129
44988
  return Bind1.bind(check(MonadThrow0)((() => {
46130
44989
  const go = (go$a0$copy) => (go$a1$copy) => {
@@ -46145,8 +45004,8 @@ var apply2 = (dictMonadWithGraphAlloc) => {
46145
45004
  }
46146
45005
  return go$r;
46147
45006
  };
46148
- return go(0)(v._3._1._2) < n;
46149
- })())("Too many arguments to " + showCtr(v._3._1._1)))(() => val($$$Map(
45007
+ return go(0)(v1._3._1._2) < n;
45008
+ })())("Too many arguments to " + showCtr(v1._3._1._1)))(() => val2(v)($$$Map(
46150
45009
  "Node",
46151
45010
  1,
46152
45011
  1,
@@ -46157,7 +45016,7 @@ var apply2 = (dictMonadWithGraphAlloc) => {
46157
45016
  ))(v$p));
46158
45017
  }
46159
45018
  }
46160
- return $0(v1);
45019
+ return $0(v2);
46161
45020
  };
46162
45021
  };
46163
45022
  };
@@ -46182,7 +45041,7 @@ var eval_module = (dictMonadWithGraphAlloc) => {
46182
45041
  if (v1._1.tag === "Left") {
46183
45042
  const $1 = v1._2;
46184
45043
  const $2 = v1._1._1._1;
46185
- return $0.bind(eval4(unionWith((v$1) => identity16)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith((v$1) => identity16)(v)(v4._1))($1)(v4._2._2)));
45044
+ return $0.bind(eval4(Nothing)(unionWith((v$1) => identity16)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith((v$1) => identity16)(v)(v4._1))($1)(v4._2._2)));
46186
45045
  }
46187
45046
  if (v1._1.tag === "Right") {
46188
45047
  const $1 = v1._2;
@@ -46318,7 +45177,7 @@ var graphEval = (dictMonadAff) => {
46318
45177
  const $3 = v["\u03B3"];
46319
45178
  const $4 = spyFunWhen(false)("fwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(fwdSlice2);
46320
45179
  const $5 = spyFunWhen(false)("bwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(bwdSlice2);
46321
- return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1($3)(e\u03B1)(mempty4))(verticesEnvExprVertex.vertices($EnvExpr(
45180
+ return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1(Nothing)($3)(e\u03B1)(mempty4))(verticesEnvExprVertex.vertices($EnvExpr(
46322
45181
  $3,
46323
45182
  e\u03B1
46324
45183
  ))))((v1) => {
@@ -46403,7 +45262,6 @@ var encode = /* @__PURE__ */ (() => {
46403
45262
  // output-es/Data.HTTP.Method/index.js
46404
45263
  var $Method = (tag) => tag;
46405
45264
  var GET = /* @__PURE__ */ $Method("GET");
46406
- var HEAD = /* @__PURE__ */ $Method("HEAD");
46407
45265
  var print = (v2) => {
46408
45266
  if (v2.tag === "Left") {
46409
45267
  if (v2._1 === "OPTIONS") {
@@ -46871,7 +45729,7 @@ var Folder = (x2) => x2;
46871
45729
  var show4 = /* @__PURE__ */ showArrayImpl(showStringImpl);
46872
45730
  var loadFileAff = {
46873
45731
  loadFileFromPath: (dictMonadError) => (dictMonadAff) => (v) => _bind(bindExceptT2.bind(dictMonadAff.liftAff(_bind(request(driver)({
46874
- method: $Either("Left", HEAD),
45732
+ method: $Either("Left", GET),
46875
45733
  url: v,
46876
45734
  headers: [],
46877
45735
  content: Nothing,
@@ -46892,18 +45750,8 @@ var loadFileAff = {
46892
45750
  }
46893
45751
  fail();
46894
45752
  })()))))((v1) => {
46895
- const $0 = v1._2;
46896
- return bindExceptT2.bind(applicativeExceptT2.pure())(() => bindExceptT2.bind(dictMonadAff.liftAff(request(driver)({
46897
- method: $Either("Left", GET),
46898
- url: $0,
46899
- headers: [],
46900
- content: Nothing,
46901
- username: Nothing,
46902
- password: Nothing,
46903
- withCredentials: false,
46904
- responseFormat: $ResponseFormat("String", identity28),
46905
- timeout: Nothing
46906
- })))((contents) => applicativeExceptT2.pure(contents.body)));
45753
+ const $0 = v1._1;
45754
+ return bindExceptT2.bind(applicativeExceptT2.pure())(() => applicativeExceptT2.pure($0.body));
46907
45755
  }))((result) => _pure((() => {
46908
45756
  if (result.tag === "Left") {
46909
45757
  return Nothing;
@@ -47333,7 +46181,7 @@ var stringChar = /* @__PURE__ */ withErrorMessage((state1, more, lift12, $$throw
47333
46181
  $$throw2,
47334
46182
  (state2, a) => more((v2) => done(state2, $Maybe("Just", a)))
47335
46183
  )))("string character");
47336
- var opChars = [":", "!", "#", "$", "%", "&", "*", "+", ".", "/", "<", "=", ">", "?", "@", "\\", "^", "|", "-", "~"];
46184
+ var opChars = [":", "!", "#", "$", "%", "&", "*", "+", ".", "/", "<", "=", ">", "?", "\\", "^", "|", "-", "~"];
47337
46185
  var lexeme = (v) => (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => v(
47338
46186
  state1,
47339
46187
  more,
@@ -47448,7 +46296,7 @@ var reserved = (expected) => {
47448
46296
  ));
47449
46297
  };
47450
46298
  })())((() => {
47451
- const $02 = oneOf(["_", "'"]);
46299
+ const $02 = withErrorMessage(satisfy((v) => v === "_"))("'_'");
47452
46300
  return (v2, $1, $2, $3, $4) => {
47453
46301
  const $5 = v2._1;
47454
46302
  const $6 = v2._2;
@@ -47508,7 +46356,7 @@ var variable = /* @__PURE__ */ unreserved(/* @__PURE__ */ identifier(/* @__PURE_
47508
46356
  ));
47509
46357
  };
47510
46358
  })())(/* @__PURE__ */ (() => {
47511
- const $0 = oneOf(["_", "'"]);
46359
+ const $0 = withErrorMessage(satisfy((v) => v === "_"))("'_'");
47512
46360
  return (v2, $1, $2, $3, $4) => {
47513
46361
  const $5 = v2._1;
47514
46362
  const $6 = v2._2;
@@ -47535,7 +46383,7 @@ var delim = (dictParseable) => (a) => {
47535
46383
  };
47536
46384
  var parens = /* @__PURE__ */ between(/* @__PURE__ */ delim(parseableChar)("("))(/* @__PURE__ */ delim(parseableChar)(")"));
47537
46385
  var trailingCommas = (p) => sepEndBy(p)(delim(parseableChar)(","));
47538
- var fields = (key) => (val) => trailingCommas((state1, more, lift12, $$throw2, done) => more((v1) => key(
46386
+ var fields = (key) => (val2) => trailingCommas((state1, more, lift12, $$throw2, done) => more((v1) => key(
47539
46387
  state1,
47540
46388
  more,
47541
46389
  lift12,
@@ -47550,7 +46398,7 @@ var fields = (key) => (val) => trailingCommas((state1, more, lift12, $$throw2, d
47550
46398
  $$throw2,
47551
46399
  (state2$1, a$1) => more((v2$1) => {
47552
46400
  const $2 = $1._3 && !state2$1._3 ? $ParseState(state2$1._1, state2$1._2, true) : state2$1;
47553
- return more((v1$2) => val(
46401
+ return more((v1$2) => val2(
47554
46402
  $2,
47555
46403
  more,
47556
46404
  lift12,
@@ -47584,7 +46432,7 @@ var context = (s) => (p) => (state1, more, lift12, $$throw2, done) => more((v1)
47584
46432
  })
47585
46433
  ));
47586
46434
  var constructor = /* @__PURE__ */ unreserved(/* @__PURE__ */ identifier(upper2)(/* @__PURE__ */ (() => {
47587
- const $0 = oneOf(["_", "'"]);
46435
+ const $0 = withErrorMessage(satisfy((v) => v === "_"))("'_'");
47588
46436
  return (v2, $1, $2, $3, $4) => {
47589
46437
  const $5 = v2._1;
47590
46438
  const $6 = v2._2;
@@ -48334,7 +47182,24 @@ var pattern$lazy = /* @__PURE__ */ binding(() => lazyParserT.defer((v) => foldlA
48334
47182
  [$Operator("Infix", pConsOp, AssocRight)]
48335
47183
  ])));
48336
47184
  var pattern = /* @__PURE__ */ pattern$lazy();
48337
- var infixFn = /* @__PURE__ */ (() => {
47185
+ var infixSymbol = (op) => (state1, more, lift12, $$throw2, done) => more((v1) => reservedOperator(op)(
47186
+ state1,
47187
+ more,
47188
+ lift12,
47189
+ $$throw2,
47190
+ (state2, a) => more((v2) => done(state1._3 && !state2._3 ? $ParseState(state2._1, state2._2, true) : state2, (e) => (e$p) => $Expr2("BinaryApp", e, op, e$p)))
47191
+ ));
47192
+ var infixIdent = (op) => {
47193
+ const $0 = reserved(op);
47194
+ return (state1, more, lift12, $$throw2, done) => more((v1) => $0(
47195
+ state1,
47196
+ more,
47197
+ lift12,
47198
+ $$throw2,
47199
+ (state2, a) => more((v2) => done(state1._3 && !state2._3 ? $ParseState(state2._1, state2._2, true) : state2, (e) => (e$p) => $Expr2("BinaryApp", e, op, e$p)))
47200
+ ));
47201
+ };
47202
+ var infixCustom = /* @__PURE__ */ (() => {
48338
47203
  const $0 = delim(parseableChar)("|");
48339
47204
  return (state1, more, lift12, $$throw2, done) => more((v1) => {
48340
47205
  const $1 = state1._3;
@@ -48434,38 +47299,35 @@ var consOp = (state1, more, lift12, $$throw2, done) => more((v1) => reservedOper
48434
47299
  (e) => (e$p) => $Expr2("Constr", void 0, ":", $List("Cons", e, $List("Cons", e$p, Nil)))
48435
47300
  ))
48436
47301
  ));
48437
- var binaryOp = (op) => (state1, more, lift12, $$throw2, done) => more((v1) => reservedOperator(op)(
48438
- state1,
48439
- more,
48440
- lift12,
48441
- $$throw2,
48442
- (state2, a) => more((v2) => done(state1._3 && !state2._3 ? $ParseState(state2._1, state2._2, true) : state2, (e) => (e$p) => $Expr2("BinaryApp", e, op, e$p)))
48443
- ));
48444
- var binaryOps = [
48445
- [
48446
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("!"), AssocLeft),
48447
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("**"), AssocRight)
48448
- ],
48449
- [
48450
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("*"), AssocLeft),
48451
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("/"), AssocLeft)
48452
- ],
48453
- [
48454
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("+"), AssocLeft),
48455
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("-"), AssocLeft)
48456
- ],
48457
- [/* @__PURE__ */ $Operator("Infix", consOp, AssocRight)],
48458
- [/* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("++"), AssocRight)],
48459
- [
48460
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("=="), AssocNone),
48461
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("/="), AssocNone),
48462
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("<"), AssocLeft),
48463
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp(">"), AssocLeft),
48464
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp("<="), AssocLeft),
48465
- /* @__PURE__ */ $Operator("Infix", /* @__PURE__ */ binaryOp(">="), AssocLeft)
48466
- ],
48467
- [/* @__PURE__ */ $Operator("Infix", infixFn, AssocLeft)]
48468
- ];
47302
+ var opTable = /* @__PURE__ */ arrayMap(/* @__PURE__ */ arrayMap((v) => $Operator(
47303
+ "Infix",
47304
+ (() => {
47305
+ if (v._1 === "Symbol") {
47306
+ return infixSymbol(v._2);
47307
+ }
47308
+ if (v._1 === "Ident") {
47309
+ return infixIdent(v._2);
47310
+ }
47311
+ if (v._1 === "ConsOp") {
47312
+ return consOp;
47313
+ }
47314
+ if (v._1 === "Custom") {
47315
+ return infixCustom;
47316
+ }
47317
+ fail();
47318
+ })(),
47319
+ v._3
47320
+ )))(/* @__PURE__ */ sortBy((x2) => (y2) => ordInt.compare((() => {
47321
+ if (0 < x2.length) {
47322
+ return -x2[0]._4;
47323
+ }
47324
+ fail();
47325
+ })())((() => {
47326
+ if (0 < y2.length) {
47327
+ return -y2[0]._4;
47328
+ }
47329
+ fail();
47330
+ })()))(/* @__PURE__ */ groupBy((a) => (b) => a._4 === b._4)(opDefs)));
48469
47331
  var varDefs$lazy = /* @__PURE__ */ binding(() => many1((() => {
48470
47332
  const $0 = reserved("def");
48471
47333
  const $1 = delim(parseableChar)(":");
@@ -49168,7 +48030,48 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49168
48030
  })
49169
48031
  ));
49170
48032
  })()),
49171
- (() => {
48033
+ context("listCompDecl")((() => {
48034
+ const $43 = reserved("def");
48035
+ return (state1$2, more$2, lift1$2, throw$2, done$2) => more$2((v1$2) => $43(
48036
+ state1$2,
48037
+ more$2,
48038
+ lift1$2,
48039
+ throw$2,
48040
+ (state2$2, a$2) => more$2((v2$2) => {
48041
+ const $52 = state1$2._3 && !state2$2._3 ? $ParseState(state2$2._1, state2$2._2, true) : state2$2;
48042
+ return more$2((v1$3) => pattern(
48043
+ $52,
48044
+ more$2,
48045
+ lift1$2,
48046
+ throw$2,
48047
+ (state2$3, a$3) => more$2((v2$3) => {
48048
+ const $62 = delim(parseableChar)(":");
48049
+ const $72 = $52._3 && !state2$3._3 ? $ParseState(state2$3._1, state2$3._2, true) : state2$3;
48050
+ return more$2((v1$4) => $62(
48051
+ $72,
48052
+ more$2,
48053
+ lift1$2,
48054
+ throw$2,
48055
+ (state2$4, a$4) => more$2((v2$4) => {
48056
+ const $8 = $72._3 && !state2$4._3 ? $ParseState(state2$4._1, state2$4._2, true) : state2$4;
48057
+ return more$2((v1$5) => opTree$lazy()(
48058
+ $8,
48059
+ more$2,
48060
+ lift1$2,
48061
+ throw$2,
48062
+ (state2$5, a$5) => more$2((v2$5) => done$2(
48063
+ $8._3 && !state2$5._3 ? $ParseState(state2$5._1, state2$5._2, true) : state2$5,
48064
+ $Qualifier("ListCompDecl", $VarDef2(a$3, a$5))
48065
+ ))
48066
+ ));
48067
+ })
48068
+ ));
48069
+ })
48070
+ ));
48071
+ })
48072
+ ));
48073
+ })()),
48074
+ context("listCompGen")((() => {
49172
48075
  const $43 = reserved("for");
49173
48076
  return (state1$2, more$2, lift1$2, throw$2, done$2) => more$2((v1$2) => $43(
49174
48077
  state1$2,
@@ -49190,59 +48093,25 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49190
48093
  more$2,
49191
48094
  lift1$2,
49192
48095
  throw$2,
49193
- (state2$4, a$4) => more$2((v2$4) => choice3([
49194
- context("listCompDecl")((() => {
49195
- const $8 = delim(parseableChar)("[");
49196
- return (v1$5, $9, $10, $11, $12) => {
49197
- const $13 = v1$5._3;
49198
- return $9((v1$6) => $8(
49199
- v1$5,
49200
- $9,
49201
- $10,
49202
- (v2$5, $14) => $11($ParseState(v2$5._1, v2$5._2, $13), $14),
49203
- (state2$5, a$5) => $9((v2$5) => {
49204
- const $14 = v1$5._3 && !state2$5._3 ? $ParseState(state2$5._1, state2$5._2, true) : state2$5;
49205
- return $9((v1$7) => opTree$lazy()(
49206
- $14,
49207
- $9,
49208
- $10,
49209
- (v2$6, $15) => $11($ParseState(v2$6._1, v2$6._2, $13), $15),
49210
- (state2$6, a$6) => $9((v2$6) => {
49211
- const $15 = delim(parseableChar)("]");
49212
- const $16 = $14._3 && !state2$6._3 ? $ParseState(state2$6._1, state2$6._2, true) : state2$6;
49213
- return $9((v1$8) => $15(
49214
- $16,
49215
- $9,
49216
- $10,
49217
- (v2$7, $17) => $11($ParseState(v2$7._1, v2$7._2, $13), $17),
49218
- (state2$7, a$7) => $9((v2$7) => $12(
49219
- $16._3 && !state2$7._3 ? $ParseState(state2$7._1, state2$7._2, true) : state2$7,
49220
- $Qualifier("ListCompDecl", $VarDef2(a$3, a$6))
49221
- ))
49222
- ));
49223
- })
49224
- ));
49225
- })
49226
- ));
49227
- };
49228
- })()),
49229
- context("listCompGen")((state1$3, more$3, lift1$3, throw$3, done$3) => more$3((v1$5) => opTree$lazy()(
49230
- state1$3,
49231
- more$3,
49232
- lift1$3,
49233
- throw$3,
49234
- (state2$5, a$5) => more$3((v2$5) => done$3(
49235
- state1$3._3 && !state2$5._3 ? $ParseState(state2$5._1, state2$5._2, true) : state2$5,
48096
+ (state2$4, a$4) => more$2((v2$4) => {
48097
+ const $8 = $72._3 && !state2$4._3 ? $ParseState(state2$4._1, state2$4._2, true) : state2$4;
48098
+ return more$2((v1$5) => opTree$lazy()(
48099
+ $8,
48100
+ more$2,
48101
+ lift1$2,
48102
+ throw$2,
48103
+ (state2$5, a$5) => more$2((v2$5) => done$2(
48104
+ $8._3 && !state2$5._3 ? $ParseState(state2$5._1, state2$5._2, true) : state2$5,
49236
48105
  $Qualifier("ListCompGen", a$3, a$5)
49237
48106
  ))
49238
- )))
49239
- ])($72._3 && !state2$4._3 ? $ParseState(state2$4._1, state2$4._2, true) : state2$4, more$2, lift1$2, throw$2, done$2))
48107
+ ));
48108
+ })
49240
48109
  ));
49241
48110
  })
49242
48111
  ));
49243
48112
  })
49244
48113
  ));
49245
- })()
48114
+ })())
49246
48115
  ]));
49247
48116
  return (state1$2, more$2, lift1$2, throw$2, done$2) => more$2((v1$2) => $42(
49248
48117
  state1$2,
@@ -49396,26 +48265,31 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49396
48265
  lift12,
49397
48266
  $$throw2,
49398
48267
  (state2, a) => more((v2) => choice3([
49399
- (state1$1, more$1, lift1$1, throw$1, done$1) => more$1((v1$1) => operator2(
49400
- state1$1,
49401
- more$1,
49402
- lift1$1,
49403
- throw$1,
49404
- (state2$1, a$1) => more$1((v2$1) => {
49405
- const $132 = close(parseableChar)(")");
49406
- const $142 = state1$1._3 && !state2$1._3 ? $ParseState(state2$1._1, state2$1._2, true) : state2$1;
49407
- return more$1((v1$2) => $132(
49408
- $142,
48268
+ (() => {
48269
+ const $132 = close(parseableChar)(")");
48270
+ return (state1$1, more$1, lift1$1, throw$1, done$1) => more$1((v1$1) => {
48271
+ const $142 = state1$1._3;
48272
+ return more$1((v2$1) => more$1((v1$2) => operator2(
48273
+ state1$1,
49409
48274
  more$1,
49410
48275
  lift1$1,
49411
- throw$1,
49412
- (state2$2, a$2) => more$1((v2$2) => done$1(
49413
- $142._3 && !state2$2._3 ? $ParseState(state2$2._1, state2$2._2, true) : state2$2,
49414
- $Expr2("Op", a$1)
49415
- ))
49416
- ));
49417
- })
49418
- )),
48276
+ (v2$2, $15) => throw$1($ParseState(v2$2._1, v2$2._2, $142), $15),
48277
+ (state2$1, a$1) => more$1((v2$2) => more$1((v3) => {
48278
+ const state2$p = state1$1._3 && !state2$1._3 ? $ParseState(state2$1._1, state2$1._2, true) : state2$1;
48279
+ return $132(
48280
+ state2$p,
48281
+ more$1,
48282
+ lift1$1,
48283
+ (v2$3, $15) => throw$1($ParseState(v2$3._1, v2$3._2, $142), $15),
48284
+ (state3, a$2) => more$1((v4) => {
48285
+ const $15 = state2$p._3 && !state3._3 ? $ParseState(state3._1, state3._2, true) : state3;
48286
+ return more$1((v2$3) => done$1(state1$1._3 && !$15._3 ? $ParseState($15._1, $15._2, true) : $15, $Expr2("Op", a$1)));
48287
+ })
48288
+ );
48289
+ }))
48290
+ )));
48291
+ });
48292
+ })(),
49419
48293
  (state1$1, more$1, lift1$1, throw$1, done$1) => more$1((v1$1) => opTree$lazy()(
49420
48294
  state1$1,
49421
48295
  more$1,
@@ -49793,7 +48667,7 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49793
48667
  $$throw2,
49794
48668
  (state2, a) => more((v2) => chain(a)(state1._3 && !state2._3 ? $ParseState(state2._1, state2._2, true) : state2, more, lift12, $$throw2, done))
49795
48669
  ));
49796
- })()))(binaryOps);
48670
+ })()))(opTable);
49797
48671
  })());
49798
48672
  return (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => $0(
49799
48673
  state1,
@@ -49816,6 +48690,23 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49816
48690
  return context("expr")((() => {
49817
48691
  const $0 = reserved("case");
49818
48692
  const $1 = reserved("match");
48693
+ const clause = (state1, more, lift12, $$throw2, done) => more((v1) => opTree(
48694
+ state1,
48695
+ more,
48696
+ lift12,
48697
+ $$throw2,
48698
+ (state2, a) => more((v2) => {
48699
+ const $22 = block(expr$lazy());
48700
+ const $32 = state1._3 && !state2._3 ? $ParseState(state2._1, state2._2, true) : state2;
48701
+ return more((v1$1) => $22(
48702
+ $32,
48703
+ more,
48704
+ lift12,
48705
+ $$throw2,
48706
+ (state2$1, a$1) => more((v2$1) => done($32._3 && !state2$1._3 ? $ParseState(state2$1._1, state2$1._2, true) : state2$1, $Tuple(a, a$1)))
48707
+ ));
48708
+ })
48709
+ ));
49819
48710
  const $2 = reserved("if");
49820
48711
  const $3 = context("def")((() => {
49821
48712
  const $32 = context("funDef")(withPos((state1, more, lift12, $$throw2, done) => more((v1) => recDefs$lazy()(
@@ -49914,13 +48805,31 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49914
48805
  $5,
49915
48806
  $6,
49916
48807
  $15,
49917
- (state2, a) => $5((v2$1) => $5((v1$1) => opTree(
48808
+ (state2, a) => $5((v2$1) => $5((v1$1) => clause(
49918
48809
  state2,
49919
48810
  $5,
49920
48811
  $6,
49921
48812
  $15,
49922
48813
  (state2$1, a$1) => $5((v2$2) => {
49923
- const $16 = block(expr$lazy());
48814
+ const $16 = manyRec2(align((() => {
48815
+ const $162 = reserved("elif");
48816
+ return (state1, more, lift12, $$throw2, done) => more((v2$3) => more((v1$2) => $162(
48817
+ state1,
48818
+ more,
48819
+ lift12,
48820
+ $$throw2,
48821
+ (state2$2, a$2) => more((v2$4) => more((v3$2) => {
48822
+ const state2$p = state1._3 && !state2$2._3 ? $ParseState(state2$2._1, state2$2._2, true) : state2$2;
48823
+ return clause(
48824
+ state2$p,
48825
+ more,
48826
+ lift12,
48827
+ $$throw2,
48828
+ (state3, a$3) => more((v4$1) => done(state2$p._3 && !state3._3 ? $ParseState(state3._1, state3._2, true) : state3, a$3))
48829
+ );
48830
+ }))
48831
+ )));
48832
+ })()));
49924
48833
  const $17 = state2._3 && !state2$1._3 ? $ParseState(state2$1._1, state2$1._2, true) : state2$1;
49925
48834
  return $5((v1$2) => $16(
49926
48835
  $17,
@@ -49928,27 +48837,36 @@ var expr$lazy = /* @__PURE__ */ binding(() => {
49928
48837
  $6,
49929
48838
  $15,
49930
48839
  (state2$2, a$2) => $5((v2$3) => {
49931
- const $18 = align(reserved("else"));
48840
+ const $18 = align((() => {
48841
+ const $182 = reserved("else");
48842
+ const $192 = block(expr$lazy());
48843
+ return (state1, more, lift12, $$throw2, done) => more((v2$4) => more((v1$3) => $182(
48844
+ state1,
48845
+ more,
48846
+ lift12,
48847
+ $$throw2,
48848
+ (state2$3, a$3) => more((v2$5) => more((v3$2) => {
48849
+ const state2$p = state1._3 && !state2$3._3 ? $ParseState(state2$3._1, state2$3._2, true) : state2$3;
48850
+ return $192(
48851
+ state2$p,
48852
+ more,
48853
+ lift12,
48854
+ $$throw2,
48855
+ (state3, a$4) => more((v4$1) => done(state2$p._3 && !state3._3 ? $ParseState(state3._1, state3._2, true) : state3, a$4))
48856
+ );
48857
+ }))
48858
+ )));
48859
+ })());
49932
48860
  const $19 = $17._3 && !state2$2._3 ? $ParseState(state2$2._1, state2$2._2, true) : state2$2;
49933
48861
  return $5((v1$3) => $18(
49934
48862
  $19,
49935
48863
  $5,
49936
48864
  $6,
49937
48865
  $15,
49938
- (state2$3, a$3) => $5((v2$4) => {
49939
- const $20 = block(expr$lazy());
49940
- const $21 = $19._3 && !state2$3._3 ? $ParseState(state2$3._1, state2$3._2, true) : state2$3;
49941
- return $5((v1$4) => $20(
49942
- $21,
49943
- $5,
49944
- $6,
49945
- $15,
49946
- (state2$4, a$4) => $5((v2$5) => $8(
49947
- $21._3 && !state2$4._3 ? $ParseState(state2$4._1, state2$4._2, true) : state2$4,
49948
- $Expr2("IfElse", a$1, a$2, a$4)
49949
- ))
49950
- ));
49951
- })
48866
+ (state2$3, a$3) => $5((v2$4) => $8(
48867
+ $19._3 && !state2$3._3 ? $ParseState(state2$3._1, state2$3._2, true) : state2$3,
48868
+ $Expr2("IfElse", nonEmptyListNonEmptyList.nonEmpty($List("Cons", a$1, a$2)), a$3)
48869
+ ))
49952
48870
  ));
49953
48871
  })
49954
48872
  ));
@@ -50357,28 +49275,28 @@ var split3 = /* @__PURE__ */ $Tuple(
50357
49275
  /* @__PURE__ */ $ForeignOp$p({
50358
49276
  arity: 2,
50359
49277
  op: (dictMonadWithGraphAlloc) => {
50360
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49278
+ const val2 = val(dictMonadWithGraphAlloc);
50361
49279
  return (dictMonadError) => {
50362
49280
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50363
49281
  return (dictMonadAff) => {
50364
49282
  const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
50365
- return (dictMonadReader) => (dictLoadFile) => (v) => {
50366
- if (v.tag === "Cons" && v._1._3.tag === "Int" && v._2.tag === "Cons" && v._2._1._3.tag === "Str" && v._2._2.tag === "Nil") {
50367
- const $1 = v._1._3._1;
50368
- const $2 = v._2._1._3._1;
50369
- const \u03B1s = insert3(ordVertex)(v._2._1._1)()($$$Map(
49283
+ return (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49284
+ if (v1.tag === "Cons" && v1._1._3.tag === "Int" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Str" && v1._2._2.tag === "Nil") {
49285
+ const $1 = v1._1._3._1;
49286
+ const $2 = v1._2._1._3._1;
49287
+ const \u03B1s = insert3(ordVertex)(v1._2._1._1)()($$$Map(
50370
49288
  "Node",
50371
49289
  1,
50372
49290
  1,
50373
- v._1._1,
49291
+ v1._1._1,
50374
49292
  void 0,
50375
49293
  Leaf,
50376
49294
  Leaf
50377
49295
  ));
50378
- return $0.bind(val(\u03B1s)($BaseVal("Str", take2($1)($2))))((before) => $0.bind(val(\u03B1s)($BaseVal(
49296
+ return $0.bind(val2(Nothing)(\u03B1s)($BaseVal("Str", take2($1)($2))))((before) => $0.bind(val2(Nothing)(\u03B1s)($BaseVal(
50379
49297
  "Str",
50380
49298
  drop(length2(take2($1)($2)))($2)
50381
- )))((after) => val(\u03B1s)($BaseVal("Constr", "Pair", $List("Cons", before, $List("Cons", after, Nil))))));
49299
+ )))((after) => val2(v)(\u03B1s)($BaseVal("Constr", "Pair", $List("Cons", before, $List("Cons", after, Nil))))));
50382
49300
  }
50383
49301
  return $$throw2("Int and string expected");
50384
49302
  };
@@ -50392,41 +49310,41 @@ var search2 = /* @__PURE__ */ $Tuple(
50392
49310
  /* @__PURE__ */ $ForeignOp$p({
50393
49311
  arity: 2,
50394
49312
  op: (dictMonadWithGraphAlloc) => {
50395
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49313
+ const val2 = val(dictMonadWithGraphAlloc);
50396
49314
  return (dictMonadError) => {
50397
49315
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50398
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50399
- if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Cons" && v._2._1._3.tag === "Str" && v._2._2.tag === "Nil") {
50400
- const $0 = v._2._1._3._1;
50401
- const v1 = regex(v._1._3._1)(noFlags);
50402
- if (v1.tag === "Left") {
50403
- return $$throw2("search: " + v1._1);
49316
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49317
+ if (v1.tag === "Cons" && v1._1._3.tag === "Str" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Str" && v1._2._2.tag === "Nil") {
49318
+ const $0 = v1._2._1._3._1;
49319
+ const v2 = regex(v1._1._3._1)(noFlags);
49320
+ if (v2.tag === "Left") {
49321
+ return $$throw2("Regex expected: " + v2._1);
50404
49322
  }
50405
- if (v1.tag === "Right") {
50406
- const \u03B1s = insert3(ordVertex)(v._2._1._1)()($$$Map(
49323
+ if (v2.tag === "Right") {
49324
+ const \u03B1s = insert3(ordVertex)(v1._2._1._1)()($$$Map(
50407
49325
  "Node",
50408
49326
  1,
50409
49327
  1,
50410
- v._1._1,
49328
+ v1._1._1,
50411
49329
  void 0,
50412
49330
  Leaf,
50413
49331
  Leaf
50414
49332
  ));
50415
- const v2 = search(v1._1)($0);
50416
- if (v2.tag === "Nothing") {
50417
- return val(\u03B1s)($BaseVal("Constr", "None", Nil));
49333
+ const v3 = search(v2._1)($0);
49334
+ if (v3.tag === "Nothing") {
49335
+ return val2(v)(\u03B1s)($BaseVal("Constr", "None", Nil));
50418
49336
  }
50419
- if (v2.tag === "Just") {
50420
- return dictMonadAff.MonadEffect0().Monad0().Bind1().bind(val(\u03B1s)($BaseVal("Int", v2._1)))((v3) => val(\u03B1s)($BaseVal(
49337
+ if (v3.tag === "Just") {
49338
+ return dictMonadAff.MonadEffect0().Monad0().Bind1().bind(val2(Nothing)(\u03B1s)($BaseVal("Int", v3._1)))((v4) => val2(v)(\u03B1s)($BaseVal(
50421
49339
  "Constr",
50422
49340
  "Some",
50423
- $List("Cons", v3, Nil)
49341
+ $List("Cons", v4, Nil)
50424
49342
  )));
50425
49343
  }
50426
49344
  }
50427
49345
  fail();
50428
49346
  }
50429
- return $$throw2("Regex and string expected");
49347
+ return $$throw2("Two strings expected");
50430
49348
  };
50431
49349
  };
50432
49350
  }
@@ -50448,15 +49366,15 @@ var matrixUpdate = /* @__PURE__ */ $Tuple(
50448
49366
  /* @__PURE__ */ $ForeignOp$p({
50449
49367
  arity: 3,
50450
49368
  op: (dictMonadWithGraphAlloc) => {
50451
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49369
+ const val2 = val(dictMonadWithGraphAlloc);
50452
49370
  return (dictMonadError) => {
50453
49371
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50454
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50455
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Cons" && v._2._1._3.tag === "Constr" && v._2._1._3._2.tag === "Cons" && v._2._1._3._2._1._3.tag === "Int" && v._2._1._3._2._2.tag === "Cons" && v._2._1._3._2._2._1._3.tag === "Int" && v._2._1._3._2._2._2.tag === "Nil" && v._2._2.tag === "Cons" && v._2._2._2.tag === "Nil" && v._2._1._3._1 === "Pair") {
50456
- const $0 = v._2._2._1;
50457
- return val($$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf))($BaseVal(
49372
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49373
+ if (v1.tag === "Cons" && v1._1._3.tag === "Matrix" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Constr" && v1._2._1._3._2.tag === "Cons" && v1._2._1._3._2._1._3.tag === "Int" && v1._2._1._3._2._2.tag === "Cons" && v1._2._1._3._2._2._1._3.tag === "Int" && v1._2._1._3._2._2._2.tag === "Nil" && v1._2._2.tag === "Cons" && v1._2._2._2.tag === "Nil" && v1._2._1._3._1 === "Pair") {
49374
+ const $0 = v1._2._2._1;
49375
+ return val2(v)($$$Map("Node", 1, 1, v1._1._1, void 0, Leaf, Leaf))($BaseVal(
50458
49376
  "Matrix",
50459
- matrixPut(v._2._1._3._2._1._3._1)(v._2._1._3._2._2._1._3._1)((v$1) => $0)(v._1._3._1)
49377
+ matrixPut(v1._2._1._3._2._1._3._1)(v1._2._1._3._2._2._1._3._1)((v$1) => $0)(v1._1._3._1)
50460
49378
  ));
50461
49379
  }
50462
49380
  return $$throw2("Matrix, pair of integers and value expected");
@@ -50471,9 +49389,9 @@ var matrixLookup = /* @__PURE__ */ $Tuple(
50471
49389
  arity: 2,
50472
49390
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
50473
49391
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50474
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50475
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Cons" && v._2._1._3.tag === "Constr" && v._2._1._3._2.tag === "Cons" && v._2._1._3._2._1._3.tag === "Int" && v._2._1._3._2._2.tag === "Cons" && v._2._1._3._2._2._1._3.tag === "Int" && v._2._1._3._2._2._2.tag === "Nil" && v._2._2.tag === "Nil" && v._2._1._3._1 === "Pair") {
50476
- return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(matrixGet(v._2._1._3._2._1._3._1)(v._2._1._3._2._2._1._3._1)(v._1._3._1));
49392
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49393
+ if (v1.tag === "Cons" && v1._1._3.tag === "Matrix" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Constr" && v1._2._1._3._2.tag === "Cons" && v1._2._1._3._2._1._3.tag === "Int" && v1._2._1._3._2._2.tag === "Cons" && v1._2._1._3._2._2._1._3.tag === "Int" && v1._2._1._3._2._2._2.tag === "Nil" && v1._2._2.tag === "Nil" && v1._2._1._3._1 === "Pair") {
49394
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(matrixGet(v1._2._1._3._2._1._3._1)(v1._2._1._3._2._2._1._3._1)(v1._1._3._1));
50477
49395
  }
50478
49396
  return $$throw2("Matrix and pair of integers expected");
50479
49397
  };
@@ -50496,18 +49414,18 @@ var insert4 = /* @__PURE__ */ $Tuple(
50496
49414
  /* @__PURE__ */ $ForeignOp$p({
50497
49415
  arity: 3,
50498
49416
  op: (dictMonadWithGraphAlloc) => {
50499
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49417
+ const val2 = val(dictMonadWithGraphAlloc);
50500
49418
  return (dictMonadError) => {
50501
49419
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50502
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50503
- if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Str" && v._2._2.tag === "Cons" && v._2._2._2.tag === "Nil") {
50504
- const $0 = v._2._1._3._1;
50505
- return val($$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf))($BaseVal(
49420
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49421
+ if (v1.tag === "Cons" && v1._1._3.tag === "Dictionary" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Str" && v1._2._2.tag === "Cons" && v1._2._2._2.tag === "Nil") {
49422
+ const $0 = v1._2._1._3._1;
49423
+ return val2(v)($$$Map("Node", 1, 1, v1._1._1, void 0, Leaf, Leaf))($BaseVal(
50506
49424
  "Dictionary",
50507
49425
  mutate(($1) => () => {
50508
- $1[$0] = $Tuple(v._2._1._1, v._2._2._1);
49426
+ $1[$0] = $Tuple(v1._2._1._1, v1._2._2._1);
50509
49427
  return $1;
50510
- })(v._1._3._1)
49428
+ })(v1._1._3._1)
50511
49429
  ));
50512
49430
  }
50513
49431
  return $$throw2("Dictionary, key and value expected");
@@ -50523,29 +49441,29 @@ var $$get3 = /* @__PURE__ */ $Tuple(
50523
49441
  /* @__PURE__ */ $ForeignOp$p({
50524
49442
  arity: 2,
50525
49443
  op: (dictMonadWithGraphAlloc) => {
50526
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49444
+ const val2 = val(dictMonadWithGraphAlloc);
50527
49445
  return (dictMonadError) => {
50528
49446
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50529
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50530
- if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
50531
- const v1 = _lookup(Nothing, Just, v._1._3._1, v._2._1._3._1);
50532
- if (v1.tag === "Nothing") {
50533
- return val($$$Map("Node", 1, 1, v._1._1, void 0, Leaf, Leaf))($BaseVal(
49447
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49448
+ if (v1.tag === "Cons" && v1._1._3.tag === "Str" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Dictionary" && v1._2._2.tag === "Nil") {
49449
+ const v2 = _lookup(Nothing, Just, v1._1._3._1, v1._2._1._3._1);
49450
+ if (v2.tag === "Nothing") {
49451
+ return val2(v)($$$Map("Node", 1, 1, v1._1._1, void 0, Leaf, Leaf))($BaseVal(
50534
49452
  "Constr",
50535
49453
  "None",
50536
49454
  Nil
50537
49455
  ));
50538
49456
  }
50539
- if (v1.tag === "Just") {
50540
- return val(insert3(ordVertex)(v1._1._1)()($$$Map(
49457
+ if (v2.tag === "Just") {
49458
+ return val2(v)(insert3(ordVertex)(v2._1._1)()($$$Map(
50541
49459
  "Node",
50542
49460
  1,
50543
49461
  1,
50544
- v._1._1,
49462
+ v1._1._1,
50545
49463
  void 0,
50546
49464
  Leaf,
50547
49465
  Leaf
50548
- )))($BaseVal("Constr", "Some", $List("Cons", v1._1._2, Nil)));
49466
+ )))($BaseVal("Constr", "Some", $List("Cons", v2._1._2, Nil)));
50549
49467
  }
50550
49468
  fail();
50551
49469
  }
@@ -50555,35 +49473,35 @@ var $$get3 = /* @__PURE__ */ $Tuple(
50555
49473
  }
50556
49474
  })
50557
49475
  );
50558
- var fromJsonVal = (dictMonadWithGraphAlloc) => {
50559
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49476
+ var fromJson = (dictMonadWithGraphAlloc) => {
49477
+ const val2 = val(dictMonadWithGraphAlloc);
50560
49478
  return (dictMonadEffect) => {
50561
49479
  const Monad0 = dictMonadEffect.Monad0();
50562
49480
  const $0 = Monad0.Bind1();
50563
49481
  const Applicative0 = Monad0.Applicative0();
50564
49482
  const traverse22 = traversableArray.traverse(Applicative0);
50565
49483
  const traverse2$1 = traversableArray.traverse(Applicative0);
50566
- return caseJson((v) => throwException(error("Error, Null JSON value cannot be converted to Val"))())((b) => val(Leaf)($BaseVal(
49484
+ return (doc_opt) => caseJson((v) => throwException(error("Error, Null JSON value cannot be converted to Val"))())((b) => val2(doc_opt)(Leaf)($BaseVal(
50567
49485
  "Constr",
50568
49486
  b ? "True" : "False",
50569
49487
  Nil
50570
49488
  )))((n) => {
50571
49489
  const v = fromNumber(n);
50572
49490
  if (v.tag === "Just") {
50573
- return val(Leaf)($BaseVal("Int", v._1));
49491
+ return val2(doc_opt)(Leaf)($BaseVal("Int", v._1));
50574
49492
  }
50575
49493
  if (v.tag === "Nothing") {
50576
- return val(Leaf)($BaseVal("Float", n));
49494
+ return val2(doc_opt)(Leaf)($BaseVal("Float", n));
50577
49495
  }
50578
49496
  fail();
50579
- })((s) => val(Leaf)($BaseVal("Str", s)))((xs) => {
50580
- const toList = (v) => {
50581
- if (v.tag === "Nil") {
50582
- return val(Leaf)($BaseVal("Constr", "Nil", Nil));
49497
+ })((s) => val2(doc_opt)(Leaf)($BaseVal("Str", s)))((xs) => {
49498
+ const toList = (v) => (v1) => {
49499
+ if (v1.tag === "Nil") {
49500
+ return val2(v)(Leaf)($BaseVal("Constr", "Nil", Nil));
50583
49501
  }
50584
- if (v.tag === "Cons") {
50585
- const $1 = v._1;
50586
- return $0.bind(toList(v._2))((v$p) => val(Leaf)($BaseVal(
49502
+ if (v1.tag === "Cons") {
49503
+ const $1 = v1._1;
49504
+ return $0.bind(toList(Nothing)(v1._2))((v$p) => val2(v)(Leaf)($BaseVal(
50587
49505
  "Constr",
50588
49506
  ":",
50589
49507
  $List("Cons", $1, $List("Cons", v$p, Nil))
@@ -50591,7 +49509,7 @@ var fromJsonVal = (dictMonadWithGraphAlloc) => {
50591
49509
  }
50592
49510
  fail();
50593
49511
  };
50594
- return $0.bind(traverse2$1(fromJsonVal(dictMonadWithGraphAlloc)(dictMonadEffect))(xs))((vs) => toList((() => {
49512
+ return $0.bind(traverse2$1(fromJson(dictMonadWithGraphAlloc)(dictMonadEffect)(Nothing))(xs))((vs) => toList(doc_opt)((() => {
50595
49513
  const len = vs.length;
50596
49514
  const go = (go$a0$copy) => (go$a1$copy) => {
50597
49515
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
@@ -50630,36 +49548,36 @@ var fromJsonVal = (dictMonadWithGraphAlloc) => {
50630
49548
  })((obj) => $0.bind(traverse22((v) => {
50631
49549
  const $1 = v._1;
50632
49550
  const $2 = v._2;
50633
- return $0.bind(val(Leaf)($BaseVal("Str", $1)))((v1) => {
49551
+ return $0.bind(val2(doc_opt)(Leaf)($BaseVal("Str", $1)))((v1) => {
50634
49552
  const $3 = v1._1;
50635
- return $0.bind(fromJsonVal(dictMonadWithGraphAlloc)(dictMonadEffect)($2))((v2) => Applicative0.pure($Tuple($1, $Tuple($3, v2))));
49553
+ return $0.bind(fromJson(dictMonadWithGraphAlloc)(dictMonadEffect)(Nothing)($2))((v2) => Applicative0.pure($Tuple($1, $Tuple($3, v2))));
50636
49554
  });
50637
- })(toUnfoldable9(obj)))((entries) => val(Leaf)($BaseVal("Dictionary", fromFoldable19(entries)))));
49555
+ })(toUnfoldable9(obj)))((entries) => val2(doc_opt)(Leaf)($BaseVal("Dictionary", fromFoldable19(entries)))));
50638
49556
  };
50639
49557
  };
50640
49558
  var loadJson = /* @__PURE__ */ $Tuple(
50641
- "loadJson",
49559
+ "load_json",
50642
49560
  /* @__PURE__ */ $ForeignOp$p({
50643
49561
  arity: 1,
50644
49562
  op: (dictMonadWithGraphAlloc) => {
50645
- const fromJsonVal1 = fromJsonVal(dictMonadWithGraphAlloc);
49563
+ const fromJson1 = fromJson(dictMonadWithGraphAlloc);
50646
49564
  return (dictMonadError) => {
50647
49565
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50648
49566
  return (dictMonadAff) => {
50649
49567
  const MonadEffect0 = dictMonadAff.MonadEffect0();
50650
49568
  const Bind1 = MonadEffect0.Monad0().Bind1();
50651
- const fromJsonVal2 = fromJsonVal1(MonadEffect0);
49569
+ const fromJson2 = fromJson1(MonadEffect0);
50652
49570
  return (dictMonadReader) => (dictLoadFile) => {
50653
49571
  const loadFileFromPath = dictLoadFile.loadFileFromPath(dictMonadError)(dictMonadAff);
50654
- return (v) => {
50655
- if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
50656
- return Bind1.bind(Bind1.Apply0().Functor0().map(definitely('File "' + v._1._3._1 + '" exists'))(loadFileFromPath(v._1._3._1)))((str) => {
50657
- const v1 = parseJson(str);
50658
- if (v1.tag === "Left") {
50659
- return $$throw2("Failed to parse JSON: " + showJsonDecodeError.show(v1._1));
49572
+ return (v) => (v1) => {
49573
+ if (v1.tag === "Cons" && v1._1._3.tag === "Str" && v1._2.tag === "Nil") {
49574
+ return Bind1.bind(Bind1.Apply0().Functor0().map(definitely('File "' + v1._1._3._1 + '" exists'))(loadFileFromPath(v1._1._3._1)))((str) => {
49575
+ const v2 = parseJson(str);
49576
+ if (v2.tag === "Left") {
49577
+ return $$throw2("Failed to parse JSON: " + showJsonDecodeError.show(v2._1));
50660
49578
  }
50661
- if (v1.tag === "Right") {
50662
- return fromJsonVal2(v1._1);
49579
+ if (v2.tag === "Right") {
49580
+ return fromJson2(v)(v2._1);
50663
49581
  }
50664
49582
  fail();
50665
49583
  });
@@ -50682,14 +49600,15 @@ var foldl_with_index = /* @__PURE__ */ $Tuple(
50682
49600
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50683
49601
  return (dictMonadAff) => {
50684
49602
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
50685
- const $0 = Monad0.Bind1();
49603
+ const Bind1 = Monad0.Bind1();
49604
+ const $0 = Bind1.Apply0().Functor0();
50686
49605
  return (dictMonadReader) => {
50687
49606
  const apply1 = apply3(dictMonadReader)(dictMonadAff);
50688
49607
  return (dictLoadFile) => {
50689
49608
  const apply22 = apply1(dictLoadFile);
50690
- return (v) => {
50691
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Cons" && v._2._2._1._3.tag === "Dictionary" && v._2._2._2.tag === "Nil") {
50692
- const $1 = v._1;
49609
+ return (v) => (v1) => {
49610
+ if (v1.tag === "Cons" && v1._2.tag === "Cons" && v1._2._2.tag === "Cons" && v1._2._2._1._3.tag === "Dictionary" && v1._2._2._2.tag === "Nil") {
49611
+ const $1 = v1._1;
50693
49612
  const go = (go$a0$copy) => (go$a1$copy) => {
50694
49613
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
50695
49614
  while (go$c) {
@@ -50703,8 +49622,19 @@ var foldl_with_index = /* @__PURE__ */ $Tuple(
50703
49622
  go$a0 = (() => {
50704
49623
  const $2 = v$1._1;
50705
49624
  return Monad0.Bind1().bind(b)((a) => {
50706
- const $3 = $2._2._2;
50707
- return $0.bind($0.bind(apply22($1)($Val($2._2._1, Nothing, $BaseVal("Str", $2._1))))((a$1) => apply22(a$1)(a)))((a$1) => apply22(a$1)($3));
49625
+ const $3 = a._1;
49626
+ return $0.map((v5) => $Tuple(v5, Nothing))(Bind1.bind(Bind1.bind(apply22(Nothing)($1)($Val(
49627
+ $2._2._1,
49628
+ Nothing,
49629
+ $BaseVal("Str", $2._1)
49630
+ )))((() => {
49631
+ const $4 = apply22(Nothing);
49632
+ return (a$1) => $4(a$1)($3);
49633
+ })()))((() => {
49634
+ const $4 = apply22(a._2);
49635
+ const $5 = $2._2._2;
49636
+ return (a$1) => $4(a$1)($5);
49637
+ })()));
50708
49638
  });
50709
49639
  })();
50710
49640
  go$a1 = v$1._2;
@@ -50714,7 +49644,7 @@ var foldl_with_index = /* @__PURE__ */ $Tuple(
50714
49644
  }
50715
49645
  return go$r;
50716
49646
  };
50717
- return go(Monad0.Applicative0().pure(v._2._1))(toUnfoldable22(v._2._2._1._3._1));
49647
+ return $0.map(fst)(go(Monad0.Applicative0().pure($Tuple(v1._2._1, v)))(toUnfoldable22(v1._2._2._1._3._1)));
50718
49648
  }
50719
49649
  return $$throw2("Function, value and dictionary expected");
50720
49650
  };
@@ -50725,15 +49655,53 @@ var foldl_with_index = /* @__PURE__ */ $Tuple(
50725
49655
  }
50726
49656
  })
50727
49657
  );
49658
+ var find_str = /* @__PURE__ */ $Tuple(
49659
+ "find_str",
49660
+ /* @__PURE__ */ $ForeignOp$p({
49661
+ arity: 2,
49662
+ op: (dictMonadWithGraphAlloc) => {
49663
+ const val2 = val(dictMonadWithGraphAlloc);
49664
+ return (dictMonadError) => {
49665
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
49666
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49667
+ if (v1.tag === "Cons" && v1._1._3.tag === "Str" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Str" && v1._2._2.tag === "Nil") {
49668
+ return val2(v)(insert3(ordVertex)(v1._2._1._1)()($$$Map(
49669
+ "Node",
49670
+ 1,
49671
+ 1,
49672
+ v1._1._1,
49673
+ void 0,
49674
+ Leaf,
49675
+ Leaf
49676
+ )))($BaseVal(
49677
+ "Int",
49678
+ (() => {
49679
+ const $0 = indexOf2(v1._1._3._1)(v1._2._1._3._1);
49680
+ if ($0.tag === "Nothing") {
49681
+ return -1;
49682
+ }
49683
+ if ($0.tag === "Just") {
49684
+ return $0._1;
49685
+ }
49686
+ fail();
49687
+ })()
49688
+ ));
49689
+ }
49690
+ return $$throw2("Two strings expected");
49691
+ };
49692
+ };
49693
+ }
49694
+ })
49695
+ );
50728
49696
  var error_ = /* @__PURE__ */ $Tuple(
50729
49697
  "error",
50730
49698
  /* @__PURE__ */ $ForeignOp$p({
50731
49699
  arity: 1,
50732
49700
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
50733
49701
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50734
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50735
- if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
50736
- return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
49702
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49703
+ if (v1.tag === "Cons" && v1._1._3.tag === "Str" && v1._2.tag === "Nil") {
49704
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(throwException(error(v1._1._3._1))());
50737
49705
  }
50738
49706
  return $$throw2("String expected");
50739
49707
  };
@@ -50741,33 +49709,34 @@ var error_ = /* @__PURE__ */ $Tuple(
50741
49709
  })
50742
49710
  );
50743
49711
  var divide = /* @__PURE__ */ union5(asNumberIntOrNumber)(asNumberIntOrNumber)(asIntNumber)(asIntNumber)((x2) => (y2) => toNumber(x2) / toNumber(y2))(numDiv);
49712
+ var div = (x2) => (y2) => unsafeClamp(floor(toNumber(x2) / toNumber(y2)));
49713
+ var mod = (x2) => (y2) => x2 - (y2 * div(x2)(y2) | 0) | 0;
50744
49714
  var dims = /* @__PURE__ */ $Tuple(
50745
49715
  "dims",
50746
49716
  /* @__PURE__ */ $ForeignOp$p({
50747
49717
  arity: 1,
50748
49718
  op: (dictMonadWithGraphAlloc) => {
50749
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49719
+ const val2 = val(dictMonadWithGraphAlloc);
50750
49720
  return (dictMonadError) => {
50751
49721
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50752
49722
  return (dictMonadAff) => {
50753
49723
  const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
50754
- return (dictMonadReader) => (dictLoadFile) => (v) => {
50755
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
50756
- const $1 = v._1._3._1._2._2._1;
50757
- const $2 = v._1._1;
50758
- const $3 = v._1._3._1._2._2._2;
50759
- return $0.bind(val($$$Map("Node", 1, 1, v._1._3._1._2._1._2, void 0, Leaf, Leaf))($BaseVal(
49724
+ return (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49725
+ if (v1.tag === "Cons" && v1._1._3.tag === "Matrix" && v1._2.tag === "Nil") {
49726
+ const $1 = v1._1._3._1._2._2._1;
49727
+ const $2 = v1._1._1;
49728
+ const $3 = v1._1._3._1._2._2._2;
49729
+ return $0.bind(val2(Nothing)($$$Map("Node", 1, 1, v1._1._3._1._2._1._2, void 0, Leaf, Leaf))($BaseVal(
50760
49730
  "Int",
50761
- v._1._3._1._2._1._1
50762
- )))((v1) => $0.bind(val($$$Map("Node", 1, 1, $3, void 0, Leaf, Leaf))($BaseVal("Int", $1)))((v2) => val($$$Map(
50763
- "Node",
50764
- 1,
50765
- 1,
50766
- $2,
50767
- void 0,
50768
- Leaf,
50769
- Leaf
50770
- ))($BaseVal("Constr", "Pair", $List("Cons", v1, $List("Cons", v2, Nil))))));
49731
+ v1._1._3._1._2._1._1
49732
+ )))((v11) => $0.bind(val2(Nothing)($$$Map("Node", 1, 1, $3, void 0, Leaf, Leaf))($BaseVal(
49733
+ "Int",
49734
+ $1
49735
+ )))((v2) => val2(v)($$$Map("Node", 1, 1, $2, void 0, Leaf, Leaf))($BaseVal(
49736
+ "Constr",
49737
+ "Pair",
49738
+ $List("Cons", v11, $List("Cons", v2, Nil))
49739
+ ))));
50771
49740
  }
50772
49741
  return $$throw2("Matrix expected");
50773
49742
  };
@@ -50782,7 +49751,7 @@ var dict_map = /* @__PURE__ */ $Tuple(
50782
49751
  arity: 2,
50783
49752
  op: (dictMonadWithGraphAlloc) => {
50784
49753
  const apply3 = apply2(dictMonadWithGraphAlloc);
50785
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49754
+ const val2 = val(dictMonadWithGraphAlloc);
50786
49755
  return (dictMonadError) => {
50787
49756
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50788
49757
  return (dictMonadAff) => {
@@ -50793,14 +49762,14 @@ var dict_map = /* @__PURE__ */ $Tuple(
50793
49762
  const apply1 = apply3(dictMonadReader)(dictMonadAff);
50794
49763
  return (dictLoadFile) => {
50795
49764
  const apply22 = apply1(dictLoadFile);
50796
- return (v) => {
50797
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
50798
- const $0 = v._1;
50799
- const $1 = v._2._1._1;
50800
- return Bind1.bind(traverse22((v2) => {
50801
- const $2 = v2._1;
50802
- return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply22($0)(v2._2));
50803
- })(v._2._1._3._1))((d$p) => val($$$Map("Node", 1, 1, $1, void 0, Leaf, Leaf))($BaseVal(
49765
+ return (v) => (v1) => {
49766
+ if (v1.tag === "Cons" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Dictionary" && v1._2._2.tag === "Nil") {
49767
+ const $0 = v1._1;
49768
+ const $1 = v1._2._1._1;
49769
+ return Bind1.bind(traverse22((v3) => {
49770
+ const $2 = v3._1;
49771
+ return Bind1.Apply0().Functor0().map((v4) => $Tuple($2, v4))(apply22(Nothing)($0)(v3._2));
49772
+ })(v1._2._1._3._1))((d$p) => val2(v)($$$Map("Node", 1, 1, $1, void 0, Leaf, Leaf))($BaseVal(
50804
49773
  "Dictionary",
50805
49774
  d$p
50806
49775
  )));
@@ -50820,7 +49789,7 @@ var dict_intersectionWith = /* @__PURE__ */ $Tuple(
50820
49789
  arity: 3,
50821
49790
  op: (dictMonadWithGraphAlloc) => {
50822
49791
  const apply3 = apply2(dictMonadWithGraphAlloc);
50823
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49792
+ const val2 = val(dictMonadWithGraphAlloc);
50824
49793
  return (dictMonadError) => {
50825
49794
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50826
49795
  return (dictMonadAff) => {
@@ -50832,25 +49801,28 @@ var dict_intersectionWith = /* @__PURE__ */ $Tuple(
50832
49801
  const apply1 = apply3(dictMonadReader)(dictMonadAff);
50833
49802
  return (dictLoadFile) => {
50834
49803
  const apply22 = apply1(dictLoadFile);
50835
- return (v) => {
50836
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Cons" && v._2._2._1._3.tag === "Dictionary" && v._2._2._2.tag === "Nil") {
50837
- const $1 = v._1;
50838
- const $2 = v._2._1._1;
50839
- const $3 = v._2._2._1._1;
50840
- return Bind1.bind($0.map(Dictionary2)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity17)(intersectionWith_Object((v2) => (v3) => {
50841
- const $4 = v3._2;
50842
- const $5 = v2._1;
50843
- const $6 = v3._1;
50844
- return Bind1.bind(Bind1.bind(apply22($1)(v2._2))((a) => apply22(a)($4)))((v4) => Bind1.bind(val(insert3(ordVertex)($6)()($$$Map(
49804
+ return (v) => (v1) => {
49805
+ if (v1.tag === "Cons" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Dictionary" && v1._2._2.tag === "Cons" && v1._2._2._1._3.tag === "Dictionary" && v1._2._2._2.tag === "Nil") {
49806
+ const $1 = v1._1;
49807
+ const $2 = v1._2._1._1;
49808
+ const $3 = v1._2._2._1._1;
49809
+ return Bind1.bind($0.map(Dictionary2)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity17)(intersectionWith_Object((v3) => (v4) => {
49810
+ const $4 = v3._1;
49811
+ const $5 = v4._1;
49812
+ return Bind1.bind(Bind1.bind(apply22(Nothing)($1)(v3._2))((() => {
49813
+ const $6 = apply22(Nothing);
49814
+ const $7 = v4._2;
49815
+ return (a) => $6(a)($7);
49816
+ })()))((v5) => Bind1.bind(val2(Nothing)(insert3(ordVertex)($5)()($$$Map(
50845
49817
  "Node",
50846
49818
  1,
50847
49819
  1,
50848
- $5,
49820
+ $4,
50849
49821
  void 0,
50850
49822
  Leaf,
50851
49823
  Leaf
50852
- )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
50853
- })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => val(insert3(ordVertex)($3)()($$$Map(
49824
+ )))(v5._3))((v6) => Applicative0.pure($Tuple(v6._1, v5))));
49825
+ })(v1._2._1._3._1)(v1._2._2._1._3._1)))))((v$p) => val2(v)(insert3(ordVertex)($3)()($$$Map(
50854
49826
  "Node",
50855
49827
  1,
50856
49828
  1,
@@ -50874,20 +49846,20 @@ var dict_disjointUnion = /* @__PURE__ */ $Tuple(
50874
49846
  /* @__PURE__ */ $ForeignOp$p({
50875
49847
  arity: 2,
50876
49848
  op: (dictMonadWithGraphAlloc) => {
50877
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49849
+ const val2 = val(dictMonadWithGraphAlloc);
50878
49850
  return (dictMonadError) => {
50879
49851
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50880
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50881
- if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
50882
- return val(insert3(ordVertex)(v._2._1._1)()($$$Map(
49852
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49853
+ if (v1.tag === "Cons" && v1._1._3.tag === "Dictionary" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Dictionary" && v1._2._2.tag === "Nil") {
49854
+ return val2(v)(insert3(ordVertex)(v1._2._1._1)()($$$Map(
50883
49855
  "Node",
50884
49856
  1,
50885
49857
  1,
50886
- v._1._1,
49858
+ v1._1._1,
50887
49859
  void 0,
50888
49860
  Leaf,
50889
49861
  Leaf
50890
- )))($BaseVal("Dictionary", disjointUnion3(v._1._3._1)(v._2._1._3._1)));
49862
+ )))($BaseVal("Dictionary", disjointUnion3(v1._1._3._1)(v1._2._1._3._1)));
50891
49863
  }
50892
49864
  return $$throw2("Dictionaries expected");
50893
49865
  };
@@ -50900,20 +49872,20 @@ var dict_difference = /* @__PURE__ */ $Tuple(
50900
49872
  /* @__PURE__ */ $ForeignOp$p({
50901
49873
  arity: 2,
50902
49874
  op: (dictMonadWithGraphAlloc) => {
50903
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49875
+ const val2 = val(dictMonadWithGraphAlloc);
50904
49876
  return (dictMonadError) => {
50905
49877
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50906
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50907
- if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
50908
- return val(insert3(ordVertex)(v._2._1._1)()($$$Map(
49878
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49879
+ if (v1.tag === "Cons" && v1._1._3.tag === "Dictionary" && v1._2.tag === "Cons" && v1._2._1._3.tag === "Dictionary" && v1._2._2.tag === "Nil") {
49880
+ return val2(v)(insert3(ordVertex)(v1._2._1._1)()($$$Map(
50909
49881
  "Node",
50910
49882
  1,
50911
49883
  1,
50912
- v._1._1,
49884
+ v1._1._1,
50913
49885
  void 0,
50914
49886
  Leaf,
50915
49887
  Leaf
50916
- )))($BaseVal("Dictionary", mapFObjectString.difference(v._1._3._1)(v._2._1._3._1)));
49888
+ )))($BaseVal("Dictionary", mapFObjectString.difference(v1._1._3._1)(v1._2._1._3._1)));
50917
49889
  }
50918
49890
  return $$throw2("Dictionaries expected.");
50919
49891
  };
@@ -50926,42 +49898,42 @@ var dict2 = /* @__PURE__ */ $Tuple(
50926
49898
  /* @__PURE__ */ $ForeignOp$p({
50927
49899
  arity: 1,
50928
49900
  op: (dictMonadWithGraphAlloc) => {
50929
- const val = dictMonadWithGraphAlloc.new(typeNameVal)((a) => Val(a)(Nothing));
49901
+ const val2 = val(dictMonadWithGraphAlloc);
50930
49902
  return (dictMonadError) => {
50931
49903
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50932
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50933
- if (v.tag === "Cons" && v._2.tag === "Nil") {
49904
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49905
+ if (v1.tag === "Cons" && v1._2.tag === "Nil") {
50934
49906
  const kvs$p = (dictMonadError1) => {
50935
49907
  const MonadThrow0 = dictMonadError1.MonadThrow0();
50936
49908
  const Monad0 = MonadThrow0.Monad0();
50937
49909
  const $0 = Monad0.Applicative0();
50938
- return (v2) => {
50939
- if (v2._3.tag === "Constr") {
50940
- if (v2._3._2.tag === "Nil") {
50941
- if (v2._3._1 === "Nil") {
49910
+ return (v3) => {
49911
+ if (v3._3.tag === "Constr") {
49912
+ if (v3._3._2.tag === "Nil") {
49913
+ if (v3._3._1 === "Nil") {
50942
49914
  return $0.pure($Tuple(
50943
- $$$Map("Node", 1, 1, v2._1, void 0, Leaf, Leaf),
49915
+ $$$Map("Node", 1, 1, v3._1, void 0, Leaf, Leaf),
50944
49916
  Nil
50945
49917
  ));
50946
49918
  }
50947
49919
  return MonadThrow0.throwError(error("List of (key, value) pairs expected"));
50948
49920
  }
50949
- if (v2._3._2.tag === "Cons" && v2._3._2._1._3.tag === "Constr" && v2._3._2._1._3._2.tag === "Cons" && v2._3._2._1._3._2._1._3.tag === "Str" && v2._3._2._1._3._2._2.tag === "Cons" && v2._3._2._1._3._2._2._2.tag === "Nil" && v2._3._2._2.tag === "Cons" && v2._3._2._2._2.tag === "Nil" && v2._3._1 === ":" && v2._3._2._1._3._1 === "Pair") {
50950
- const $1 = v2._3._2._1._3._2._1._3._1;
50951
- const $2 = v2._3._2._1._3._2._2._1;
50952
- const $3 = v2._1;
50953
- const $4 = v2._3._2._1._3._2._1._1;
50954
- const $5 = v2._3._2._1._1;
50955
- return Monad0.Bind1().bind(kvs$p(dictMonadError1)(v2._3._2._2._1))((v3) => $0.pure($Tuple(
50956
- insert3(ordVertex)($3)()(insert3(ordVertex)($5)()(v3._1)),
50957
- $List("Cons", $Tuple($1, $Tuple($4, $2)), v3._2)
49921
+ if (v3._3._2.tag === "Cons" && v3._3._2._1._3.tag === "Constr" && v3._3._2._1._3._2.tag === "Cons" && v3._3._2._1._3._2._1._3.tag === "Str" && v3._3._2._1._3._2._2.tag === "Cons" && v3._3._2._1._3._2._2._2.tag === "Nil" && v3._3._2._2.tag === "Cons" && v3._3._2._2._2.tag === "Nil" && v3._3._1 === ":" && v3._3._2._1._3._1 === "Pair") {
49922
+ const $1 = v3._3._2._1._3._2._1._3._1;
49923
+ const $2 = v3._3._2._1._3._2._2._1;
49924
+ const $3 = v3._1;
49925
+ const $4 = v3._3._2._1._3._2._1._1;
49926
+ const $5 = v3._3._2._1._1;
49927
+ return Monad0.Bind1().bind(kvs$p(dictMonadError1)(v3._3._2._2._1))((v4) => $0.pure($Tuple(
49928
+ insert3(ordVertex)($3)()(insert3(ordVertex)($5)()(v4._1)),
49929
+ $List("Cons", $Tuple($1, $Tuple($4, $2)), v4._2)
50958
49930
  )));
50959
49931
  }
50960
49932
  }
50961
49933
  return MonadThrow0.throwError(error("List of (key, value) pairs expected"));
50962
49934
  };
50963
49935
  };
50964
- return dictMonadAff.MonadEffect0().Monad0().Bind1().bind(kvs$p(dictMonadError)(v._1))((v2) => val(v2._1)($BaseVal("Dictionary", fromFoldable110(v2._2))));
49936
+ return dictMonadAff.MonadEffect0().Monad0().Bind1().bind(kvs$p(dictMonadError)(v1._1))((v3) => val2(v)(v3._1)($BaseVal("Dictionary", fromFoldable110(v3._2))));
50965
49937
  }
50966
49938
  return $$throw2("Single argument expected");
50967
49939
  };
@@ -50970,14 +49942,14 @@ var dict2 = /* @__PURE__ */ $Tuple(
50970
49942
  })
50971
49943
  );
50972
49944
  var debugLog = /* @__PURE__ */ $Tuple(
50973
- "debugLog",
49945
+ "debug_log",
50974
49946
  /* @__PURE__ */ $ForeignOp$p({
50975
49947
  arity: 1,
50976
49948
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
50977
49949
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
50978
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
50979
- if (v.tag === "Cons" && v._2.tag === "Nil") {
50980
- const $0 = v._1;
49950
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => (v1) => {
49951
+ if (v1.tag === "Cons" && v1._2.tag === "Nil") {
49952
+ const $0 = v1._1;
50981
49953
  return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
50982
49954
  }
50983
49955
  return $$throw2("Single argument expected");
@@ -51005,7 +49977,7 @@ var primitives = /* @__PURE__ */ (() => fromFoldable19([
51005
49977
  }),
51006
49978
  unary2("floor")({ i: number5, o: $$int, fwd: floor2 }),
51007
49979
  unary2("log")({ i: intOrNumber, o: number5, fwd: log3 }),
51008
- unary2("numToStr")({ i: intOrNumber, o: string2, fwd: numToStr }),
49980
+ unary2("num_to_str")({ i: intOrNumber, o: string2, fwd: numToStr }),
51009
49981
  binary2("+")({
51010
49982
  i1: intOrNumber,
51011
49983
  i2: intOrNumber,
@@ -51072,10 +50044,14 @@ var primitives = /* @__PURE__ */ (() => fromFoldable19([
51072
50044
  matrixUpdate._1,
51073
50045
  $Val(void 0, Nothing, $BaseVal("Fun", $Fun("Foreign", $Tuple(matrixUpdate._1, matrixUpdate._2), Nil)))
51074
50046
  ),
50047
+ $Tuple(
50048
+ find_str._1,
50049
+ $Val(void 0, Nothing, $BaseVal("Fun", $Fun("Foreign", $Tuple(find_str._1, find_str._2), Nil)))
50050
+ ),
51075
50051
  $Tuple(search2._1, $Val(void 0, Nothing, $BaseVal("Fun", $Fun("Foreign", $Tuple(search2._1, search2._2), Nil)))),
51076
50052
  $Tuple(split3._1, $Val(void 0, Nothing, $BaseVal("Fun", $Fun("Foreign", $Tuple(split3._1, split3._2), Nil)))),
51077
- binaryZero22("div")({ i: $$int, o: $$int, fwd: intDiv2 }),
51078
- binaryZero22("mod")({ i: $$int, o: $$int, fwd: intMod }),
50053
+ binaryZero22("//")({ i: $$int, o: $$int, fwd: div }),
50054
+ binaryZero22("%")({ i: $$int, o: $$int, fwd: mod }),
51079
50055
  binaryZero22("quot")({ i: $$int, o: $$int, fwd: quot }),
51080
50056
  binaryZero22("rem")({ i: $$int, o: $$int, fwd: rem })
51081
50057
  ]))();