@explorable-viz/fluid 0.8.0 → 0.8.1

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.
@@ -122,6 +122,23 @@ var arrayMap = function(f) {
122
122
  // output-es/Data.Functor/index.js
123
123
  var functorArray = { map: arrayMap };
124
124
 
125
+ // output-es/Control.Apply/foreign.js
126
+ var arrayApply = function(fs) {
127
+ return function(xs) {
128
+ var l = fs.length;
129
+ var k = xs.length;
130
+ var result = new Array(l * k);
131
+ var n = 0;
132
+ for (var i = 0; i < l; i++) {
133
+ var f = fs[i];
134
+ for (var j = 0; j < k; j++) {
135
+ result[n++] = f(xs[j]);
136
+ }
137
+ }
138
+ return result;
139
+ };
140
+ };
141
+
125
142
  // output-es/Control.Apply/index.js
126
143
  var identity = (x) => x;
127
144
 
@@ -289,15 +306,7 @@ var applyMaybe = {
289
306
  },
290
307
  Functor0: () => functorMaybe
291
308
  };
292
- var altMaybe = {
293
- alt: (v) => (v1) => {
294
- if (v.tag === "Nothing") {
295
- return v1;
296
- }
297
- return v;
298
- },
299
- Functor0: () => functorMaybe
300
- };
309
+ var applicativeMaybe = { pure: Just, Apply0: () => applyMaybe };
301
310
 
302
311
  // output-es/Data.Either/index.js
303
312
  var $Either = (tag, _1) => ({ tag, _1 });
@@ -603,6 +612,12 @@ var lookup = (dictFoldable) => {
603
612
  return Nothing;
604
613
  });
605
614
  };
615
+ var find = (dictFoldable) => (p) => dictFoldable.foldl((v) => (v1) => {
616
+ if (v.tag === "Nothing" && p(v1)) {
617
+ return $Maybe("Just", v1);
618
+ }
619
+ return v;
620
+ })(Nothing);
606
621
 
607
622
  // output-es/Data.Eq/foreign.js
608
623
  var refEq = function(r1) {
@@ -1010,6 +1025,7 @@ var groupBy = (op) => (xs) => {
1010
1025
  })();
1011
1026
  return result;
1012
1027
  };
1028
+ var foldM = (dictMonad) => (f) => (b) => unconsImpl((v) => dictMonad.Applicative0().pure(b))((a) => (as) => dictMonad.Bind1().bind(f(b)(a))((b$p) => foldM(dictMonad)(f)(b$p)(as)));
1013
1029
  var findIndex = /* @__PURE__ */ findIndexImpl(Just)(Nothing);
1014
1030
  var notElem = (dictEq) => (a) => (arr) => {
1015
1031
  const $0 = findIndex((v) => dictEq.eq(v)(a))(arr);
@@ -1256,7 +1272,7 @@ var foldableNonEmptyList = {
1256
1272
  foldr: (f) => (b) => (v) => f(v._1)(foldableList.foldr(f)(b)(v._2))
1257
1273
  };
1258
1274
  var showList = (dictShow) => {
1259
- const show4 = dictShow.show;
1275
+ const show5 = dictShow.show;
1260
1276
  return {
1261
1277
  show: (v) => {
1262
1278
  if (v.tag === "Nil") {
@@ -1280,7 +1296,7 @@ var showList = (dictShow) => {
1280
1296
  }
1281
1297
  return go$r;
1282
1298
  };
1283
- return "(" + go({ init: true, acc: "" })(listMap(show4)(v)).acc + " : Nil)";
1299
+ return "(" + go({ init: true, acc: "" })(listMap(show5)(v)).acc + " : Nil)";
1284
1300
  }
1285
1301
  };
1286
1302
  };
@@ -3098,6 +3114,16 @@ var groupBy2 = (v) => (v1) => {
3098
3114
  }
3099
3115
  fail();
3100
3116
  };
3117
+ var foldM2 = (dictMonad) => (v) => (v1) => (v2) => {
3118
+ if (v2.tag === "Nil") {
3119
+ return dictMonad.Applicative0().pure(v1);
3120
+ }
3121
+ if (v2.tag === "Cons") {
3122
+ const $0 = v2._2;
3123
+ return dictMonad.Bind1().bind(v(v1)(v2._1))((b$p) => foldM2(dictMonad)(v)(b$p)($0));
3124
+ }
3125
+ fail();
3126
+ };
3101
3127
  var drop3 = (drop$a0$copy) => (drop$a1$copy) => {
3102
3128
  let drop$a0 = drop$a0$copy, drop$a1 = drop$a1$copy, drop$c = true, drop$r;
3103
3129
  while (drop$c) {
@@ -3331,7 +3357,10 @@ var replicate2 = (dictUnfoldable) => (n) => (v) => dictUnfoldable.unfoldr((i) =>
3331
3357
  var $KickUp = (_1, _2, _3, _4) => ({ tag: "KickUp", _1, _2, _3, _4 });
3332
3358
  var $$$Map = (tag, _1, _2, _3, _4, _5, _6, _7) => ({ tag, _1, _2, _3, _4, _5, _6, _7 });
3333
3359
  var $TreeContext = (tag, _1, _2, _3, _4, _5, _6) => ({ tag, _1, _2, _3, _4, _5, _6 });
3360
+ var identity9 = (x) => x;
3334
3361
  var Leaf2 = /* @__PURE__ */ $$$Map("Leaf");
3362
+ var Two = (value0) => (value1) => (value2) => (value3) => $$$Map("Two", value0, value1, value2, value3);
3363
+ var Three = (value0) => (value1) => (value2) => (value3) => (value4) => (value5) => (value6) => $$$Map("Three", value0, value1, value2, value3, value4, value5, value6);
3335
3364
  var size = (v) => {
3336
3365
  if (v.tag === "Leaf") {
3337
3366
  return 0;
@@ -3450,6 +3479,20 @@ var lookup2 = (dictOrd) => (k) => {
3450
3479
  };
3451
3480
  return go;
3452
3481
  };
3482
+ var functorMap = {
3483
+ map: (v) => (v1) => {
3484
+ if (v1.tag === "Leaf") {
3485
+ return Leaf2;
3486
+ }
3487
+ if (v1.tag === "Two") {
3488
+ return $$$Map("Two", functorMap.map(v)(v1._1), v1._2, v(v1._3), functorMap.map(v)(v1._4));
3489
+ }
3490
+ if (v1.tag === "Three") {
3491
+ return $$$Map("Three", functorMap.map(v)(v1._1), v1._2, v(v1._3), functorMap.map(v)(v1._4), v1._5, v(v1._6), functorMap.map(v)(v1._7));
3492
+ }
3493
+ fail();
3494
+ }
3495
+ };
3453
3496
  var fromZipper = (fromZipper$a0$copy) => (fromZipper$a1$copy) => (fromZipper$a2$copy) => {
3454
3497
  let fromZipper$a0 = fromZipper$a0$copy, fromZipper$a1 = fromZipper$a1$copy, fromZipper$a2 = fromZipper$a2$copy, fromZipper$c = true, fromZipper$r;
3455
3498
  while (fromZipper$c) {
@@ -4236,6 +4279,27 @@ var foldableWithIndexMap = {
4236
4279
  },
4237
4280
  Foldable0: () => foldableMap
4238
4281
  };
4282
+ var traversableMap = {
4283
+ traverse: (dictApplicative) => {
4284
+ const Apply0 = dictApplicative.Apply0();
4285
+ const $0 = Apply0.Functor0();
4286
+ return (v) => (v1) => {
4287
+ if (v1.tag === "Leaf") {
4288
+ return dictApplicative.pure(Leaf2);
4289
+ }
4290
+ if (v1.tag === "Two") {
4291
+ return Apply0.apply(Apply0.apply(Apply0.apply($0.map(Two)(traversableMap.traverse(dictApplicative)(v)(v1._1)))(dictApplicative.pure(v1._2)))(v(v1._3)))(traversableMap.traverse(dictApplicative)(v)(v1._4));
4292
+ }
4293
+ if (v1.tag === "Three") {
4294
+ return Apply0.apply(Apply0.apply(Apply0.apply(Apply0.apply(Apply0.apply(Apply0.apply($0.map(Three)(traversableMap.traverse(dictApplicative)(v)(v1._1)))(dictApplicative.pure(v1._2)))(v(v1._3)))(traversableMap.traverse(dictApplicative)(v)(v1._4)))(dictApplicative.pure(v1._5)))(v(v1._6)))(traversableMap.traverse(dictApplicative)(v)(v1._7));
4295
+ }
4296
+ fail();
4297
+ };
4298
+ },
4299
+ sequence: (dictApplicative) => traversableMap.traverse(dictApplicative)(identity9),
4300
+ Functor0: () => functorMap,
4301
+ Foldable1: () => foldableMap
4302
+ };
4239
4303
  var findMin = /* @__PURE__ */ (() => {
4240
4304
  const go = (go$a0$copy) => (go$a1$copy) => {
4241
4305
  let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
@@ -4268,10 +4332,10 @@ var eqMap = (dictEq) => (dictEq1) => {
4268
4332
  };
4269
4333
  var fromFoldable = (dictOrd) => (dictFoldable) => dictFoldable.foldl((m) => (v) => insert(dictOrd)(v._1)(v._2)(m))(Leaf2);
4270
4334
  var filterWithKey = (dictOrd) => {
4271
- const fromFoldable112 = fromFoldable(dictOrd)(foldableList2);
4335
+ const fromFoldable111 = fromFoldable(dictOrd)(foldableList2);
4272
4336
  return (predicate) => {
4273
4337
  const $0 = filter2((v) => predicate(v._1)(v._2));
4274
- return (x) => fromFoldable112($0(toUnfoldable3(unfoldableList2)(x)));
4338
+ return (x) => fromFoldable111($0(toUnfoldable3(unfoldableList2)(x)));
4275
4339
  };
4276
4340
  };
4277
4341
  var $$delete = (dictOrd) => (k) => (m) => {
@@ -9679,7 +9743,7 @@ var keys = Object.keys || toArrayWithKey(function(k) {
9679
9743
  });
9680
9744
 
9681
9745
  // output-es/Foreign.Object/index.js
9682
- var identity9 = (x) => x;
9746
+ var identity10 = (x) => x;
9683
9747
  var values = /* @__PURE__ */ toArrayWithKey((v) => (v1) => v1);
9684
9748
  var toAscUnfoldable = (dictUnfoldable) => {
9685
9749
  const $0 = sortWith(ordString)(fst);
@@ -9708,20 +9772,20 @@ var insert2 = (k) => (v) => mutate(($0) => () => {
9708
9772
  var functorObject = { map: (f) => (m) => _fmapObject(m, f) };
9709
9773
  var functorWithIndexObject = { mapWithIndex: mapWithKey, Functor0: () => functorObject };
9710
9774
  var fromFoldable2 = (dictFoldable) => {
9711
- const fromFoldable112 = fromFoldableImpl(dictFoldable.foldr);
9775
+ const fromFoldable111 = fromFoldableImpl(dictFoldable.foldr);
9712
9776
  return (l) => {
9713
9777
  const s = {};
9714
- for (const v of fromFoldable112(l)) {
9778
+ for (const v of fromFoldable111(l)) {
9715
9779
  s[v._1] = v._2;
9716
9780
  }
9717
9781
  return s;
9718
9782
  };
9719
9783
  };
9720
- var foldM = (dictMonad) => {
9784
+ var foldM3 = (dictMonad) => {
9721
9785
  const bind12 = dictMonad.Bind1().bind;
9722
9786
  return (f) => (z) => _foldM(bind12)(f)(dictMonad.Applicative0().pure(z));
9723
9787
  };
9724
- var foldM1 = /* @__PURE__ */ foldM(monadST);
9788
+ var foldM1 = /* @__PURE__ */ foldM3(monadST);
9725
9789
  var union2 = (m) => mutate((s) => foldM1((s$p) => (k) => (v) => () => {
9726
9790
  s$p[k] = v;
9727
9791
  return s$p;
@@ -9769,7 +9833,7 @@ var traversableObject = {
9769
9833
  const $0 = traversableWithIndexObject.traverseWithIndex(dictApplicative);
9770
9834
  return (x) => $0((v) => x);
9771
9835
  },
9772
- sequence: (dictApplicative) => traversableObject.traverse(dictApplicative)(identity9),
9836
+ sequence: (dictApplicative) => traversableObject.traverse(dictApplicative)(identity10),
9773
9837
  Functor0: () => functorObject,
9774
9838
  Foldable1: () => foldableObject
9775
9839
  };
@@ -9982,7 +10046,7 @@ var intercalate2 = (sep) => (xs) => {
9982
10046
  };
9983
10047
  return go({ init: true, acc: Nil })(xs).acc;
9984
10048
  };
9985
- var identity12 = (x) => x;
10049
+ var identity13 = (x) => x;
9986
10050
  var isEmptySet = { isEmpty };
9987
10051
  var isEmptyObject = { isEmpty: isEmpty2 };
9988
10052
  var $$throw = (dictMonadThrow) => (x) => dictMonadThrow.throwError(error(x));
@@ -10082,13 +10146,13 @@ var bind2Flipped = (dictMonad) => {
10082
10146
  };
10083
10147
  var assertWith = (v) => (v1) => {
10084
10148
  if (v1) {
10085
- return identity12;
10149
+ return identity13;
10086
10150
  }
10087
10151
  return (v2) => throwException(error("Assertion failure: " + v))();
10088
10152
  };
10089
10153
  var assertWhen = (v) => (v1) => {
10090
10154
  if (!v) {
10091
- return (v$1) => identity12;
10155
+ return (v$1) => identity13;
10092
10156
  }
10093
10157
  if (v) {
10094
10158
  return (x) => assertWith(v1)(x());
@@ -10135,7 +10199,7 @@ function intersectionWith_Object(f) {
10135
10199
  }
10136
10200
 
10137
10201
  // output-es/Util.Map/index.js
10138
- var identity13 = (x) => x;
10202
+ var identity14 = (x) => x;
10139
10203
  var mapObjectString = {
10140
10204
  maplet: singleton2,
10141
10205
  keys: /* @__PURE__ */ (() => {
@@ -10170,9 +10234,9 @@ var mapFObjectString = {
10170
10234
  mapWithKey
10171
10235
  };
10172
10236
  var asMaplet = (dictMap) => {
10173
- const toUnfoldable16 = dictMap.toUnfoldable(unfoldableList);
10237
+ const toUnfoldable15 = dictMap.toUnfoldable(unfoldableList);
10174
10238
  return (m) => assertWith("")(dictMap.Set0().size(m) === 1)(definitely("singleton map")((() => {
10175
- const $0 = toUnfoldable16(m);
10239
+ const $0 = toUnfoldable15(m);
10176
10240
  if ($0.tag === "Nil") {
10177
10241
  return Nothing;
10178
10242
  }
@@ -10287,7 +10351,7 @@ var checkArity = (dictMonadError) => {
10287
10351
  };
10288
10352
 
10289
10353
  // output-es/Dict/index.js
10290
- var identity14 = (x) => x;
10354
+ var identity15 = (x) => x;
10291
10355
  var isEmptyDict = { isEmpty: (v) => isEmpty2(v) };
10292
10356
  var setDictString = {
10293
10357
  empty,
@@ -10340,7 +10404,7 @@ var traversableDict = {
10340
10404
  const $0 = traversableWithIndexObject.traverseWithIndex(dictApplicative);
10341
10405
  return (f) => (m) => dictApplicative.Apply0().Functor0().map((v1) => v1)($0((v) => f)(m));
10342
10406
  },
10343
- sequence: (dictApplicative) => (v) => traversableDict.traverse(dictApplicative)(identity14)(v),
10407
+ sequence: (dictApplicative) => (v) => traversableDict.traverse(dictApplicative)(identity15)(v),
10344
10408
  Functor0: () => functorDict,
10345
10409
  Foldable1: () => foldableDict
10346
10410
  };
@@ -10464,9 +10528,9 @@ var toTuple = (v) => $Tuple(v._1, v._2);
10464
10528
  var unzip3 = (xys) => unzip(listMap(toTuple)(xys));
10465
10529
 
10466
10530
  // output-es/Lattice/index.js
10467
- var identity15 = (x) => x;
10468
- var meetSemilatticeUnit = { meet: (v) => identity15 };
10469
- var joinSemilatticeUnit = { join: (v) => identity15 };
10531
+ var identity16 = (x) => x;
10532
+ var meetSemilatticeUnit = { meet: (v) => identity16 };
10533
+ var joinSemilatticeUnit = { join: (v) => identity16 };
10470
10534
  var boundedMeetSemilatticeUni = { top: void 0, MeetSemilattice0: () => meetSemilatticeUnit };
10471
10535
  var boundedJoinSemilatticeUni = { bot: void 0, JoinSemilattice0: () => joinSemilatticeUnit };
10472
10536
 
@@ -10494,7 +10558,7 @@ var unions = /* @__PURE__ */ (() => {
10494
10558
  };
10495
10559
  return go(Leaf2);
10496
10560
  })();
10497
- var identity16 = (x) => x;
10561
+ var identity17 = (x) => x;
10498
10562
  var Unquote = (value0) => $DocCommentElem("Unquote", value0);
10499
10563
  var None = /* @__PURE__ */ $DocOpt("None");
10500
10564
  var Doc = (value0) => $DocOpt("Doc", value0);
@@ -10701,18 +10765,18 @@ var traversableDocCommentElem = (dictTraversable) => {
10701
10765
  };
10702
10766
  return {
10703
10767
  traverse: (dictApplicative) => {
10704
- const traverse2 = dictTraversable.traverse(dictApplicative);
10768
+ const traverse22 = dictTraversable.traverse(dictApplicative);
10705
10769
  return (f) => (m) => {
10706
10770
  if (m.tag === "Token") {
10707
10771
  return dictApplicative.pure($DocCommentElem("Token", m._1));
10708
10772
  }
10709
10773
  if (m.tag === "Unquote") {
10710
- return dictApplicative.Apply0().Functor0().map((v1) => $DocCommentElem("Unquote", v1))(traverse2(f)(m._1));
10774
+ return dictApplicative.Apply0().Functor0().map((v1) => $DocCommentElem("Unquote", v1))(traverse22(f)(m._1));
10711
10775
  }
10712
10776
  fail();
10713
10777
  };
10714
10778
  },
10715
- sequence: (dictApplicative) => (v) => traversableDocCommentElem(dictTraversable).traverse(dictApplicative)(identity16)(v),
10779
+ sequence: (dictApplicative) => (v) => traversableDocCommentElem(dictTraversable).traverse(dictApplicative)(identity17)(v),
10716
10780
  Functor0: () => functorDocCommentElem1,
10717
10781
  Foldable1: () => foldableDocCommentElem1
10718
10782
  };
@@ -10722,19 +10786,19 @@ var traversableDocOpt = (dictTraversable) => {
10722
10786
  const foldableDocOpt1 = foldableDocOpt(dictTraversable.Foldable1());
10723
10787
  return {
10724
10788
  traverse: (dictApplicative) => {
10725
- const traverse2 = traversableList.traverse(dictApplicative);
10789
+ const traverse22 = traversableList.traverse(dictApplicative);
10726
10790
  const traverse3 = traversableDocCommentElem(dictTraversable).traverse(dictApplicative);
10727
10791
  return (f) => (m) => {
10728
10792
  if (m.tag === "None") {
10729
10793
  return dictApplicative.pure(None);
10730
10794
  }
10731
10795
  if (m.tag === "Doc") {
10732
- return dictApplicative.Apply0().Functor0().map((v1) => $DocOpt("Doc", v1))(traverse2(traverse3(f))(m._1));
10796
+ return dictApplicative.Apply0().Functor0().map((v1) => $DocOpt("Doc", v1))(traverse22(traverse3(f))(m._1));
10733
10797
  }
10734
10798
  fail();
10735
10799
  };
10736
10800
  },
10737
- sequence: (dictApplicative) => (v) => traversableDocOpt(dictTraversable).traverse(dictApplicative)(identity16)(v),
10801
+ sequence: (dictApplicative) => (v) => traversableDocOpt(dictTraversable).traverse(dictApplicative)(identity17)(v),
10738
10802
  Functor0: () => functorDocOpt1,
10739
10803
  Foldable1: () => foldableDocOpt1
10740
10804
  };
@@ -10768,7 +10832,7 @@ var unions12 = /* @__PURE__ */ (() => {
10768
10832
  };
10769
10833
  return go(Leaf2);
10770
10834
  })();
10771
- var identity17 = (x) => x;
10835
+ var identity18 = (x) => x;
10772
10836
  var setSet2 = /* @__PURE__ */ setSet(ordString);
10773
10837
  var fromFoldable5 = /* @__PURE__ */ (() => foldableSet.foldl((m) => (a) => insert(ordString)(a)()(m))(Leaf2))();
10774
10838
  var unions3 = /* @__PURE__ */ (() => {
@@ -11279,7 +11343,7 @@ var traversableVarDef = {
11279
11343
  const Apply0 = dictApplicative.Apply0();
11280
11344
  return (f) => (m) => Apply0.apply(Apply0.Functor0().map((v2) => (v3) => $VarDef(v2, v3))(traversableElim.traverse(dictApplicative)(f)(m._1)))(traversableExpr.traverse(dictApplicative)(f)(m._2));
11281
11345
  },
11282
- sequence: (dictApplicative) => (v) => traversableVarDef.traverse(dictApplicative)(identity17)(v),
11346
+ sequence: (dictApplicative) => (v) => traversableVarDef.traverse(dictApplicative)(identity18)(v),
11283
11347
  Functor0: () => functorVarDef,
11284
11348
  Foldable1: () => foldableVarDef
11285
11349
  };
@@ -11289,7 +11353,7 @@ var traversableRecDefs = {
11289
11353
  const traverse5 = traversableDict.traverse(dictApplicative);
11290
11354
  return (f) => (m) => Apply0.apply(Apply0.Functor0().map((v2) => (v3) => $RecDefs(v2, v3))(f(m._1)))(traverse5(traversableElim.traverse(dictApplicative)(f))(m._2));
11291
11355
  },
11292
- sequence: (dictApplicative) => (v) => traversableRecDefs.traverse(dictApplicative)(identity17)(v),
11356
+ sequence: (dictApplicative) => (v) => traversableRecDefs.traverse(dictApplicative)(identity18)(v),
11293
11357
  Functor0: () => functorRecDefs,
11294
11358
  Foldable1: () => foldableRecDefs
11295
11359
  };
@@ -11351,7 +11415,7 @@ var traversableExpr = {
11351
11415
  fail();
11352
11416
  };
11353
11417
  },
11354
- sequence: (dictApplicative) => (v) => traversableExpr.traverse(dictApplicative)(identity17)(v),
11418
+ sequence: (dictApplicative) => (v) => traversableExpr.traverse(dictApplicative)(identity18)(v),
11355
11419
  Functor0: () => functorExpr,
11356
11420
  Foldable1: () => foldableExpr
11357
11421
  };
@@ -11374,7 +11438,7 @@ var traversableElim = {
11374
11438
  fail();
11375
11439
  };
11376
11440
  },
11377
- sequence: (dictApplicative) => (v) => traversableElim.traverse(dictApplicative)(identity17)(v),
11441
+ sequence: (dictApplicative) => (v) => traversableElim.traverse(dictApplicative)(identity18)(v),
11378
11442
  Functor0: () => functorElim,
11379
11443
  Foldable1: () => foldableElim
11380
11444
  };
@@ -11391,7 +11455,7 @@ var traversableCont = {
11391
11455
  fail();
11392
11456
  };
11393
11457
  },
11394
- sequence: (dictApplicative) => (v) => traversableCont.traverse(dictApplicative)(identity17)(v),
11458
+ sequence: (dictApplicative) => (v) => traversableCont.traverse(dictApplicative)(identity18)(v),
11395
11459
  Functor0: () => functorCont,
11396
11460
  Foldable1: () => foldableCont
11397
11461
  };
@@ -12251,7 +12315,7 @@ var bwdSlice = (dictGraph) => {
12251
12315
  };
12252
12316
 
12253
12317
  // output-es/Data.Profunctor.Choice/index.js
12254
- var identity18 = (x) => x;
12318
+ var identity19 = (x) => x;
12255
12319
  var fanin = (dictCategory) => {
12256
12320
  const identity1 = dictCategory.identity;
12257
12321
  const $0 = dictCategory.Semigroupoid0();
@@ -12264,7 +12328,7 @@ var fanin = (dictCategory) => {
12264
12328
  return v2._1;
12265
12329
  }
12266
12330
  fail();
12267
- })(identity18)(identity1))($1.compose(dictChoice.right(r))(dictChoice.left(l)));
12331
+ })(identity19)(identity1))($1.compose(dictChoice.right(r))(dictChoice.left(l)));
12268
12332
  };
12269
12333
  var choiceFn = /* @__PURE__ */ (() => ({
12270
12334
  left: (v) => (v1) => {
@@ -12908,7 +12972,7 @@ var between = (open2) => (close2) => (p) => (state1, more, lift12, $$throw2, don
12908
12972
  var $Assoc = (tag) => tag;
12909
12973
  var $Operator = (tag, _1, _2) => ({ tag, _1, _2 });
12910
12974
  var choice2 = /* @__PURE__ */ choice(foldableList);
12911
- var identity19 = (x) => x;
12975
+ var identity20 = (x) => x;
12912
12976
  var AssocNone = /* @__PURE__ */ $Assoc("AssocNone");
12913
12977
  var AssocLeft = /* @__PURE__ */ $Assoc("AssocLeft");
12914
12978
  var AssocRight = /* @__PURE__ */ $Assoc("AssocRight");
@@ -13089,7 +13153,7 @@ var makeParser = (term) => (ops) => {
13089
13153
  if ($7) {
13090
13154
  return $22(v4, $6);
13091
13155
  }
13092
- return $32(v2$1, identity19);
13156
+ return $32(v2$1, identity20);
13093
13157
  });
13094
13158
  },
13095
13159
  $32
@@ -13107,7 +13171,7 @@ var makeParser = (term) => (ops) => {
13107
13171
  if ($7) {
13108
13172
  return $22(v4, $6);
13109
13173
  }
13110
- return $32(v2$1, identity19);
13174
+ return $32(v2$1, identity20);
13111
13175
  });
13112
13176
  },
13113
13177
  $32
@@ -13126,7 +13190,7 @@ var makeParser = (term) => (ops) => {
13126
13190
  if ($8) {
13127
13191
  return $32(v4, $7);
13128
13192
  }
13129
- return $42(v2$1, identity19);
13193
+ return $42(v2$1, identity20);
13130
13194
  });
13131
13195
  },
13132
13196
  $42
@@ -13144,7 +13208,7 @@ var makeParser = (term) => (ops) => {
13144
13208
  if ($8) {
13145
13209
  return $32(v4, $7);
13146
13210
  }
13147
- return $42(v2$1, identity19);
13211
+ return $42(v2$1, identity20);
13148
13212
  });
13149
13213
  },
13150
13214
  $42
@@ -13163,7 +13227,7 @@ var makeParser = (term) => (ops) => {
13163
13227
  if ($9) {
13164
13228
  return $42(v4, $8);
13165
13229
  }
13166
- return $52(v2$1, identity19);
13230
+ return $52(v2$1, identity20);
13167
13231
  });
13168
13232
  },
13169
13233
  $52
@@ -13181,7 +13245,7 @@ var makeParser = (term) => (ops) => {
13181
13245
  if ($9) {
13182
13246
  return $42(v4, $8);
13183
13247
  }
13184
- return $52(v2$1, identity19);
13248
+ return $52(v2$1, identity20);
13185
13249
  });
13186
13250
  },
13187
13251
  $52
@@ -13276,7 +13340,7 @@ var makeParser = (term) => (ops) => {
13276
13340
  if ($5) {
13277
13341
  return $$throw2(v4, $4);
13278
13342
  }
13279
- return $1(state1, identity19);
13343
+ return $1(state1, identity20);
13280
13344
  });
13281
13345
  },
13282
13346
  $1
@@ -15851,13 +15915,13 @@ var varDefFwd = (dictMonadError) => {
15851
15915
  };
15852
15916
  var recDefsFwd = (dictMonadError) => {
15853
15917
  const Monad0 = dictMonadError.MonadThrow0().Monad0();
15854
- const traverse2 = traversableNonEmptyList.traverse(Monad0.Applicative0());
15918
+ const traverse22 = traversableNonEmptyList.traverse(Monad0.Applicative0());
15855
15919
  return (dictBoundedLattice) => {
15856
15920
  const top = dictBoundedLattice.BoundedMeetSemilattice1().top;
15857
15921
  return (xcs) => Monad0.Bind1().Apply0().Functor0().map((() => {
15858
15922
  const $0 = RecDefs(top);
15859
15923
  return (x) => $0(fromFoldable16(x));
15860
- })())(traverse2(recDefFwd(dictMonadError)(dictBoundedLattice))((() => {
15924
+ })())(traverse22(recDefFwd(dictMonadError)(dictBoundedLattice))((() => {
15861
15925
  const $0 = wrappedOperation("groupBy")(groupBy2((x) => (y) => x._1 === y._1))(xcs);
15862
15926
  return $NonEmpty($0._1, listMap(RecDef)($0._2));
15863
15927
  })()));
@@ -16059,7 +16123,7 @@ var exprFwd = (dictBoundedLattice) => {
16059
16123
  const Bind1 = Monad0.Bind1();
16060
16124
  const Apply0 = Bind1.Apply0();
16061
16125
  const Functor0 = Apply0.Functor0();
16062
- const traverse2 = traversableList.traverse(Applicative0);
16126
+ const traverse22 = traversableList.traverse(Applicative0);
16063
16127
  return (dictJoinSemilattice) => (v) => {
16064
16128
  if (v.tag === "Var") {
16065
16129
  return Applicative0.pure($Expr("Var", v._1));
@@ -16086,14 +16150,14 @@ var exprFwd = (dictBoundedLattice) => {
16086
16150
  const $0 = v._3;
16087
16151
  const $1 = v._4;
16088
16152
  const $2 = v._1;
16089
- return Bind1.bind(desugComment(dictBoundedLattice)(dictMonadError)(v._2))((edoc) => Functor0.map(Constr($2)(edoc)($0))(traverse2(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0()))($1)));
16153
+ return Bind1.bind(desugComment(dictBoundedLattice)(dictMonadError)(v._2))((edoc) => Functor0.map(Constr($2)(edoc)($0))(traverse22(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0()))($1)));
16090
16154
  }
16091
16155
  if (v.tag === "Dictionary") {
16092
16156
  const $0 = v._2;
16093
16157
  const $1 = v._1;
16094
16158
  const v1 = unzip(v._3);
16095
16159
  const $2 = v1._2;
16096
- return Bind1.bind(traverse2(desugarableDictEntryExpr.desug(dictMonadError)(dictBoundedLattice))(v1._1))((ks$p) => Bind1.bind(traverse2(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0()))($2))((es) => Bind1.bind(desugComment(dictBoundedLattice)(dictMonadError)($0))((edoc) => Functor0.map(Dictionary($1)(edoc))(Applicative0.pure(zipWith2((k) => (v2) => $Pair(
16160
+ return Bind1.bind(traverse22(desugarableDictEntryExpr.desug(dictMonadError)(dictBoundedLattice))(v1._1))((ks$p) => Bind1.bind(traverse22(exprFwd(dictBoundedLattice)(dictMonadError)(dictBoundedLattice.BoundedJoinSemilattice0().JoinSemilattice0()))($2))((es) => Bind1.bind(desugComment(dictBoundedLattice)(dictMonadError)($0))((edoc) => Functor0.map(Dictionary($1)(edoc))(Applicative0.pure(zipWith2((k) => (v2) => $Pair(
16097
16161
  k,
16098
16162
  v2
16099
16163
  ))(ks$p)(es))))));
@@ -16628,11 +16692,11 @@ var moduleFwd = (dictMonadError) => {
16628
16692
  const $0 = Monad0.Bind1().Apply0().Functor0();
16629
16693
  const varDefFwd1 = varDefFwd(dictMonadError);
16630
16694
  const recDefsFwd1 = recDefsFwd(dictMonadError);
16631
- const traverse2 = traversableList.traverse(Monad0.Applicative0());
16695
+ const traverse22 = traversableList.traverse(Monad0.Applicative0());
16632
16696
  return (dictBoundedLattice) => {
16633
16697
  const varDefFwd2 = varDefFwd1(dictBoundedLattice);
16634
16698
  const recDefsFwd2 = recDefsFwd1(dictBoundedLattice);
16635
- return (v) => $0.map(Module)(traverse2((v1) => {
16699
+ return (v) => $0.map(Module)(traverse22((v1) => {
16636
16700
  if (v1.tag === "Left") {
16637
16701
  return $0.map(Left)(varDefFwd2(v1._1));
16638
16702
  }
@@ -16729,7 +16793,7 @@ var toUnfoldable13 = /* @__PURE__ */ toAscUnfoldable(unfoldableList);
16729
16793
  var Simple = /* @__PURE__ */ $ExprType("Simple");
16730
16794
  var Expression = /* @__PURE__ */ $ExprType("Expression");
16731
16795
  var vert = (dictFoldable) => {
16732
- const fromFoldable27 = dictFoldable.foldr(Cons)(Nil);
16796
+ const fromFoldable26 = dictFoldable.foldr(Cons)(Nil);
16733
16797
  return (delim) => {
16734
16798
  const vert$p = (v) => {
16735
16799
  if (v.tag === "Nil") {
@@ -16745,7 +16809,7 @@ var vert = (dictFoldable) => {
16745
16809
  }
16746
16810
  fail();
16747
16811
  };
16748
- return (x) => vert$p(fromFoldable27(x));
16812
+ return (x) => vert$p(fromFoldable26(x));
16749
16813
  };
16750
16814
  };
16751
16815
  var vert1 = /* @__PURE__ */ vert(foldableArray);
@@ -17474,7 +17538,7 @@ var unions13 = /* @__PURE__ */ (() => {
17474
17538
  return go(Leaf2);
17475
17539
  })();
17476
17540
  var foldMap2 = /* @__PURE__ */ foldMap({ mempty: Leaf2, Semigroup0: () => ({ append: union(ordDVertex$p) }) });
17477
- var identity22 = (x) => x;
17541
+ var identity23 = (x) => x;
17478
17542
  var boundedLattice = { BoundedJoinSemilattice0: () => boundedJoinSemilatticeUni, BoundedMeetSemilattice1: () => boundedMeetSemilatticeUni };
17479
17543
  var setSet1 = /* @__PURE__ */ setSet(ordString);
17480
17544
  var toUnfoldable14 = /* @__PURE__ */ toUnfoldable4(unfoldableList);
@@ -17600,7 +17664,7 @@ var mapEnvStringVal = {
17600
17664
  var highlightableVertex = {
17601
17665
  highlightIf: (v) => (doc) => beside(beside(doc)(checkOneLine(split("\n")(" _"))))(checkOneLine(split("\n")(" \u27E8" + v + "\u27E9")))
17602
17666
  };
17603
- var highlightableUnit = { highlightIf: (v) => identity22 };
17667
+ var highlightableUnit = { highlightIf: (v) => identity23 };
17604
17668
  var functorMatrixDim = { map: (f) => (m) => $Tuple(m._1, f(m._2)) };
17605
17669
  var functorVal = { map: (f) => (m) => $Val(f(m._1), functorDocOpt(functorVal).map(f)(m._2), functorBaseVal.map(f)(m._3)) };
17606
17670
  var functorMatrixRep = {
@@ -17654,7 +17718,7 @@ var functorBaseVal = {
17654
17718
  var foldableMatrixDim = { foldl: (f) => (z) => (m) => f(z)(m._2), foldr: (f) => (z) => (m) => f(m._2)(z), foldMap: (dictMonoid) => (f) => (m) => f(m._2) };
17655
17719
  var traversableMatrixDim = {
17656
17720
  traverse: (dictApplicative) => (f) => (m) => dictApplicative.Apply0().Functor0().map((v1) => v1)(traversableTuple.traverse(dictApplicative)(f)(m)),
17657
- sequence: (dictApplicative) => (v) => traversableMatrixDim.traverse(dictApplicative)(identity22)(v),
17721
+ sequence: (dictApplicative) => (v) => traversableMatrixDim.traverse(dictApplicative)(identity23)(v),
17658
17722
  Functor0: () => functorMatrixDim,
17659
17723
  Foldable1: () => foldableMatrixDim
17660
17724
  };
@@ -17871,7 +17935,7 @@ var traversableVal = {
17871
17935
  const Apply0 = dictApplicative.Apply0();
17872
17936
  return (f) => (m) => Apply0.apply(Apply0.apply(Apply0.Functor0().map((v3) => (v4) => (v5) => $Val(v3, v4, v5))(f(m._1)))(traversableDocOpt(traversableVal).traverse(dictApplicative)(f)(m._2)))(traversableBaseVal.traverse(dictApplicative)(f)(m._3));
17873
17937
  },
17874
- sequence: (dictApplicative) => (v) => traversableVal.traverse(dictApplicative)(identity22)(v),
17938
+ sequence: (dictApplicative) => (v) => traversableVal.traverse(dictApplicative)(identity23)(v),
17875
17939
  Functor0: () => functorVal,
17876
17940
  Foldable1: () => foldableVal
17877
17941
  };
@@ -17907,7 +17971,7 @@ var traversableFun = {
17907
17971
  fail();
17908
17972
  };
17909
17973
  },
17910
- sequence: (dictApplicative) => (v) => traversableFun.traverse(dictApplicative)(identity22)(v),
17974
+ sequence: (dictApplicative) => (v) => traversableFun.traverse(dictApplicative)(identity23)(v),
17911
17975
  Functor0: () => functorFun,
17912
17976
  Foldable1: () => foldableFun
17913
17977
  };
@@ -17916,7 +17980,7 @@ var traversableEnv = {
17916
17980
  const traverse8 = traversableDict.traverse(dictApplicative);
17917
17981
  return (f) => (m) => dictApplicative.Apply0().Functor0().map((v1) => v1)(traverse8(traversableVal.traverse(dictApplicative)(f))(m));
17918
17982
  },
17919
- sequence: (dictApplicative) => (v) => traversableEnv.traverse(dictApplicative)(identity22)(v),
17983
+ sequence: (dictApplicative) => (v) => traversableEnv.traverse(dictApplicative)(identity23)(v),
17920
17984
  Functor0: () => functorEnv,
17921
17985
  Foldable1: () => foldableEnv
17922
17986
  };
@@ -17960,7 +18024,7 @@ var traversableBaseVal = {
17960
18024
  fail();
17961
18025
  };
17962
18026
  },
17963
- sequence: (dictApplicative) => (v) => traversableBaseVal.traverse(dictApplicative)(identity22)(v),
18027
+ sequence: (dictApplicative) => (v) => traversableBaseVal.traverse(dictApplicative)(identity23)(v),
17964
18028
  Functor0: () => functorBaseVal,
17965
18029
  Foldable1: () => foldableBaseVal
17966
18030
  };
@@ -18038,7 +18102,7 @@ var unary = (dictBoundedJoinSemilattice) => {
18038
18102
  arity: 1,
18039
18103
  op: (dictMonadWithGraphAlloc) => {
18040
18104
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18041
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
18105
+ return (dictMonadError) => (dictMonadReader) => (dictLoadFile) => (v) => {
18042
18106
  if (v.tag === "Cons" && v._2.tag === "Nil") {
18043
18107
  const $0 = v._1._2;
18044
18108
  return $$new((a) => Val(a)($0))($$$Map("Two", Leaf2, v._1._1, void 0, Leaf2))(f.o.pack(f.fwd(f.i.unpack(v._1._3))));
@@ -18187,7 +18251,7 @@ var binaryZero = (dictBoundedJoinSemilattice) => {
18187
18251
  arity: 2,
18188
18252
  op: (dictMonadWithGraphAlloc) => {
18189
18253
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18190
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
18254
+ return (dictMonadError) => (dictMonadReader) => (dictLoadFile) => (v) => {
18191
18255
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
18192
18256
  const $0 = f.i.unpack(v._1._3);
18193
18257
  const $1 = f.i.unpack(v._2._1._3);
@@ -18235,7 +18299,7 @@ var binary = (dictBoundedJoinSemilattice) => {
18235
18299
  arity: 2,
18236
18300
  op: (dictMonadWithGraphAlloc) => {
18237
18301
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18238
- return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
18302
+ return (dictMonadError) => (dictMonadReader) => (dictLoadFile) => (v) => {
18239
18303
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
18240
18304
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
18241
18305
  "Two",
@@ -18299,6 +18363,7 @@ var greaterThanOrEq = /* @__PURE__ */ (() => {
18299
18363
  return (a1) => (a2) => $0.compare(a1)(a2) !== "LT";
18300
18364
  })();
18301
18365
  var show3 = (v) => "(Tuple " + showIntImpl(v._1) + " " + showIntImpl(v._2) + ")";
18366
+ var traverse2 = /* @__PURE__ */ (() => traversableList.traverse(applicativeMaybe))();
18302
18367
  var concatM = (dictMonad) => foldableList.foldr((() => {
18303
18368
  const $0 = dictMonad.Bind1();
18304
18369
  return (f) => (g) => (a) => $0.bind(f(a))(g);
@@ -18412,9 +18477,9 @@ var match = (dictMonadWithGraphAlloc) => {
18412
18477
  };
18413
18478
  var closeDefs = (dictMonadWithGraphAlloc) => {
18414
18479
  const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18415
- const traverse2 = traversableDict.traverse(Monad0.Applicative0());
18480
+ const traverse2$1 = traversableDict.traverse(Monad0.Applicative0());
18416
18481
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18417
- return (\u03B3) => (\u03C1) => (\u03B1s) => Monad0.Bind1().Apply0().Functor0().map(Env)(traverse2((\u03C3) => {
18482
+ return (\u03B3) => (\u03C1) => (\u03B1s) => Monad0.Bind1().Apply0().Functor0().map(Env)(traverse2$1((\u03C3) => {
18418
18483
  const \u03C1$p = forDefs(\u03C1)(\u03C3);
18419
18484
  return $$new((a) => Val(a)(None))(\u03B1s)($BaseVal(
18420
18485
  "Fun",
@@ -18436,14 +18501,14 @@ var closeDefs = (dictMonadWithGraphAlloc) => {
18436
18501
  var new$p = (dictMonadWithGraphAlloc) => {
18437
18502
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18438
18503
  const fresh = dictMonadWithGraphAlloc.MonadAlloc0().fresh;
18439
- return (dictMonadReader) => (dictMonadAff) => {
18440
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18504
+ return (dictMonadReader) => {
18505
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18441
18506
  const Bind1 = Monad0.Bind1();
18442
18507
  return (dictLoadFile) => (v) => (v1) => (v2) => (v3) => {
18443
18508
  if (v2.tag === "None") {
18444
18509
  return $$new((\u03B1s$p) => (u$p) => $Val(\u03B1s$p, None, u$p))(v1)(v3);
18445
18510
  }
18446
- return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18511
+ return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(v)((() => {
18447
18512
  const $0 = {};
18448
18513
  $0.this = $Val(\u03B1, None, v3);
18449
18514
  return $0;
@@ -18455,8 +18520,8 @@ var new$p = (dictMonadWithGraphAlloc) => {
18455
18520
  };
18456
18521
  };
18457
18522
  };
18458
- var evalDocOpt = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
18459
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18523
+ var evalDocOpt = (dictMonadWithGraphAlloc) => (dictMonadReader) => {
18524
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18460
18525
  const Applicative0 = Monad0.Applicative0();
18461
18526
  const $0 = Monad0.Bind1().Apply0().Functor0();
18462
18527
  const sequence2 = traversableList.traverse(Applicative0)(identity5);
@@ -18470,7 +18535,7 @@ var evalDocOpt = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff
18470
18535
  return Applicative0.pure($DocCommentElem("Token", v2._1));
18471
18536
  }
18472
18537
  if (v2.tag === "Unquote") {
18473
- return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v2._1)(setSet4.empty));
18538
+ return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v2._1)(setSet4.empty));
18474
18539
  }
18475
18540
  fail();
18476
18541
  })(v1._1)));
@@ -18486,13 +18551,13 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18486
18551
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18487
18552
  const match1 = match(dictMonadWithGraphAlloc);
18488
18553
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
18489
- return (dictMonadReader) => (dictMonadAff) => {
18490
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18554
+ return (dictMonadReader) => {
18555
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18491
18556
  const Bind1 = Monad0.Bind1();
18492
18557
  const $0 = Bind1.Apply0().Functor0();
18493
18558
  const Applicative0 = Monad0.Applicative0();
18494
- const traverse2 = traversableList.traverse(Applicative0);
18495
- const traverse3 = traversablePair.traverse(Applicative0);
18559
+ const traverse3 = traversableList.traverse(Applicative0);
18560
+ const traverse4 = traversablePair.traverse(Applicative0);
18496
18561
  const sequence2 = traversableArray.traverse(Applicative0)(identity4);
18497
18562
  return (dictLoadFile) => (v) => (v1) => (v2) => {
18498
18563
  if (v1.tag === "Var") {
@@ -18502,32 +18567,23 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18502
18567
  return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
18503
18568
  }
18504
18569
  if (v1.tag === "Int") {
18505
- return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
18506
- "Int",
18507
- v1._3
18508
- ));
18570
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Int", v1._3));
18509
18571
  }
18510
18572
  if (v1.tag === "Float") {
18511
- return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
18512
- "Float",
18513
- v1._3
18514
- ));
18573
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Float", v1._3));
18515
18574
  }
18516
18575
  if (v1.tag === "Str") {
18517
- return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
18518
- "Str",
18519
- v1._3
18520
- ));
18576
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Str", v1._3));
18521
18577
  }
18522
18578
  if (v1.tag === "Dictionary") {
18523
18579
  const $1 = v1._2;
18524
18580
  const $2 = v1._1;
18525
- return Bind1.bind($0.map(unzip3)(traverse2(traverse3((() => {
18526
- const $3 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
18581
+ return Bind1.bind($0.map(unzip3)(traverse3(traverse4((() => {
18582
+ const $3 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v);
18527
18583
  return (a) => $3(a)(v2);
18528
18584
  })()))(v1._3)))((v3) => {
18529
18585
  const v4 = unzip(listMap((v$1) => $Tuple(v$1._3.tag === "Str" ? v$1._3._1 : typeError(v$1._3)("Str"), v$1._1))(v3._1));
18530
- return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)($2)()(v2))($1)($BaseVal(
18586
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)($2)()(v2))($1)($BaseVal(
18531
18587
  "Dictionary",
18532
18588
  fromFoldable17(zipWith2(Tuple)(v4._1)(zipWith2(Tuple)(v4._2)(v3._2)))
18533
18589
  ));
@@ -18558,14 +18614,10 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18558
18614
  return go$r;
18559
18615
  };
18560
18616
  return go(0)($3);
18561
- })()))(() => Bind1.bind(traverse2((() => {
18562
- const $5 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
18617
+ })()))(() => Bind1.bind(traverse3((() => {
18618
+ const $5 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v);
18563
18619
  return (a) => $5(a)(v2);
18564
- })())($3))((vs) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)($4)()(v2))($2)($BaseVal(
18565
- "Constr",
18566
- $1,
18567
- vs
18568
- ))));
18620
+ })())($3))((vs) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)($4)()(v2))($2)($BaseVal("Constr", $1, vs))));
18569
18621
  }
18570
18622
  if (v1.tag === "Matrix") {
18571
18623
  const $1 = v1._2;
@@ -18573,7 +18625,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18573
18625
  const $3 = v1._4._1;
18574
18626
  const $4 = v1._4._2;
18575
18627
  const $5 = v1._1;
18576
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
18628
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
18577
18629
  const v5 = intPair.unpack(v3._3);
18578
18630
  const $6 = v5._1._1;
18579
18631
  const $7 = v5._2._1;
@@ -18584,7 +18636,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18584
18636
  1
18585
18637
  )) + "); got (" + show3($Tuple($6, $7)) + ")"))(() => Bind1.bind(sequence2(arrayBind(range(1)($6))((i) => [
18586
18638
  sequence2(arrayBind(range(1)($7))((j) => [
18587
- $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(disjointUnion2((() => {
18639
+ $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(v)(disjointUnion2((() => {
18588
18640
  const $10 = {};
18589
18641
  $10[$3] = $Val($8, None, $BaseVal("Int", i));
18590
18642
  return $10;
@@ -18594,7 +18646,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18594
18646
  return $10;
18595
18647
  })())))($2)(v2)
18596
18648
  ]))
18597
- ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)($5)()(v2))($1)($BaseVal(
18649
+ ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(insert(ordVertex)($5)()(v2))($1)($BaseVal(
18598
18650
  "Matrix",
18599
18651
  $Tuple(vss, $Tuple($Tuple($6, $8), $Tuple($7, $9)))
18600
18652
  ))));
@@ -18620,7 +18672,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18620
18672
  if (v1.tag === "Project") {
18621
18673
  const $1 = v1._1;
18622
18674
  const $2 = v1._3;
18623
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
18675
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
18624
18676
  if (v3._3.tag === "Dictionary") {
18625
18677
  return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $2 + '" not found')((() => {
18626
18678
  const $3 = _lookup(Nothing, Just, $2, v3._3._1);
@@ -18628,7 +18680,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18628
18680
  return $Maybe("Just", $3._1._2);
18629
18681
  }
18630
18682
  return Nothing;
18631
- })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p)($1));
18683
+ })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v$p)($1));
18632
18684
  }
18633
18685
  return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dictionary"));
18634
18686
  });
@@ -18636,7 +18688,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18636
18688
  if (v1.tag === "DProject") {
18637
18689
  const $1 = v1._1;
18638
18690
  const $2 = v1._3;
18639
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)($2)(v2))((v$p) => {
18691
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)($2)(v2))((v$p) => {
18640
18692
  if (v3._3.tag === "Dictionary") {
18641
18693
  if (v$p._3.tag === "Str") {
18642
18694
  return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
@@ -18645,7 +18697,7 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18645
18697
  return $Maybe("Just", $3._1._2);
18646
18698
  }
18647
18699
  return Nothing;
18648
- })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p$p)($1));
18700
+ })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v$p$p)($1));
18649
18701
  }
18650
18702
  return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v$p)).lines) + ", expected string"));
18651
18703
  }
@@ -18655,10 +18707,10 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18655
18707
  if (v1.tag === "App") {
18656
18708
  const $1 = v1._1;
18657
18709
  const $2 = v1._3;
18658
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)($2)(v2))((v$p) => Bind1.bind(apply2(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v3)(v$p))((v4) => {
18710
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)($2)(v2))((v$p) => Bind1.bind(apply2(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v3)(v$p))((v4) => {
18659
18711
  const $3 = v4._3;
18660
18712
  const $4 = v4._1;
18661
- return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18713
+ return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(v)((() => {
18662
18714
  const $5 = {};
18663
18715
  $5.this = v4;
18664
18716
  return $5;
@@ -18668,24 +18720,24 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18668
18720
  if (v1.tag === "Let") {
18669
18721
  const $1 = v1._2;
18670
18722
  const $2 = v1._1._1;
18671
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._1._2)(v2))((v3) => Bind1.bind(match1(v3)($2))((v4) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(v4._1))($1)(v4._2._2)));
18723
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(v)(v1._1._2)(v2))((v3) => Bind1.bind(match1(v3)($2))((v4) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(v)(v4._1))($1)(v4._2._2)));
18672
18724
  }
18673
18725
  if (v1.tag === "LetRec") {
18674
18726
  const $1 = v1._2;
18675
18727
  const $2 = v1._1._1;
18676
- return Bind1.bind(closeDefs1(v)(v1._1._2)(insert(ordVertex)($2)()(v2)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(\u03B3$p))($1)(insert(ordVertex)($2)()(v2)));
18728
+ return Bind1.bind(closeDefs1(v)(v1._1._2)(insert(ordVertex)($2)()(v2)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(v)(\u03B3$p))($1)(insert(ordVertex)($2)()(v2)));
18677
18729
  }
18678
18730
  fail();
18679
18731
  };
18680
18732
  };
18681
18733
  };
18682
- var concatDocs = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
18683
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18734
+ var concatDocs = (dictMonadWithGraphAlloc) => (dictMonadReader) => {
18735
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18684
18736
  return (dictLoadFile) => (\u03B3) => (v) => (doc) => {
18685
18737
  const $0 = v._3;
18686
18738
  const $1 = v._2;
18687
18739
  const $2 = v._1;
18688
- return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(\u03B3)((() => {
18740
+ return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(\u03B3)((() => {
18689
18741
  const $3 = {};
18690
18742
  $3.this = $Val($2, None, $0);
18691
18743
  return $3;
@@ -18698,8 +18750,8 @@ var apply2 = (dictMonadWithGraphAlloc) => {
18698
18750
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18699
18751
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
18700
18752
  const MonadThrow0 = MonadError1.MonadThrow0();
18701
- return (dictMonadReader) => (dictMonadAff) => {
18702
- const Bind1 = dictMonadAff.MonadEffect0().Monad0().Bind1();
18753
+ return (dictMonadReader) => {
18754
+ const Bind1 = dictMonadReader.MonadAsk0().Monad0().Bind1();
18703
18755
  return (dictLoadFile) => (v) => (v1) => {
18704
18756
  const $0 = (v2) => MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v2)).lines) + ", expected function"));
18705
18757
  if (v._3.tag === "Fun") {
@@ -18707,7 +18759,7 @@ var apply2 = (dictMonadWithGraphAlloc) => {
18707
18759
  const $1 = v._1;
18708
18760
  const $2 = v._3._1._1;
18709
18761
  const $3 = v._3._1._3;
18710
- return Bind1.bind(closeDefs1($2)(v._3._1._2)($$$Map("Two", Leaf2, $1, void 0, Leaf2)))((\u03B32) => Bind1.bind(match1(v1)($3))((v3) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(unionWith2((v$1) => identity13)($2)(\u03B32))(v3._1))(v3._2._1.tag === "ContExpr" ? v3._2._1._1 : throwException(error("Expression expected"))())(insert(ordVertex)($1)()(v3._2._2))));
18762
+ return Bind1.bind(closeDefs1($2)(v._3._1._2)($$$Map("Two", Leaf2, $1, void 0, Leaf2)))((\u03B32) => Bind1.bind(match1(v1)($3))((v3) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictLoadFile)(unionWith2((v$1) => identity14)(unionWith2((v$1) => identity14)($2)(\u03B32))(v3._1))(v3._2._1.tag === "ContExpr" ? v3._2._1._1 : throwException(error("Expression expected"))())(insert(ordVertex)($1)()(v3._2._2))));
18711
18763
  }
18712
18764
  if (v._3._1.tag === "Foreign") {
18713
18765
  const $1 = v._3._1._1._2;
@@ -18738,7 +18790,7 @@ var apply2 = (dictMonadWithGraphAlloc) => {
18738
18790
  $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
18739
18791
  ));
18740
18792
  }
18741
- return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadAff)(dictMonadReader)(dictLoadFile)(vs$p);
18793
+ return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadReader)(dictLoadFile)(vs$p);
18742
18794
  }
18743
18795
  if (v._3._1.tag === "PartialConstr") {
18744
18796
  const $1 = v._1;
@@ -18813,33 +18865,30 @@ var eval_module = (dictMonadWithGraphAlloc) => {
18813
18865
  const match1 = match(dictMonadWithGraphAlloc);
18814
18866
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
18815
18867
  return (dictMonadReader) => {
18868
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18869
+ const $0 = Monad0.Bind1();
18816
18870
  const eval2 = eval1(dictMonadReader);
18817
- return (dictMonadAff) => {
18818
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18819
- const $0 = Monad0.Bind1();
18820
- const eval3 = eval2(dictMonadAff);
18821
- return (dictLoadFile) => {
18822
- const eval4 = eval3(dictLoadFile);
18823
- return (\u03B3) => {
18824
- const go = (v) => (v1) => (v2) => {
18825
- if (v1.tag === "Nil") {
18826
- return Monad0.Applicative0().pure(v);
18871
+ return (dictLoadFile) => {
18872
+ const eval3 = eval2(dictLoadFile);
18873
+ return (\u03B3) => {
18874
+ const go = (v) => (v1) => (v2) => {
18875
+ if (v1.tag === "Nil") {
18876
+ return Monad0.Applicative0().pure(v);
18877
+ }
18878
+ if (v1.tag === "Cons") {
18879
+ if (v1._1.tag === "Left") {
18880
+ const $1 = v1._2;
18881
+ const $2 = v1._1._1._1;
18882
+ return $0.bind(eval3(unionWith2((v$1) => identity14)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith2((v$1) => identity14)(v)(v4._1))($1)(v4._2._2)));
18827
18883
  }
18828
- if (v1.tag === "Cons") {
18829
- if (v1._1.tag === "Left") {
18830
- const $1 = v1._2;
18831
- const $2 = v1._1._1._1;
18832
- return $0.bind(eval4(unionWith2((v$1) => identity13)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith2((v$1) => identity13)(v)(v4._1))($1)(v4._2._2)));
18833
- }
18834
- if (v1._1.tag === "Right") {
18835
- const $1 = v1._2;
18836
- return $0.bind(closeDefs1(unionWith2((v$1) => identity13)(\u03B3)(v))(v1._1._1._2)(insert(ordVertex)(v1._1._1._1)()(v2)))((\u03B3$p$p) => go(unionWith2((v$1) => identity13)(v)(\u03B3$p$p))($1)(v2));
18837
- }
18884
+ if (v1._1.tag === "Right") {
18885
+ const $1 = v1._2;
18886
+ return $0.bind(closeDefs1(unionWith2((v$1) => identity14)(\u03B3)(v))(v1._1._1._2)(insert(ordVertex)(v1._1._1._1)()(v2)))((\u03B3$p$p) => go(unionWith2((v$1) => identity14)(v)(\u03B3$p$p))($1)(v2));
18838
18887
  }
18839
- fail();
18840
- };
18841
- return go(empty);
18888
+ }
18889
+ fail();
18842
18890
  };
18891
+ return go(empty);
18843
18892
  };
18844
18893
  };
18845
18894
  };
@@ -18848,26 +18897,95 @@ var eval_progCxt = (dictMonadWithGraphAlloc) => {
18848
18897
  const eval_module1 = eval_module(dictMonadWithGraphAlloc);
18849
18898
  const eval1 = $$eval(dictMonadWithGraphAlloc);
18850
18899
  return (dictMonadReader) => {
18900
+ const Monad0 = dictMonadReader.MonadAsk0().Monad0();
18901
+ const $0 = Monad0.Bind1();
18851
18902
  const eval_module2 = eval_module1(dictMonadReader);
18903
+ const $1 = Monad0.Applicative0();
18852
18904
  const eval2 = eval1(dictMonadReader);
18853
- return (dictMonadAff) => {
18854
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18855
- const $0 = Monad0.Bind1();
18856
- const eval_module3 = eval_module2(dictMonadAff);
18857
- const $1 = Monad0.Applicative0();
18858
- const eval3 = eval2(dictMonadAff);
18859
- const concatM1 = concatM(Monad0);
18860
- return (dictLoadFile) => {
18861
- const eval_module4 = eval_module3(dictLoadFile);
18862
- const eval4 = eval3(dictLoadFile);
18863
- return (v) => concatM1(foldableList.foldr(Cons)(listMap((v1) => (\u03B3) => {
18864
- const $2 = v1._1;
18865
- return $0.bind(eval4(\u03B3)(v1._2)(setSet4.empty))((v2) => $1.pure(unionWith2((v$1) => identity13)(\u03B3)((() => {
18866
- const $3 = {};
18867
- $3[$2] = v2;
18868
- return $3;
18869
- })())));
18870
- })(reverse2(v.datasets)))(listMap((mod) => (\u03B3) => $0.bind(eval_module4(\u03B3)(mod)(setSet4.empty))((\u03B3$p) => $1.pure(unionWith2((v$1) => identity13)(\u03B3)(\u03B3$p))))(reverse2(v.mods))))(v.primitives);
18905
+ const concatM1 = concatM(Monad0);
18906
+ return (dictLoadFile) => {
18907
+ const eval_module3 = eval_module2(dictLoadFile);
18908
+ const eval3 = eval2(dictLoadFile);
18909
+ return (v) => (v1) => {
18910
+ const $2 = v.datasets;
18911
+ const $3 = v1.graph;
18912
+ const $4 = v1.modules;
18913
+ const $5 = v.primitives;
18914
+ const $6 = v1.roots;
18915
+ return $0.bind(foldM2(Monad0)((\u03B3s) => (name2) => {
18916
+ const v2 = definitely("deps evaluated")((() => {
18917
+ const $7 = lookup2(ordString)(name2)($3);
18918
+ if ($7.tag === "Just") {
18919
+ const $8 = traverse2((dep) => lookup2(ordString)(dep)(\u03B3s))($7._1);
18920
+ if ($8.tag === "Just") {
18921
+ const $9 = lookup2(ordString)(name2)($4);
18922
+ if ($9.tag === "Just") {
18923
+ return $Maybe("Just", $Tuple($9._1, $8._1));
18924
+ }
18925
+ if ($9.tag === "Nothing") {
18926
+ return Nothing;
18927
+ }
18928
+ fail();
18929
+ }
18930
+ if ($8.tag === "Nothing") {
18931
+ return Nothing;
18932
+ }
18933
+ fail();
18934
+ }
18935
+ if ($7.tag === "Nothing") {
18936
+ return Nothing;
18937
+ }
18938
+ fail();
18939
+ })());
18940
+ return $0.bind(eval_module3((() => {
18941
+ const go = (go$a0$copy) => (go$a1$copy) => {
18942
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18943
+ while (go$c) {
18944
+ const b = go$a0, v$1 = go$a1;
18945
+ if (v$1.tag === "Nil") {
18946
+ go$c = false;
18947
+ go$r = b;
18948
+ continue;
18949
+ }
18950
+ if (v$1.tag === "Cons") {
18951
+ go$a0 = unionWith2((v$2) => identity14)(b)(v$1._1);
18952
+ go$a1 = v$1._2;
18953
+ continue;
18954
+ }
18955
+ fail();
18956
+ }
18957
+ return go$r;
18958
+ };
18959
+ return go($5)(v2._2);
18960
+ })())(v2._1)(setSet4.empty))((\u03B3$p) => $1.pure(insert(ordString)(name2)(\u03B3$p)(\u03B3s)));
18961
+ })(Leaf2)(v1.topsorted))((\u03B3s) => {
18962
+ const go = (go$a0$copy) => (go$a1$copy) => {
18963
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18964
+ while (go$c) {
18965
+ const b = go$a0, v$1 = go$a1;
18966
+ if (v$1.tag === "Nil") {
18967
+ go$c = false;
18968
+ go$r = b;
18969
+ continue;
18970
+ }
18971
+ if (v$1.tag === "Cons") {
18972
+ go$a0 = unionWith2((v$2) => identity14)(b)(v$1._1);
18973
+ go$a1 = v$1._2;
18974
+ continue;
18975
+ }
18976
+ fail();
18977
+ }
18978
+ return go$r;
18979
+ };
18980
+ return concatM1(listMap((v2) => (\u03B3) => {
18981
+ const $7 = v2._1;
18982
+ return $0.bind(eval3(\u03B3)(v2._2)(setSet4.empty))((v3) => $1.pure(unionWith2((v$1) => identity14)(\u03B3)((() => {
18983
+ const $8 = {};
18984
+ $8[$7] = v3;
18985
+ return $8;
18986
+ })())));
18987
+ })(reverse2($2)))(go($5)(listMap((dep) => definitely("has env")(lookup2(ordString)(dep)(\u03B3s)))($6)));
18988
+ });
18871
18989
  };
18872
18990
  };
18873
18991
  };
@@ -18882,25 +19000,20 @@ var graphEval = (dictMonadAff) => {
18882
19000
  Applicative0: () => applicativeStateT(Monad0),
18883
19001
  Bind1: () => bindStateT(Monad0)
18884
19002
  })(graphGraphImpl);
18885
- const monadAffState2 = monadAffState(dictMonadAff);
18886
- const monadAffState1 = monadAffState(monadAffState2);
18887
- const $1 = monadAffState2.MonadEffect0().Monad0();
19003
+ const $1 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
18888
19004
  const $2 = dictMonadAff.MonadEffect0().Monad0();
18889
19005
  return (dictMonadReader) => {
18890
19006
  const monadReaderStateT2 = monadReaderStateT(monadReaderStateT(dictMonadReader));
18891
19007
  return (dictLoadFile) => (dictMonadError) => {
18892
- const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))(monadReaderStateT2)(monadAffState1)((() => {
18893
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
19008
+ const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))(monadReaderStateT2)((() => {
19009
+ const loadFileFromPath1 = dictLoadFile.loadFileFromPath(dictMonadError)(dictMonadAff);
18894
19010
  return {
18895
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
18896
- const $3 = loadFile1(folders);
18897
- return (x) => {
18898
- const $4 = $3(x);
18899
- return (s) => $1.Bind1().bind((s$1) => $2.Bind1().bind($4)((x$1) => $2.Applicative0().pure($Tuple(x$1, s$1))))((x$1) => $1.Applicative0().pure($Tuple(
18900
- x$1,
18901
- s
18902
- )));
18903
- };
19011
+ loadFileFromPath: (dictMonadError1) => (dictMonadAff1) => (x) => {
19012
+ const $3 = loadFileFromPath1(x);
19013
+ return (s) => $1.Bind1().bind((s$1) => $2.Bind1().bind($3)((x$1) => $2.Applicative0().pure($Tuple(x$1, s$1))))((x$1) => $1.Applicative0().pure($Tuple(
19014
+ x$1,
19015
+ s
19016
+ )));
18904
19017
  }
18905
19018
  };
18906
19019
  })());
@@ -19764,8 +19877,49 @@ var monoidRecord = () => (dictMonoidRecord) => {
19764
19877
  return { mempty: dictMonoidRecord.memptyRecord($$Proxy), Semigroup0: () => semigroupRecord1 };
19765
19878
  };
19766
19879
 
19880
+ // output-es/Data.Nullable/foreign.js
19881
+ function nullable(a, r, f) {
19882
+ return a == null ? r : f(a);
19883
+ }
19884
+
19885
+ // output-es/Foreign/foreign.js
19886
+ var isArray = Array.isArray || function(value) {
19887
+ return Object.prototype.toString.call(value) === "[object Array]";
19888
+ };
19889
+
19767
19890
  // output-es/File/index.js
19768
19891
  var Folder = (x) => x;
19892
+ var show4 = /* @__PURE__ */ showArrayImpl(showStringImpl);
19893
+ var prependFolder = (v) => (v1) => v + "/" + v1;
19894
+ var loadFile = (dictLoadFile) => (dictMonad) => {
19895
+ const $0 = dictMonad.Applicative0();
19896
+ return (dictMonadError) => {
19897
+ const loadFileFromPath2 = dictLoadFile.loadFileFromPath(dictMonadError);
19898
+ return (dictMonadAff) => {
19899
+ const loadFileFromPath3 = loadFileFromPath2(dictMonadAff);
19900
+ return (folders) => (file) => {
19901
+ const paths = arrayApply(arrayMap(prependFolder)(folders))([file]);
19902
+ return dictMonad.Bind1().bind(foldM(dictMonad)((v) => (v1) => {
19903
+ if (v.tag === "Just") {
19904
+ return $0.pure($Maybe("Just", v._1));
19905
+ }
19906
+ if (v.tag === "Nothing") {
19907
+ return loadFileFromPath3(v1);
19908
+ }
19909
+ fail();
19910
+ })(Nothing)(paths))((result) => {
19911
+ if (result.tag === "Just") {
19912
+ return $0.pure(result._1);
19913
+ }
19914
+ if (result.tag === "Nothing") {
19915
+ return throwException(error("File not found in any path: " + show4(paths)))();
19916
+ }
19917
+ fail();
19918
+ });
19919
+ };
19920
+ };
19921
+ };
19922
+ };
19769
19923
 
19770
19924
  // output-es/Data.CodePoint.Unicode/index.js
19771
19925
  var isUpper = (x) => checkAttr([512, 524288])(x);
@@ -19954,7 +20108,7 @@ var toLowerSimple = /* @__PURE__ */ convert(uTowlower);
19954
20108
  var toUpperSimple = /* @__PURE__ */ convert(uTowupper);
19955
20109
 
19956
20110
  // output-es/Parsing.Token/index.js
19957
- var identity23 = (x) => x;
20111
+ var identity25 = (x) => x;
19958
20112
  var choice3 = /* @__PURE__ */ choice(foldableArray);
19959
20113
  var toUnfoldable10 = /* @__PURE__ */ toUnfoldable2(unfoldableArray);
19960
20114
  var theReservedNames = (v) => {
@@ -20267,10 +20421,10 @@ var makeTokenParser = (v) => {
20267
20421
  if ($132) {
20268
20422
  return $42(v4$1, $122);
20269
20423
  }
20270
- return $52(v2, identity23);
20424
+ return $52(v2, identity25);
20271
20425
  });
20272
20426
  },
20273
- (state2, a) => $22((v2$1) => $52(state2, identity23))
20427
+ (state2, a) => $22((v2$1) => $52(state2, identity25))
20274
20428
  )));
20275
20429
  });
20276
20430
  },
@@ -21536,7 +21690,7 @@ var onlyIf = (b) => (a) => {
21536
21690
  };
21537
21691
  var choose2 = /* @__PURE__ */ choose(altParserT);
21538
21692
  var fanin3 = /* @__PURE__ */ fanin(categoryFn)(choiceFn);
21539
- var identity24 = (x) => x;
21693
+ var identity26 = (x) => x;
21540
21694
  var operators = (binaryOp) => fromFoldable18(listMap(arrayMap((v) => $Operator(
21541
21695
  "Infix",
21542
21696
  (() => {
@@ -21560,6 +21714,10 @@ var operators = (binaryOp) => fromFoldable18(listMap(arrayMap((v) => $Operator(
21560
21714
  }
21561
21715
  fail();
21562
21716
  })(foldableMap.foldr(Cons)(Nil)(opDefs))))));
21717
+ var letters = ($$char) => {
21718
+ const $0 = some(alternativeParserT)(lazyParserT)($$char);
21719
+ return (state1, more, lift12, $$throw2, done) => more((v1) => $0(state1, more, lift12, $$throw2, (state2, a) => more((v2) => done(state2, fromCharArray(a)))));
21720
+ };
21563
21721
  var languageDef = /* @__PURE__ */ (() => {
21564
21722
  const opChar = oneOf([":", "!", "#", "$", "%", "&", "*", "+", ".", "/", "<", "=", ">", "?", "@", "\\", "^", "|", "-", "~"]);
21565
21723
  return {
@@ -21613,7 +21771,7 @@ var languageDef = /* @__PURE__ */ (() => {
21613
21771
  })(),
21614
21772
  opStart: opChar,
21615
21773
  opLetter: opChar,
21616
- reservedNames: ["as", "else", "fun", "if", "in", "let", "match", "then"],
21774
+ reservedNames: ["as", "else", "fun", "if", "in", "let", "match", "then", "import"],
21617
21775
  reservedOpNames: ["|", "..", "=", "<-", "->"],
21618
21776
  caseSensitive: true
21619
21777
  };
@@ -21648,6 +21806,34 @@ var keyword = (str$p) => {
21648
21806
  }
21649
21807
  return throwException(error(str$p + " is not a reserved word"))();
21650
21808
  };
21809
+ var imports_ = /* @__PURE__ */ manyRec2(/* @__PURE__ */ (() => {
21810
+ const $0 = keyword("import");
21811
+ const $1 = joinWith("/");
21812
+ const $2 = sepBy1(token.identifier)(token.reservedOp("."));
21813
+ return (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => $0(
21814
+ state1,
21815
+ more,
21816
+ lift12,
21817
+ $$throw2,
21818
+ (state2, a) => more((v2$1) => more((v3) => more((v1$1) => $2(
21819
+ state2,
21820
+ more,
21821
+ lift12,
21822
+ $$throw2,
21823
+ (state2$1, a$1) => more((v2$2) => {
21824
+ const $3 = $1(fromFoldable19(a$1));
21825
+ return more((v4) => done(state2$1, $3));
21826
+ })
21827
+ ))))
21828
+ )));
21829
+ })());
21830
+ var withImports = (p) => topLevel((state1, more, lift12, $$throw2, done) => more((v1) => imports_(
21831
+ state1,
21832
+ more,
21833
+ lift12,
21834
+ $$throw2,
21835
+ (state2, a) => more((v2) => more((v1$1) => p(state2, more, lift12, $$throw2, (state2$1, a$1) => more((v2$1) => done(state2$1, $Tuple(a$1, a))))))
21836
+ )));
21651
21837
  var ident = (state1, more, lift12, $$throw2, done) => more((v1) => token.identifier(
21652
21838
  state1,
21653
21839
  more,
@@ -21949,17 +22135,8 @@ var varDefs = (expr$p) => {
21949
22135
  )));
21950
22136
  };
21951
22137
  var commentToken = /* @__PURE__ */ (() => {
21952
- const $0 = some(alternativeParserT)(lazyParserT)(docCommentLetter);
21953
- return (state1, more, lift12, $$throw2, done) => more((v1) => more((v1$1) => $0(
21954
- state1,
21955
- more,
21956
- lift12,
21957
- $$throw2,
21958
- (state2, a) => more((v2) => {
21959
- const $1 = fromCharArray(a);
21960
- return more((v2$1) => done(state2, $DocCommentElem("Token", $1)));
21961
- })
21962
- )));
22138
+ const $0 = letters(docCommentLetter);
22139
+ return (state1, more, lift12, $$throw2, done) => more((v1) => $0(state1, more, lift12, $$throw2, (state2, a) => more((v2) => done(state2, $DocCommentElem("Token", a)))));
21963
22140
  })();
21964
22141
  var commentExpr = (expr$p) => (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => string2("$")(
21965
22142
  state1,
@@ -22639,10 +22816,10 @@ var expr_$lazy = /* @__PURE__ */ binding(() => {
22639
22816
  if ($47) {
22640
22817
  return $42($ParseState(v4$5._1, v4$5._2, false), $46);
22641
22818
  }
22642
- return $43($ParseState($29, $30, false), identity24);
22819
+ return $43($ParseState($29, $30, false), identity26);
22643
22820
  });
22644
22821
  },
22645
- (state2, a) => $25((v2$3) => $43(state2, identity24))
22822
+ (state2, a) => $25((v2$3) => $43(state2, identity26))
22646
22823
  )));
22647
22824
  });
22648
22825
  },
@@ -22683,10 +22860,10 @@ var expr_$lazy = /* @__PURE__ */ binding(() => {
22683
22860
  if ($45) {
22684
22861
  return $40($ParseState(v4$4._1, v4$4._2, false), $44);
22685
22862
  }
22686
- return $41($ParseState($29, $30, false), identity24);
22863
+ return $41($ParseState($29, $30, false), identity26);
22687
22864
  });
22688
22865
  },
22689
- (state2, a) => $25((v2$3) => $41(state2, identity24))
22866
+ (state2, a) => $25((v2$3) => $41(state2, identity26))
22690
22867
  )));
22691
22868
  });
22692
22869
  },
@@ -23030,105 +23207,23 @@ var expr_$lazy = /* @__PURE__ */ binding(() => {
23030
23207
  return go;
23031
23208
  });
23032
23209
  var expr_ = /* @__PURE__ */ expr_$lazy();
23033
- var module_ = /* @__PURE__ */ (() => {
23034
- const $0 = topLevel((() => {
23035
- const $02 = sepBy_try(defs(expr_))(token.semi);
23036
- return (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => $02(
23037
- state1,
23038
- more,
23039
- lift12,
23040
- $$throw2,
23041
- (state2, a) => more((v2$1) => more((v3) => token.semi(state2, more, lift12, $$throw2, (state3, a$1) => more((v4) => done(state3, a)))))
23042
- )));
23043
- })());
23044
- return (state1, more, lift12, $$throw2, done) => more((v1) => $0(
23210
+ var module_ = /* @__PURE__ */ withImports(/* @__PURE__ */ (() => {
23211
+ const $0 = sepBy_try(defs(expr_))(token.semi);
23212
+ return (state1, more, lift12, $$throw2, done) => more((v2) => more((v1) => more((v1$1) => $0(
23045
23213
  state1,
23046
23214
  more,
23047
23215
  lift12,
23048
23216
  $$throw2,
23049
- (state2, a) => more((v2) => done(state2, $Module(bindList.bind(a)(identity7))))
23050
- ));
23051
- })();
23052
-
23053
- // output-es/Data.Argonaut.Core/foreign.js
23054
- function stringify(j) {
23055
- return JSON.stringify(j);
23056
- }
23057
- function _caseJson(isNull2, isBool, isNum, isStr, isArr, isObj, j) {
23058
- if (j == null)
23059
- return isNull2();
23060
- else if (typeof j === "boolean")
23061
- return isBool(j);
23062
- else if (typeof j === "number")
23063
- return isNum(j);
23064
- else if (typeof j === "string")
23065
- return isStr(j);
23066
- else if (Object.prototype.toString.call(j) === "[object Array]")
23067
- return isArr(j);
23068
- else
23069
- return isObj(j);
23070
- }
23071
-
23072
- // output-es/Data.Argonaut.Core/index.js
23073
- var caseJson = (a) => (b) => (c) => (d) => (e) => (f) => (json) => _caseJson(a, b, c, d, e, f, json);
23074
-
23075
- // output-es/Data.Argonaut.Decode.Error/index.js
23076
- var $JsonDecodeError = (tag, _1, _2) => ({ tag, _1, _2 });
23077
- var showJsonDecodeError = {
23078
- show: (v) => {
23079
- if (v.tag === "TypeMismatch") {
23080
- return "(TypeMismatch " + showStringImpl(v._1) + ")";
23081
- }
23082
- if (v.tag === "UnexpectedValue") {
23083
- return "(UnexpectedValue " + stringify(v._1) + ")";
23084
- }
23085
- if (v.tag === "AtIndex") {
23086
- return "(AtIndex " + showIntImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
23087
- }
23088
- if (v.tag === "AtKey") {
23089
- return "(AtKey " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
23090
- }
23091
- if (v.tag === "Named") {
23092
- return "(Named " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
23093
- }
23094
- if (v.tag === "MissingValue") {
23095
- return "MissingValue";
23096
- }
23097
- fail();
23098
- }
23099
- };
23100
-
23101
- // output-es/Data.Argonaut.Parser/foreign.js
23102
- function _jsonParser(fail3, succ, s) {
23103
- try {
23104
- return succ(JSON.parse(s));
23105
- } catch (e) {
23106
- return fail3(e.message);
23107
- }
23108
- }
23109
-
23110
- // output-es/Data.Argonaut.Decode.Parser/index.js
23111
- var parseJson = (x) => {
23112
- const $0 = _jsonParser(Left, Right, x);
23113
- if ($0.tag === "Left") {
23114
- return $Either("Left", $JsonDecodeError("TypeMismatch", "JSON"));
23115
- }
23116
- if ($0.tag === "Right") {
23117
- return $Either("Right", $0._1);
23118
- }
23119
- fail();
23120
- };
23217
+ (state2, a) => more((v2$1) => {
23218
+ const $1 = $Module(bindList.bind(a)(identity7));
23219
+ return more((v2$2) => more((v3) => token.semi(state2, more, lift12, $$throw2, (state3, a$1) => more((v4) => done(state3, $1)))));
23220
+ })
23221
+ ))));
23222
+ })());
23121
23223
 
23122
23224
  // output-es/Primitive.Defs/index.js
23123
23225
  var foldM4 = (dictMonad) => (f) => (b0) => foldableDict.foldl((b) => (a) => dictMonad.Bind1().bind(b)((a$1) => f(a$1)(a)))(dictMonad.Applicative0().pure(b0));
23124
23226
  var disjointUnion3 = /* @__PURE__ */ disjointUnion(mapDictString);
23125
- var fromFoldable20 = /* @__PURE__ */ foldlArray((m) => (a) => insert(ordVertex)(a)()(m))(Leaf2);
23126
- var pretty = /* @__PURE__ */ (() => prettyVal(highlightableVertex).pretty)();
23127
- var toUnfoldable15 = /* @__PURE__ */ (() => {
23128
- const $0 = toArrayWithKey(Tuple);
23129
- return (x) => toUnfoldable(unfoldableArray)($0(x));
23130
- })();
23131
- var fromFoldable110 = /* @__PURE__ */ fromFoldable2(foldableArray);
23132
23227
  var unary2 = /* @__PURE__ */ unary(boundedJoinSemilatticeUni);
23133
23228
  var binary2 = /* @__PURE__ */ binary(boundedJoinSemilatticeUni);
23134
23229
  var binaryZero2 = /* @__PURE__ */ binaryZero(boundedJoinSemilatticeUni);
@@ -23153,7 +23248,7 @@ var matrixUpdate = /* @__PURE__ */ $Tuple(
23153
23248
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23154
23249
  return (dictMonadError) => {
23155
23250
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23156
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23251
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23157
23252
  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") {
23158
23253
  const $0 = v._2._2._1;
23159
23254
  return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._1, void 0, Leaf2))($BaseVal(
@@ -23172,12 +23267,12 @@ var matrixLookup = /* @__PURE__ */ $Tuple(
23172
23267
  /* @__PURE__ */ $ForeignOp$p({
23173
23268
  arity: 2,
23174
23269
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23175
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23176
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23270
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23271
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23177
23272
  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") {
23178
- 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));
23273
+ return MonadThrow0.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));
23179
23274
  }
23180
- return $$throw2("Matrix and pair of integers expected");
23275
+ return MonadThrow0.throwError(error("Matrix and pair of integers expected"));
23181
23276
  };
23182
23277
  }
23183
23278
  })
@@ -23205,12 +23300,12 @@ var error_ = /* @__PURE__ */ $Tuple(
23205
23300
  /* @__PURE__ */ $ForeignOp$p({
23206
23301
  arity: 1,
23207
23302
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23208
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23209
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23303
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23304
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23210
23305
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
23211
- return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
23306
+ return MonadThrow0.Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
23212
23307
  }
23213
- return $$throw2("String expected");
23308
+ return MonadThrow0.throwError(error("String expected"));
23214
23309
  };
23215
23310
  }
23216
23311
  })
@@ -23223,28 +23318,26 @@ var dims = /* @__PURE__ */ $Tuple(
23223
23318
  op: (dictMonadWithGraphAlloc) => {
23224
23319
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23225
23320
  return (dictMonadError) => {
23226
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23227
- return (dictMonadAff) => {
23228
- const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
23229
- return (dictMonadReader) => (dictLoadFile) => (v) => {
23230
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
23231
- const $1 = v._1._3._1._2._2._1;
23232
- const $2 = v._1._1;
23233
- const $3 = v._1._3._1._2._2._2;
23234
- return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
23235
- "Int",
23236
- v._1._3._1._2._1._1
23237
- )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
23238
- "Int",
23239
- $1
23240
- )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
23241
- "Constr",
23242
- "Pair",
23243
- $List("Cons", v1, $List("Cons", v2, Nil))
23244
- ))));
23245
- }
23246
- return $$throw2("Matrix expected");
23247
- };
23321
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23322
+ const $0 = MonadThrow0.Monad0().Bind1();
23323
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23324
+ if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
23325
+ const $1 = v._1._3._1._2._2._1;
23326
+ const $2 = v._1._1;
23327
+ const $3 = v._1._3._1._2._2._2;
23328
+ return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
23329
+ "Int",
23330
+ v._1._3._1._2._1._1
23331
+ )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
23332
+ "Int",
23333
+ $1
23334
+ )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
23335
+ "Constr",
23336
+ "Pair",
23337
+ $List("Cons", v1, $List("Cons", v2, Nil))
23338
+ ))));
23339
+ }
23340
+ return MonadThrow0.throwError(error("Matrix expected"));
23248
23341
  };
23249
23342
  };
23250
23343
  }
@@ -23258,29 +23351,27 @@ var dict_map = /* @__PURE__ */ $Tuple(
23258
23351
  const apply5 = apply2(dictMonadWithGraphAlloc);
23259
23352
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23260
23353
  return (dictMonadError) => {
23261
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23262
- return (dictMonadAff) => {
23263
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23264
- const Bind1 = Monad0.Bind1();
23265
- const traverse2 = traversableDict.traverse(Monad0.Applicative0());
23266
- return (dictMonadReader) => {
23267
- const apply12 = apply5(dictMonadReader)(dictMonadAff);
23268
- return (dictLoadFile) => {
23269
- const apply22 = apply12(dictLoadFile);
23270
- return (v) => {
23271
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23272
- const $0 = v._1;
23273
- const $1 = v._2._1._1;
23274
- return Bind1.bind(traverse2((v2) => {
23275
- const $2 = v2._1;
23276
- return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply22($0)(v2._2));
23277
- })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
23278
- "Dictionary",
23279
- d$p
23280
- )));
23281
- }
23282
- return $$throw2("Function and dictionary expected");
23283
- };
23354
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23355
+ const Monad0 = MonadThrow0.Monad0();
23356
+ const Bind1 = Monad0.Bind1();
23357
+ const traverse1 = traversableDict.traverse(Monad0.Applicative0());
23358
+ return (dictMonadReader) => {
23359
+ const apply12 = apply5(dictMonadReader);
23360
+ return (dictLoadFile) => {
23361
+ const apply22 = apply12(dictLoadFile);
23362
+ return (v) => {
23363
+ if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23364
+ const $0 = v._1;
23365
+ const $1 = v._2._1._1;
23366
+ return Bind1.bind(traverse1((v2) => {
23367
+ const $2 = v2._1;
23368
+ return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply22($0)(v2._2));
23369
+ })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
23370
+ "Dictionary",
23371
+ d$p
23372
+ )));
23373
+ }
23374
+ return MonadThrow0.throwError(error("Function and dictionary expected"));
23284
23375
  };
23285
23376
  };
23286
23377
  };
@@ -23296,42 +23387,40 @@ var dict_intersectionWith = /* @__PURE__ */ $Tuple(
23296
23387
  const apply5 = apply2(dictMonadWithGraphAlloc);
23297
23388
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23298
23389
  return (dictMonadError) => {
23299
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23300
- return (dictMonadAff) => {
23301
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23302
- const Bind1 = Monad0.Bind1();
23303
- const Applicative0 = Monad0.Applicative0();
23304
- const $0 = Bind1.Apply0().Functor0();
23305
- return (dictMonadReader) => {
23306
- const apply12 = apply5(dictMonadReader)(dictMonadAff);
23307
- return (dictLoadFile) => {
23308
- const apply22 = apply12(dictLoadFile);
23309
- return (v) => {
23310
- 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") {
23311
- const $1 = v._1;
23312
- const $2 = v._2._1._1;
23313
- const $3 = v._2._2._1._1;
23314
- return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity14)(intersectionWith_Object((v2) => (v3) => {
23315
- const $4 = v3._2;
23316
- const $5 = v2._1;
23317
- const $6 = v3._1;
23318
- return Bind1.bind(Bind1.bind(apply22($1)(v2._2))((a) => apply22(a)($4)))((v4) => Bind1.bind($$new((a) => Val(a)(None))(insert(ordVertex)($6)()($$$Map(
23319
- "Two",
23320
- Leaf2,
23321
- $5,
23322
- void 0,
23323
- Leaf2
23324
- )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
23325
- })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert(ordVertex)($3)()($$$Map(
23390
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23391
+ const Monad0 = MonadThrow0.Monad0();
23392
+ const Bind1 = Monad0.Bind1();
23393
+ const Applicative0 = Monad0.Applicative0();
23394
+ const $0 = Bind1.Apply0().Functor0();
23395
+ return (dictMonadReader) => {
23396
+ const apply12 = apply5(dictMonadReader);
23397
+ return (dictLoadFile) => {
23398
+ const apply22 = apply12(dictLoadFile);
23399
+ return (v) => {
23400
+ 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") {
23401
+ const $1 = v._1;
23402
+ const $2 = v._2._1._1;
23403
+ const $3 = v._2._2._1._1;
23404
+ return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity15)(intersectionWith_Object((v2) => (v3) => {
23405
+ const $4 = v3._2;
23406
+ const $5 = v2._1;
23407
+ const $6 = v3._1;
23408
+ return Bind1.bind(Bind1.bind(apply22($1)(v2._2))((a) => apply22(a)($4)))((v4) => Bind1.bind($$new((a) => Val(a)(None))(insert(ordVertex)($6)()($$$Map(
23326
23409
  "Two",
23327
23410
  Leaf2,
23328
- $2,
23411
+ $5,
23329
23412
  void 0,
23330
23413
  Leaf2
23331
- )))(v$p));
23332
- }
23333
- return $$throw2("Function and two dictionaries expected");
23334
- };
23414
+ )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
23415
+ })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert(ordVertex)($3)()($$$Map(
23416
+ "Two",
23417
+ Leaf2,
23418
+ $2,
23419
+ void 0,
23420
+ Leaf2
23421
+ )))(v$p));
23422
+ }
23423
+ return MonadThrow0.throwError(error("Function and two dictionaries expected"));
23335
23424
  };
23336
23425
  };
23337
23426
  };
@@ -23345,7 +23434,7 @@ var dict_get = /* @__PURE__ */ $Tuple(
23345
23434
  arity: 2,
23346
23435
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23347
23436
  const MonadThrow0 = dictMonadError.MonadThrow0();
23348
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23437
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23349
23438
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23350
23439
  return orElse(MonadThrow0)('Key "' + v._1._3._1 + '" not found')((() => {
23351
23440
  const $0 = _lookup(Nothing, Just, v._1._3._1, v._2._1._3._1);
@@ -23367,23 +23456,21 @@ var dict_foldl = /* @__PURE__ */ $Tuple(
23367
23456
  op: (dictMonadWithGraphAlloc) => {
23368
23457
  const apply5 = apply2(dictMonadWithGraphAlloc);
23369
23458
  return (dictMonadError) => {
23370
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23371
- return (dictMonadAff) => {
23372
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23373
- return (dictMonadReader) => {
23374
- const apply12 = apply5(dictMonadReader)(dictMonadAff);
23375
- return (dictLoadFile) => {
23376
- const apply22 = apply12(dictLoadFile);
23377
- return (v) => {
23378
- 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") {
23379
- const $0 = v._1;
23380
- return foldM4(Monad0)((u1) => (v2) => {
23381
- const $1 = v2._2;
23382
- return Monad0.Bind1().bind(apply22($0)(u1))((a) => apply22(a)($1));
23383
- })(v._2._1)(v._2._2._1._3._1);
23384
- }
23385
- return $$throw2("Function, value and dictionary expected");
23386
- };
23459
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23460
+ const Monad0 = MonadThrow0.Monad0();
23461
+ return (dictMonadReader) => {
23462
+ const apply12 = apply5(dictMonadReader);
23463
+ return (dictLoadFile) => {
23464
+ const apply22 = apply12(dictLoadFile);
23465
+ return (v) => {
23466
+ 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") {
23467
+ const $0 = v._1;
23468
+ return foldM4(Monad0)((u1) => (v2) => {
23469
+ const $1 = v2._2;
23470
+ return Monad0.Bind1().bind(apply22($0)(u1))((a) => apply22(a)($1));
23471
+ })(v._2._1)(v._2._2._1._3._1);
23472
+ }
23473
+ return MonadThrow0.throwError(error("Function, value and dictionary expected"));
23387
23474
  };
23388
23475
  };
23389
23476
  };
@@ -23399,7 +23486,7 @@ var dict_disjointUnion = /* @__PURE__ */ $Tuple(
23399
23486
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23400
23487
  return (dictMonadError) => {
23401
23488
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23402
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23489
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23403
23490
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23404
23491
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
23405
23492
  "Two",
@@ -23423,7 +23510,7 @@ var dict_difference = /* @__PURE__ */ $Tuple(
23423
23510
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23424
23511
  return (dictMonadError) => {
23425
23512
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23426
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23513
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23427
23514
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23428
23515
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
23429
23516
  "Two",
@@ -23444,103 +23531,18 @@ var debugLog = /* @__PURE__ */ $Tuple(
23444
23531
  /* @__PURE__ */ $ForeignOp$p({
23445
23532
  arity: 1,
23446
23533
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23447
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23448
- return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23534
+ const MonadThrow0 = dictMonadError.MonadThrow0();
23535
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23449
23536
  if (v.tag === "Cons" && v._2.tag === "Nil") {
23450
23537
  const $0 = v._1;
23451
- return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
23538
+ return MonadThrow0.Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
23452
23539
  }
23453
- return $$throw2("Single value expected");
23454
- };
23455
- }
23456
- })
23457
- );
23458
- var arrVtoVal$p = (dictMonadWithGraphAlloc) => {
23459
- const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23460
- return (v) => {
23461
- if (v.tag === "Nil") {
23462
- return $$new((a) => Val(a)(None))(Leaf2)($BaseVal("Constr", "Nil", Nil));
23463
- }
23464
- if (v.tag === "Cons") {
23465
- const $0 = v._1;
23466
- return dictMonadWithGraphAlloc.MonadWithGraph2().Monad0().Bind1().bind(arrVtoVal$p(dictMonadWithGraphAlloc)(v._2))((tailV) => $$new((a) => Val(a)(None))(fromFoldable20([
23467
- $0._1,
23468
- tailV._1
23469
- ]))($BaseVal("Constr", ":", $List("Cons", $0, $List("Cons", tailV, Nil)))));
23470
- }
23471
- fail();
23472
- };
23473
- };
23474
- var fromJsonVal$p = (dictMonadWithGraphAlloc) => {
23475
- const $$throw2 = $$throw(dictMonadWithGraphAlloc.MonadError1().MonadThrow0());
23476
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
23477
- const $0 = Monad0.Bind1();
23478
- const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23479
- const Applicative0 = Monad0.Applicative0();
23480
- const traverse2 = traversableArray.traverse(Applicative0);
23481
- const arrVtoVal$p1 = arrVtoVal$p(dictMonadWithGraphAlloc);
23482
- return caseJson((v) => $$throw2("Error, Null JSON value cannot be converted to Val Vertex"))((b) => $0.bind($$new((a) => Val(a)(None))(Leaf2)($BaseVal(
23483
- "Constr",
23484
- b ? "True" : "False",
23485
- Nil
23486
- )))((v) => Applicative0.pure(spyWhen(true)("Processing boolean")((x) => intercalate4("\n")(pretty(x).lines))(v))))((n) => $0.bind((() => {
23487
- const v = fromNumber(n);
23488
- if (v.tag === "Just") {
23489
- return $$new((a) => Val(a)(None))(Leaf2)($BaseVal("Int", v._1));
23490
- }
23491
- if (v.tag === "Nothing") {
23492
- return $$new((a) => Val(a)(None))(Leaf2)($BaseVal("Float", n));
23493
- }
23494
- fail();
23495
- })())((v) => Applicative0.pure(spyWhen(true)("Processing number")((x) => intercalate4("\n")(pretty(x).lines))(v))))((s) => $0.bind($$new((a) => Val(a)(None))(Leaf2)($BaseVal(
23496
- "Str",
23497
- s
23498
- )))((v) => Applicative0.pure(spyWhen(true)("Processing string")((x) => intercalate4("\n")(pretty(x).lines))(v))))((arr) => $0.bind(traverse2(fromJsonVal$p(dictMonadWithGraphAlloc))(arr))((vs) => $0.bind(arrVtoVal$p1(toUnfoldable(unfoldableList)(vs)))((v) => Applicative0.pure(spyWhen(true)("Processing array")((x) => intercalate4("\n")(pretty(x).lines))(v)))))((obj) => $0.bind(traverse2((v) => {
23499
- const $1 = v._1;
23500
- return $0.bind(fromJsonVal$p(dictMonadWithGraphAlloc)(v._2))((vv) => Applicative0.pure($Tuple($1, $Tuple(vv._1, vv))));
23501
- })(toUnfoldable15(obj)))((entries) => $0.bind($$new((a) => Val(a)(None))(fromFoldable20(arrayMap((v) => v._2._1)(entries)))($BaseVal(
23502
- "Dictionary",
23503
- fromFoldable110(entries)
23504
- )))((v) => Applicative0.pure(spyWhen(true)("Processing object")((x) => intercalate4("\n")(pretty(x).lines))(v)))));
23505
- };
23506
- var loadJson = /* @__PURE__ */ $Tuple(
23507
- "loadJson",
23508
- /* @__PURE__ */ $ForeignOp$p({
23509
- arity: 1,
23510
- op: (dictMonadWithGraphAlloc) => {
23511
- const fromJsonVal$p1 = fromJsonVal$p(dictMonadWithGraphAlloc);
23512
- return (dictMonadError) => {
23513
- const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23514
- return (dictMonadAff) => {
23515
- const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
23516
- return (dictMonadReader) => {
23517
- const ask = dictMonadReader.MonadAsk0().ask;
23518
- return (dictLoadFile) => {
23519
- const loadFile = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23520
- return (v) => {
23521
- if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
23522
- const $1 = v._1._3._1;
23523
- return $0.bind(ask)((v1) => $0.bind(loadFile(v1.fluidSrcPaths)($1))((str) => {
23524
- const v2 = parseJson(str);
23525
- if (v2.tag === "Left") {
23526
- return $$throw2("Failed to parse JSON: " + showJsonDecodeError.show(v2._1));
23527
- }
23528
- if (v2.tag === "Right") {
23529
- return fromJsonVal$p1(v2._1);
23530
- }
23531
- fail();
23532
- }));
23533
- }
23534
- return $$throw2("String expected");
23535
- };
23536
- };
23537
- };
23538
- };
23540
+ return MonadThrow0.throwError(error("Single value expected"));
23539
23541
  };
23540
23542
  }
23541
23543
  })
23542
23544
  );
23543
- var primitives = /* @__PURE__ */ fromFoldable110([
23545
+ var primitives = /* @__PURE__ */ fromFoldable2(foldableArray)([
23544
23546
  /* @__PURE__ */ $Tuple(
23545
23547
  ":",
23546
23548
  /* @__PURE__ */ $Val(void 0, None, /* @__PURE__ */ $BaseVal("Fun", /* @__PURE__ */ $Fun("PartialConstr", ":", Nil)))
@@ -23549,7 +23551,6 @@ var primitives = /* @__PURE__ */ fromFoldable110([
23549
23551
  /* @__PURE__ */ extern1(debugLog),
23550
23552
  /* @__PURE__ */ extern1(dims),
23551
23553
  /* @__PURE__ */ extern1(error_),
23552
- /* @__PURE__ */ extern1(loadJson),
23553
23554
  /* @__PURE__ */ unary2("floor")({ i: number, o: $$int, fwd: floor2 }),
23554
23555
  /* @__PURE__ */ unary2("log")({ i: intOrNumber, o: number, fwd: log3 }),
23555
23556
  /* @__PURE__ */ unary2("numToStr")({ i: intOrNumber, o: string, fwd: numToStr }),
@@ -23621,7 +23622,7 @@ var unions4 = /* @__PURE__ */ (() => {
23621
23622
  };
23622
23623
  return go(Leaf2);
23623
23624
  })();
23624
- var identity25 = (x) => x;
23625
+ var identity27 = (x) => x;
23625
23626
  var verticesProgCxtVertex = {
23626
23627
  vertices: (v) => union7(unions13(listMap(verticesValVertex.vertices)(mapObjectString.values(v.primitives))))(union7(unions4(listMap(verticesModuleVertex.vertices)(v.mods)))(unions4(listMap((x) => verticesExprVertex.vertices(x._2))(v.datasets))))
23627
23628
  };
@@ -23698,13 +23699,47 @@ var traversableProgCxt = {
23698
23699
  const traverse9 = traversableEnv.traverse(dictApplicative);
23699
23700
  return (f) => (m) => Apply0.apply(Apply0.apply(Apply0.Functor0().map((v1) => (v2) => (v3) => ({ primitives: v3, mods: v2, datasets: v1 }))(traverse5(traversableTuple.traverse(dictApplicative)(traverse7(f)))(m.datasets)))(traverse5(traverse8(f))(m.mods)))(traverse9(f)(m.primitives));
23700
23701
  },
23701
- sequence: (dictApplicative) => (v) => traversableProgCxt.traverse(dictApplicative)(identity25)(v),
23702
+ sequence: (dictApplicative) => (v) => traversableProgCxt.traverse(dictApplicative)(identity27)(v),
23702
23703
  Functor0: () => functorProgCxt,
23703
23704
  Foldable1: () => foldableProgCxt
23704
23705
  };
23705
23706
 
23706
23707
  // output-es/Module/index.js
23708
+ var all3 = /* @__PURE__ */ (() => foldableList.foldMap((() => {
23709
+ const semigroupConj1 = { append: (v) => (v1) => v && v1 };
23710
+ return { mempty: true, Semigroup0: () => semigroupConj1 };
23711
+ })()))();
23712
+ var elem2 = /* @__PURE__ */ (() => {
23713
+ const any1 = foldableList.foldMap((() => {
23714
+ const semigroupDisj1 = { append: (v) => (v1) => v || v1 };
23715
+ return { mempty: false, Semigroup0: () => semigroupDisj1 };
23716
+ })());
23717
+ return (x) => any1(($0) => x === $0);
23718
+ })();
23719
+ var fromFoldable20 = /* @__PURE__ */ (() => foldableSet.foldr(Cons)(Nil))();
23707
23720
  var boundedLattice2 = { BoundedJoinSemilattice0: () => boundedJoinSemilatticeUni, BoundedMeetSemilattice1: () => boundedMeetSemilatticeUni };
23721
+ var unions5 = /* @__PURE__ */ (() => {
23722
+ const go = (go$a0$copy) => (go$a1$copy) => {
23723
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
23724
+ while (go$c) {
23725
+ const b = go$a0, v = go$a1;
23726
+ if (v.tag === "Nil") {
23727
+ go$c = false;
23728
+ go$r = b;
23729
+ continue;
23730
+ }
23731
+ if (v.tag === "Cons") {
23732
+ go$a0 = unionWith(ordDVertex$p)($$const)(b)(v._1);
23733
+ go$a1 = v._2;
23734
+ continue;
23735
+ }
23736
+ fail();
23737
+ }
23738
+ return go$r;
23739
+ };
23740
+ return go(Leaf2);
23741
+ })();
23742
+ var union8 = /* @__PURE__ */ (() => setSet(ordDVertex$p).union)();
23708
23743
  var concatM2 = (dictMonad) => foldrArray((() => {
23709
23744
  const $0 = dictMonad.Bind1();
23710
23745
  return (f) => (g) => (a) => $0.bind(f(a))(g);
@@ -23726,76 +23761,146 @@ var parse = (dictMonadError) => {
23726
23761
  };
23727
23762
  };
23728
23763
  };
23729
- var parseProgram = (dictLoadFile) => (folders) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().bind(dictLoadFile.loadFile(dictMonadError)(dictMonadAff)(folders)(file))((() => {
23730
- const $0 = parse(dictMonadError);
23731
- return (a) => $0(a)(topLevel(expr_));
23732
- })());
23733
- var module_2 = (dictMonadAff) => {
23764
+ var loadModuleGraph = (dictMonadAff) => {
23734
23765
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23735
- const Bind1 = Monad0.Bind1();
23736
- const Applicative0 = Monad0.Applicative0();
23766
+ const $0 = Monad0.Bind1();
23767
+ const $1 = Monad0.Applicative0();
23737
23768
  return (dictMonadError) => {
23738
23769
  const parse1 = parse(dictMonadError);
23739
23770
  const desugarModuleFwd = moduleFwd(dictMonadError)(boundedLattice2);
23740
- return (dictLoadFile) => {
23741
- const loadFile = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23742
- return (folders) => (file) => (v) => {
23743
- const $0 = v.mods;
23744
- return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile(folders)(file))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
23745
- primitives: v.primitives,
23746
- mods: $List("Cons", mod, $0),
23747
- datasets: v.datasets
23748
- }))));
23771
+ return (dictMonadReader) => {
23772
+ const ask = dictMonadReader.MonadAsk0().ask;
23773
+ return (dictLoadFile) => {
23774
+ const loadFile3 = loadFile(dictLoadFile)(Monad0)(dictMonadError)(dictMonadAff);
23775
+ return (roots) => {
23776
+ const collectModules = (visited) => (graph) => (modules) => (imports) => {
23777
+ if (imports.tag === "Nil") {
23778
+ return $1.pure($Tuple(graph, modules));
23779
+ }
23780
+ if (imports.tag === "Cons") {
23781
+ if ((() => {
23782
+ const $2 = lookup2(ordString)(imports._1)(visited);
23783
+ if ($2.tag === "Nothing") {
23784
+ return false;
23785
+ }
23786
+ if ($2.tag === "Just") {
23787
+ return true;
23788
+ }
23789
+ fail();
23790
+ })()) {
23791
+ return collectModules(visited)(graph)(modules)(imports._2);
23792
+ }
23793
+ return $0.bind($0.bind(ask)((v) => $0.bind(loadFile3(v.fluidSrcPaths)(imports._1 + ".fld"))((src) => $0.bind(parse1(src)(module_))((v1) => {
23794
+ const $2 = v1._2;
23795
+ return $0.bind(desugarModuleFwd(v1._1))((mod$p) => $1.pure($Tuple(
23796
+ mod$p,
23797
+ imports._1 === "lib/prelude" ? $2 : $List("Cons", "lib/prelude", $2)
23798
+ )));
23799
+ }))))((v) => collectModules(insert(ordString)(imports._1)()(visited))(insert(ordString)(imports._1)(v._2)(graph))(insert(ordString)(imports._1)(v._1)(modules))(foldableList.foldr(Cons)(imports._2)(v._2)));
23800
+ }
23801
+ fail();
23802
+ };
23803
+ return $0.bind(collectModules(Leaf2)(Leaf2)(Leaf2)(roots))((v) => {
23804
+ const $2 = v._1;
23805
+ return $1.pure({
23806
+ roots,
23807
+ topsorted: (() => {
23808
+ const go = (go$a0$copy) => (go$a1$copy) => {
23809
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
23810
+ while (go$c) {
23811
+ const v$1 = go$a0, v1 = go$a1;
23812
+ if (v$1.tag === "Nil") {
23813
+ go$c = false;
23814
+ go$r = reverse2(v1);
23815
+ continue;
23816
+ }
23817
+ const v2 = find(foldableList)((mod) => {
23818
+ const v22 = lookup2(ordString)(mod)($2);
23819
+ if (v22.tag === "Nothing") {
23820
+ return true;
23821
+ }
23822
+ if (v22.tag === "Just") {
23823
+ return all3((dep) => !elem2(dep)(v$1))(v22._1);
23824
+ }
23825
+ fail();
23826
+ })(v$1);
23827
+ if (v2.tag === "Nothing") {
23828
+ go$c = false;
23829
+ go$r = throwException(error("Modules contain circular imports"))();
23830
+ continue;
23831
+ }
23832
+ if (v2.tag === "Just") {
23833
+ go$a0 = deleteBy(eqStringImpl)(v2._1)(v$1);
23834
+ go$a1 = $List("Cons", v2._1, v1);
23835
+ continue;
23836
+ }
23837
+ fail();
23838
+ }
23839
+ return go$r;
23840
+ };
23841
+ return go(fromFoldable20(functorMap.map((v$1) => {
23842
+ })($2)))(Nil);
23843
+ })(),
23844
+ graph: $2,
23845
+ modules: v._2
23846
+ });
23847
+ });
23848
+ };
23749
23849
  };
23750
23850
  };
23751
23851
  };
23752
23852
  };
23753
23853
  var initialConfig = (dictMonadAff) => {
23754
23854
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23755
- const Bind1 = Monad0.Bind1();
23756
- const Applicative0 = Monad0.Applicative0();
23757
- const $0 = monadAllocAllocT(Monad0);
23758
- const fresh1 = $0.fresh;
23759
- const alloc = traversableProgCxt.traverse($0.Monad0().Applicative0())((v) => fresh1);
23760
- const $1 = bindStateT(Monad0);
23855
+ const $0 = bindStateT(Monad0);
23856
+ const $1 = monadAllocAllocT(Monad0);
23857
+ const Applicative0 = $1.Monad0().Applicative0();
23858
+ const fresh1 = $1.fresh;
23859
+ const alloc1 = traversableProgCxt.traverse(Applicative0)((v) => fresh1);
23860
+ const applicativeStateT2 = applicativeStateT(Monad0);
23861
+ const traverse1 = traversableMap.traverse(applicativeStateT2);
23862
+ const alloc2 = traversableModule.traverse(Applicative0)((v) => fresh1);
23761
23863
  const runWithGraphT_spy2 = runWithGraphT_spy({
23762
23864
  Applicative0: () => applicativeStateT(Monad0),
23763
23865
  Bind1: () => bindStateT(Monad0)
23764
23866
  })(graphGraphImpl);
23765
- const monadAffState2 = monadAffState(dictMonadAff);
23766
- const monadAffState1 = monadAffState(monadAffState2);
23767
- const $2 = monadAffState2.MonadEffect0().Monad0();
23867
+ const $2 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
23768
23868
  const $3 = dictMonadAff.MonadEffect0().Monad0();
23769
23869
  return (dictMonadError) => {
23770
23870
  const eval_progCxt2 = eval_progCxt(monadWithGraphAllocWithGr(dictMonadError));
23771
23871
  return (dictMonadReader) => {
23772
- const eval_progCxt1 = eval_progCxt2(monadReaderStateT(monadReaderStateT(dictMonadReader)))(monadAffState1);
23872
+ const eval_progCxt1 = eval_progCxt2(monadReaderStateT(monadReaderStateT(dictMonadReader)));
23773
23873
  return (dictLoadFile) => {
23774
23874
  const eval_progCxt22 = eval_progCxt1((() => {
23775
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23875
+ const loadFileFromPath1 = dictLoadFile.loadFileFromPath(dictMonadError)(dictMonadAff);
23776
23876
  return {
23777
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
23778
- const $4 = loadFile1(folders);
23779
- return (x) => {
23780
- const $5 = $4(x);
23781
- return (s) => $2.Bind1().bind((s$1) => $3.Bind1().bind($5)((x$1) => $3.Applicative0().pure($Tuple(x$1, s$1))))((x$1) => $2.Applicative0().pure($Tuple(
23782
- x$1,
23783
- s
23784
- )));
23785
- };
23877
+ loadFileFromPath: (dictMonadError1) => (dictMonadAff1) => (x) => {
23878
+ const $4 = loadFileFromPath1(x);
23879
+ return (s) => $2.Bind1().bind((s$1) => $3.Bind1().bind($4)((x$1) => $3.Applicative0().pure($Tuple(x$1, s$1))))((x$1) => $2.Applicative0().pure($Tuple(
23880
+ x$1,
23881
+ s
23882
+ )));
23786
23883
  }
23787
23884
  };
23788
23885
  })());
23789
- return (dictFV) => (e) => (progCxt) => Bind1.bind(Applicative0.pure())(() => Bind1.bind(runAllocT(Monad0)($1.bind(alloc(progCxt))((progCxt$p) => $1.bind(runWithGraphT_spy2(eval_progCxt22(progCxt$p))(verticesProgCxtVertex.vertices(progCxt$p)))((v) => applicativeStateT(Monad0).pure($Tuple(
23886
+ return (dictFV) => (e) => (progCxt) => (moduleCxt) => Monad0.Bind1().bind(runAllocT(Monad0)($0.bind(alloc1(progCxt))((progCxt$p) => $0.bind(traverse1(alloc2)(moduleCxt.modules))((modules$p) => $0.bind(runWithGraphT_spy2(eval_progCxt22(progCxt$p)({
23887
+ modules: modules$p,
23888
+ graph: moduleCxt.graph,
23889
+ roots: moduleCxt.roots,
23890
+ topsorted: moduleCxt.topsorted
23891
+ }))(union8(verticesProgCxtVertex.vertices(progCxt$p))(unions5(listMap(verticesModuleVertex.vertices)(foldableMap.foldr(Cons)(Nil)(modules$p))))))((v) => applicativeStateT2.pure($Tuple(
23790
23892
  progCxt$p,
23791
- (() => {
23792
- const $4 = dictFV.fv(e);
23793
- return filterWithKey2((x) => {
23794
- const $5 = setSet(ordString).member(x)($4);
23795
- return (v$1) => $5;
23796
- })(v._2);
23797
- })()
23798
- )))))(0))((v) => Applicative0.pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2 })));
23893
+ $Tuple(
23894
+ modules$p,
23895
+ (() => {
23896
+ const $4 = dictFV.fv(e);
23897
+ return filterWithKey2((x) => {
23898
+ const $5 = setSet(ordString).member(x)($4);
23899
+ return (v$1) => $5;
23900
+ })(v._2);
23901
+ })()
23902
+ )
23903
+ ))))))(0))((v) => Monad0.Applicative0().pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2._2 }));
23799
23904
  };
23800
23905
  };
23801
23906
  };
@@ -23803,37 +23908,46 @@ var initialConfig = (dictMonadAff) => {
23803
23908
  var prepConfig = (dictMonadAff) => {
23804
23909
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23805
23910
  const $0 = Monad0.Bind1();
23911
+ const loadModuleGraph1 = loadModuleGraph(dictMonadAff);
23806
23912
  const initialConfig1 = initialConfig(dictMonadAff);
23807
23913
  return (dictMonadError) => {
23914
+ const loadModuleGraph2 = loadModuleGraph1(dictMonadError);
23808
23915
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
23809
23916
  const initialConfig2 = initialConfig1(dictMonadError);
23810
23917
  return (dictMonadReader) => {
23811
- const ask = dictMonadReader.MonadAsk0().ask;
23918
+ const loadModuleGraph3 = loadModuleGraph2(dictMonadReader);
23812
23919
  const initialConfig3 = initialConfig2(dictMonadReader);
23813
23920
  return (dictLoadFile) => {
23921
+ const loadModuleGraph4 = loadModuleGraph3(dictLoadFile);
23814
23922
  const initialConfig4 = initialConfig3(dictLoadFile)(fVExpr);
23815
- return (file) => (progCxt) => $0.bind(ask)((v) => $0.bind(parseProgram(dictLoadFile)(v.fluidSrcPaths)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig4(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
23816
- s,
23817
- e,
23818
- gconfig
23819
- })))));
23923
+ return (progCxt) => (fluidSrc) => $0.bind(parse(dictMonadError)(fluidSrc)(withImports(expr_)))((v) => {
23924
+ const $1 = v._1;
23925
+ return $0.bind(loadModuleGraph4($List("Cons", "lib/prelude", v._2)))((moduleCxt) => $0.bind(desug1($1))((e) => $0.bind(initialConfig4(e)(progCxt)(moduleCxt))((gconfig) => Monad0.Applicative0().pure({
23926
+ s: $1,
23927
+ e,
23928
+ gconfig
23929
+ }))));
23930
+ });
23820
23931
  };
23821
23932
  };
23822
23933
  };
23823
23934
  };
23824
23935
  var datasetAs = (dictMonadAff) => {
23825
23936
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23826
- const $0 = Monad0.Bind1();
23937
+ const Bind1 = Monad0.Bind1();
23827
23938
  return (dictMonadError) => {
23828
23939
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
23829
- return (dictLoadFile) => (folders) => (v) => (v1) => {
23830
- const $1 = v1.datasets;
23831
- const $2 = v._1;
23832
- return $0.bind($0.bind(parseProgram(dictLoadFile)(folders)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
23833
- primitives: v1.primitives,
23834
- mods: v1.mods,
23835
- datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
23836
- }));
23940
+ return (dictLoadFile) => {
23941
+ const loadFile3 = loadFile(dictLoadFile)(Monad0)(dictMonadError)(dictMonadAff);
23942
+ return (folders) => (v) => (v1) => {
23943
+ const $0 = v1.datasets;
23944
+ const $1 = v._1;
23945
+ return Bind1.bind(loadFile3(folders)(v._2))((src) => Bind1.bind(Bind1.bind(Bind1.Apply0().Functor0().map(fst)(parse(dictMonadError)(src)(withImports(expr_))))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
23946
+ primitives: v1.primitives,
23947
+ mods: v1.mods,
23948
+ datasets: $List("Cons", $Tuple($1, e\u03B1), $0)
23949
+ })));
23950
+ };
23837
23951
  };
23838
23952
  };
23839
23953
  };
@@ -23841,21 +23955,18 @@ var loadProgCxt = (dictMonadAff) => {
23841
23955
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23842
23956
  const $0 = Monad0.Bind1();
23843
23957
  const concatM1 = concatM2(Monad0);
23844
- const module_1 = module_2(dictMonadAff);
23845
23958
  const datasetAs1 = datasetAs(dictMonadAff);
23846
23959
  return (dictMonadError) => {
23847
- const module_22 = module_1(dictMonadError);
23848
23960
  const datasetAs2 = datasetAs1(dictMonadError);
23849
23961
  return (dictMonadReader) => {
23850
23962
  const ask = dictMonadReader.MonadAsk0().ask;
23851
23963
  return (dictLoadFile) => {
23852
- const module_3 = module_22(dictLoadFile);
23853
23964
  const datasetAs3 = datasetAs2(dictLoadFile);
23854
- return (mods) => (datasets) => $0.bind(ask)((v) => $0.bind($0.bind(Monad0.Applicative0().pure({
23965
+ return (datasets) => $0.bind(ask)((v) => $0.bind(Monad0.Applicative0().pure({
23855
23966
  primitives,
23856
23967
  mods: Nil,
23857
23968
  datasets: Nil
23858
- }))(concatM1(arrayMap(module_3(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
23969
+ }))(concatM1(arrayMap((() => {
23859
23970
  const $1 = datasetAs3(v.fluidSrcPaths);
23860
23971
  return (x) => $1($Tuple(x._1, x._2));
23861
23972
  })())(datasets))));
@@ -23868,11 +23979,6 @@ var loadProgCxt = (dictMonadAff) => {
23868
23979
  var $Encoding = (tag) => tag;
23869
23980
  var UTF8 = /* @__PURE__ */ $Encoding("UTF8");
23870
23981
 
23871
- // output-es/Data.Nullable/foreign.js
23872
- function nullable(a, r, f) {
23873
- return a == null ? r : f(a);
23874
- }
23875
-
23876
23982
  // output-es/Node.FS.Constants/foreign.js
23877
23983
  import { constants } from "node:fs";
23878
23984
  var f_OK = constants.F_OK;
@@ -23980,47 +24086,24 @@ var toAff2 = (f) => (a) => (b) => {
23980
24086
  });
23981
24087
  };
23982
24088
 
23983
- // output-es/Foreign/foreign.js
23984
- var isArray = Array.isArray || function(value) {
23985
- return Object.prototype.toString.call(value) === "[object Array]";
23986
- };
23987
-
23988
24089
  // output-es/Node.FS.Stats/foreign.js
23989
24090
  var isFileImpl = (s) => s.isFile();
23990
24091
 
23991
24092
  // output-es/Module.Node/index.js
23992
24093
  var $$try3 = /* @__PURE__ */ $$try(monadErrorAff);
23993
- var findM = (dictMonad) => {
23994
- const $0 = dictMonad.Bind1().Apply0();
23995
- return (dictFoldable) => (xs) => (f) => (base) => dictFoldable.foldr((x) => (acc) => $0.apply($0.Functor0().map(altMaybe.alt)(acc))(f(x)))(dictMonad.Applicative0().pure(base))(xs);
23996
- };
23997
24094
  var loadFileNodeT = (dictMonad) => {
23998
- const bind4 = bindReaderT(dictMonad.Bind1()).bind;
23999
- const $0 = dictMonad.Applicative0();
24000
- const findM1 = findM(monadReaderT(dictMonad))(foldableArray);
24095
+ const Bind1 = dictMonad.Bind1();
24096
+ const $0 = Bind1.Apply0().Functor0();
24097
+ const $1 = dictMonad.Applicative0();
24001
24098
  return {
24002
- loadFile: (dictMonadError) => (dictMonadAff) => (folders) => (v) => bind4(findM1(arrayMap((() => {
24003
- const $1 = v + ".fld";
24004
- return (a) => a + "/" + $1;
24005
- })())(folders))((v1) => bind4(dictMonadAff.liftAff($$try3(toAff1(stat2)(v1))))((stats) => {
24006
- const $1 = $0.pure((() => {
24007
- if (stats.tag === "Left") {
24008
- return false;
24009
- }
24010
- if (stats.tag === "Right") {
24011
- return isFileImpl(stats._1);
24012
- }
24013
- fail();
24014
- })() ? $Maybe("Just", v1) : Nothing);
24015
- return (v$1) => $1;
24016
- }))(Nothing))((url) => {
24017
- if (url.tag === "Nothing") {
24018
- return throwException(error("File " + v + " not found."))();
24019
- }
24020
- if (url.tag === "Just") {
24021
- return dictMonadAff.liftAff(toAff2(readTextFile)(UTF8)(url._1));
24022
- }
24023
- fail();
24099
+ loadFileFromPath: (dictMonadError) => (dictMonadAff) => (v) => bindReaderT(Bind1).bind(dictMonadAff.liftAff($$try3(toAff1(stat2)(v))))((stats) => {
24100
+ if (stats.tag === "Right" && isFileImpl(stats._1)) {
24101
+ const $22 = $0.map(Just);
24102
+ const $3 = dictMonadAff.liftAff(toAff2(readTextFile)(UTF8)(v));
24103
+ return (x) => $22($3(x));
24104
+ }
24105
+ const $2 = $1.pure(Nothing);
24106
+ return (v$1) => $2;
24024
24107
  })
24025
24108
  };
24026
24109
  };
@@ -24808,7 +24891,7 @@ var manyM = (p) => freeMonadRec.tailRecM((acc) => $Free(
24808
24891
  var $DefaultProp = (_1, _2) => ({ tag: "DefaultProp", _1, _2 });
24809
24892
  var $Mod = (_1, _2, _3) => ({ tag: "Mod", _1, _2, _3 });
24810
24893
  var lookup4 = /* @__PURE__ */ lookup(foldableArray)(eqString);
24811
- var identity26 = (x) => x;
24894
+ var identity28 = (x) => x;
24812
24895
  var Mod = (value0) => (value1) => (value2) => $Mod(value0, value1, value2);
24813
24896
  var optionFieldsHasName = { name: (n) => (fields) => ({ optNames: [n, ...fields.optNames], optCompleter: fields.optCompleter, optNoArgError: fields.optNoArgError }) };
24814
24897
  var mkCommand = (m) => {
@@ -24819,8 +24902,8 @@ var mkCommand = (m) => {
24819
24902
  var modSemigroup = {
24820
24903
  append: (v) => (v1) => $Mod((x) => v1._1(v._1(x)), $DefaultProp(v1._2._1.tag === "Nothing" ? v._2._1 : v1._2._1, v1._2._2.tag === "Nothing" ? v._2._2 : v1._2._2), (x) => v1._3(v._3(x)))
24821
24904
  };
24822
- var modMonoid = { mempty: /* @__PURE__ */ $Mod(identity26, /* @__PURE__ */ $DefaultProp(Nothing, Nothing), identity26), Semigroup0: () => modSemigroup };
24823
- var optionMod = /* @__PURE__ */ Mod(identity26)(/* @__PURE__ */ $DefaultProp(Nothing, Nothing));
24905
+ var modMonoid = { mempty: /* @__PURE__ */ $Mod(identity28, /* @__PURE__ */ $DefaultProp(Nothing, Nothing), identity28), Semigroup0: () => modSemigroup };
24906
+ var optionMod = /* @__PURE__ */ Mod(identity28)(/* @__PURE__ */ $DefaultProp(Nothing, Nothing));
24824
24907
  var internal = /* @__PURE__ */ optionMod((p) => ({ propVisibility: Internal, propDescMod: p.propDescMod, propHelp: p.propHelp, propMetaVar: p.propMetaVar, propShowDefault: p.propShowDefault }));
24825
24908
  var baseProps = /* @__PURE__ */ (() => ({
24826
24909
  propMetaVar: "",
@@ -24851,7 +24934,7 @@ var mkParser = (v) => (g) => (rdr) => {
24851
24934
  };
24852
24935
 
24853
24936
  // output-es/Options.Applicative.Builder/index.js
24854
- var identity27 = (x) => x;
24937
+ var identity29 = (x) => x;
24855
24938
  var mempty12 = /* @__PURE__ */ (() => chunkMonoid(docSemigroup).mempty)();
24856
24939
  var min3 = (x) => (y) => {
24857
24940
  const v = optVisibilityOrd.compare(x)(y);
@@ -24951,19 +25034,19 @@ var defaultPrefs = {
24951
25034
  var command = (cmd) => (pinfo) => $Mod(
24952
25035
  (p) => ({ cmdCommands: [$Tuple(cmd, pinfo), ...p.cmdCommands], cmdGroup: p.cmdGroup }),
24953
25036
  $DefaultProp(Nothing, Nothing),
24954
- identity26
25037
+ identity28
24955
25038
  );
24956
25039
  var abortOption = (err) => (m) => {
24957
25040
  const $0 = fold3([
24958
25041
  $Mod(
24959
25042
  (p) => ({ optNoArgError: (v) => err, optCompleter: p.optCompleter, optNames: p.optNames }),
24960
25043
  $DefaultProp(Nothing, Nothing),
24961
- identity26
25044
+ identity28
24962
25045
  ),
24963
25046
  $Mod(
24964
- identity27,
24965
- $DefaultProp($Maybe("Just", identity27), Nothing),
24966
- identity27
25047
+ identity29,
25048
+ $DefaultProp($Maybe("Just", identity29), Nothing),
25049
+ identity29
24967
25050
  ),
24968
25051
  optionMod((p) => ({ propMetaVar: "", propDescMod: p.propDescMod, propHelp: p.propHelp, propShowDefault: p.propShowDefault, propVisibility: p.propVisibility }))
24969
25052
  ]);
@@ -25043,7 +25126,7 @@ var modify_ = /* @__PURE__ */ (() => {
25043
25126
  return (f) => $0.state((s) => $Tuple(void 0, f(s)));
25044
25127
  })();
25045
25128
  var throwError = /* @__PURE__ */ (() => monadThrowExceptT(monadStateT).throwError)();
25046
- var identity28 = (x) => x;
25129
+ var identity30 = (x) => x;
25047
25130
  var TNil = /* @__PURE__ */ $TStep("TNil");
25048
25131
  var ComplResult = (value0) => $ComplResult("ComplResult", value0);
25049
25132
  var runListT = (dictMonad) => (xs) => dictMonad.Bind1().bind(xs)((s) => {
@@ -25294,10 +25377,10 @@ var nondetTAltOp = (dictMonad) => {
25294
25377
  const monadStateT1 = { Applicative0: () => applicativeStateT(dictMonad), Bind1: () => bindStateT(dictMonad) };
25295
25378
  const listTBind1 = listTBind(monadStateT1);
25296
25379
  const lift6 = listTMonadTrans.lift(monadStateT1);
25297
- const $$get2 = monadStateStateT(dictMonad).state((s) => $Tuple(s, s));
25380
+ const $$get3 = monadStateStateT(dictMonad).state((s) => $Tuple(s, s));
25298
25381
  const $0 = listTAlternative(monadStateT1);
25299
25382
  const empty3 = $0.Plus1().empty;
25300
- return (m1) => (m2) => listTAlt(monadStateT1).alt(m1)(listTBind1.bind(lift6($$get2))((s) => listTBind1.bind(!s ? $0.Applicative0().pure() : empty3)(() => m2)));
25383
+ return (m1) => (m2) => listTAlt(monadStateT1).alt(m1)(listTBind1.bind(lift6($$get3))((s) => listTBind1.bind(!s ? $0.Applicative0().pure() : empty3)(() => m2)));
25301
25384
  };
25302
25385
  var nondetTFunctor = (dictMonad) => ({ map: (f) => listTFunctor({ Applicative0: () => applicativeStateT(dictMonad), Bind1: () => bindStateT(dictMonad) }).map(f) });
25303
25386
  var nondetTAlt = (dictMonad) => {
@@ -25341,7 +25424,7 @@ var takeListT = (dictMonad) => {
25341
25424
  if (v === 0) {
25342
25425
  return (v$1) => empty3;
25343
25426
  }
25344
- const $0 = bimapTStep(identity28)(takeListT(dictMonad)(v - 1 | 0));
25427
+ const $0 = bimapTStep(identity30)(takeListT(dictMonad)(v - 1 | 0));
25345
25428
  return (x) => dictMonad.Bind1().bind(x)((a$p) => dictMonad.Applicative0().pure($0(a$p)));
25346
25429
  };
25347
25430
  };
@@ -25360,7 +25443,7 @@ var any2 = /* @__PURE__ */ (() => foldableArray.foldMap((() => {
25360
25443
  const semigroupDisj1 = { append: (v) => (v1) => v || v1 };
25361
25444
  return { mempty: false, Semigroup0: () => semigroupDisj1 };
25362
25445
  })()))();
25363
- var elem2 = /* @__PURE__ */ (() => {
25446
+ var elem3 = /* @__PURE__ */ (() => {
25364
25447
  const any1 = foldableArray.foldMap((() => {
25365
25448
  const semigroupDisj1 = { append: (v) => (v1) => v || v1 };
25366
25449
  return { mempty: false, Semigroup0: () => semigroupDisj1 };
@@ -25469,16 +25552,16 @@ var optMatches = (dictMonadP) => {
25469
25552
  const Monad0 = dictMonadP.Monad0();
25470
25553
  const bindStateT2 = bindStateT(Monad0);
25471
25554
  const monadStateStateT2 = monadStateStateT(Monad0);
25472
- const $$get2 = monadStateStateT2.state((s) => $Tuple(s, s));
25555
+ const $$get3 = monadStateStateT2.state((s) => $Tuple(s, s));
25473
25556
  const $0 = applicativeStateT(Monad0);
25474
25557
  const $1 = dictMonadP.Monad0().Applicative0().pure;
25475
25558
  return (disambiguate) => (opt) => (v) => {
25476
25559
  if (opt.tag === "OptReader") {
25477
- const $2 = (disambiguate ? any2(isOptionPrefix(v._1))(opt._1) : elem2(v._1)(opt._1)) ? $Maybe("Just", void 0) : Nothing;
25560
+ const $2 = (disambiguate ? any2(isOptionPrefix(v._1))(opt._1) : elem3(v._1)(opt._1)) ? $Maybe("Just", void 0) : Nothing;
25478
25561
  if ($2.tag === "Just") {
25479
25562
  return $Maybe(
25480
25563
  "Just",
25481
- bindStateT2.bind($$get2)((args) => {
25564
+ bindStateT2.bind($$get3)((args) => {
25482
25565
  const missing_arg = dictMonadP.missingArgP(opt._3(showOption(v._1)))(opt._2.crCompleter);
25483
25566
  return bindStateT2.bind((() => {
25484
25567
  if (v._2.tag === "Nothing") {
@@ -25518,7 +25601,7 @@ var optMatches = (dictMonadP) => {
25518
25601
  }
25519
25602
  fail();
25520
25603
  }
25521
- if (opt.tag === "FlagReader" && (disambiguate ? any2(isOptionPrefix(v._1))(opt._1) : elem2(v._1)(opt._1)) && ((() => {
25604
+ if (opt.tag === "FlagReader" && (disambiguate ? any2(isOptionPrefix(v._1))(opt._1) : elem3(v._1)(opt._1)) && ((() => {
25522
25605
  if (v._1.tag === "OptShort") {
25523
25606
  return true;
25524
25607
  }
@@ -25537,7 +25620,7 @@ var optMatches = (dictMonadP) => {
25537
25620
  })())) {
25538
25621
  return $Maybe(
25539
25622
  "Just",
25540
- bindStateT2.bind($$get2)((args) => bindStateT2.bind((() => {
25623
+ bindStateT2.bind($$get3)((args) => bindStateT2.bind((() => {
25541
25624
  if (v._2.tag === "Just") {
25542
25625
  const $2 = $List("Cons", fromCharArray(["-", ...toCharArray(v._2._1)]), args);
25543
25626
  return monadStateStateT2.state((v$1) => $Tuple(void 0, $2));
@@ -25687,7 +25770,7 @@ var searchArg = (dictMonadP) => {
25687
25770
  const bindStateT2 = bindStateT(Monad0);
25688
25771
  const $1 = applyStateT(Monad0);
25689
25772
  const monadStateStateT2 = monadStateStateT(Monad0);
25690
- const $$get2 = monadStateStateT2.state((s) => $Tuple(s, s));
25773
+ const $$get3 = monadStateStateT2.state((s) => $Tuple(s, s));
25691
25774
  const $2 = dictMonadP.Alt1().Functor0();
25692
25775
  const Apply0 = Monad0.Bind1().Apply0();
25693
25776
  const exitContext = dictMonadP.exitContext;
@@ -25700,7 +25783,7 @@ var searchArg = (dictMonadP) => {
25700
25783
  if ($5.tag === "Just") {
25701
25784
  if (prefs.prefBacktrack === "NoBacktrack") {
25702
25785
  const $6 = $5._1;
25703
- return lift2(bindStateT2.bind($1.apply($1.Functor0().map($$const)($$get2))(monadStateStateT2.state((v) => $Tuple(void 0, Nil))))((args) => {
25786
+ return lift2(bindStateT2.bind($1.apply($1.Functor0().map($$const)($$get3))(monadStateStateT2.state((v) => $Tuple(void 0, Nil))))((args) => {
25704
25787
  const $7 = Apply0.apply(Apply0.Functor0().map($$const)(Apply0.apply(Apply0.Functor0().map((v) => identity)(dictMonadP.enterContext(arg)($6)))(runParserInfo(dictMonadP)($6)(args))))(exitContext);
25705
25788
  return (s) => $2.map((v1) => $Tuple($Parser("NilP", v1._1), v1._2))(Monad0.Bind1().bind($7)((x) => Monad0.Applicative0().pure($Tuple(
25706
25789
  x,
@@ -25916,7 +25999,7 @@ var mapParser = (f) => {
25916
25999
  // output-es/Options.Applicative.BashCompletion/index.js
25917
26000
  var $Richness = (tag, _1, _2) => ({ tag, _1, _2 });
25918
26001
  var fromFoldable24 = /* @__PURE__ */ foldrArray(Cons)(Nil);
25919
- var identity29 = (x) => x;
26002
+ var identity31 = (x) => x;
25920
26003
  var fold4 = /* @__PURE__ */ (() => foldableArray.foldMap(monoidArray)(identity3))();
25921
26004
  var sequence = /* @__PURE__ */ (() => traversableArray.traverse(applicativeEffect)(identity4))();
25922
26005
  var unLines = (xs) => foldlArray((v) => (v1) => {
@@ -25925,7 +26008,7 @@ var unLines = (xs) => foldlArray((v) => (v1) => {
25925
26008
  }
25926
26009
  return { init: false, acc: v.acc + "\n" + v1 };
25927
26010
  })({ init: true, acc: "" })(xs).acc;
25928
- var fromFoldable111 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
26011
+ var fromFoldable110 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
25929
26012
  var Standard = /* @__PURE__ */ $Richness("Standard");
25930
26013
  var Enriched = (value0) => (value1) => $Richness("Enriched", value0, value1);
25931
26014
  var zshCompletionScript = (prog) => (progn) => {
@@ -26029,7 +26112,7 @@ var bashCompletionQuery = (pinfo) => (pprefs) => (richness) => (ws) => (i) => (v
26029
26112
  const $0 = arrayMap(showOption);
26030
26113
  const add_opt_help1 = (opt) => {
26031
26114
  if (richness.tag === "Standard") {
26032
- return identity29;
26115
+ return identity31;
26033
26116
  }
26034
26117
  if (richness.tag === "Enriched") {
26035
26118
  const $1 = richness._1;
@@ -26102,7 +26185,7 @@ var bashCompletionQuery = (pinfo) => (pprefs) => (richness) => (ws) => (i) => (v
26102
26185
  }
26103
26186
  const $22 = (() => {
26104
26187
  if (richness.tag === "Standard") {
26105
- return identity29;
26188
+ return identity31;
26106
26189
  }
26107
26190
  if (richness.tag === "Enriched") {
26108
26191
  const $23 = richness._2;
@@ -26238,7 +26321,7 @@ var bashCompletionParser = (pinfo) => (pprefs) => $Parser(
26238
26321
  ),
26239
26322
  $Parser("NilP", Standard)
26240
26323
  )),
26241
- parserFunctor.map(fromFoldable111)($Parser(
26324
+ parserFunctor.map(fromFoldable110)($Parser(
26242
26325
  "BindP",
26243
26326
  manyM(option(readerAsk)($Mod(
26244
26327
  (x) => internal._1({
@@ -26383,7 +26466,7 @@ var helpText = (v) => {
26383
26466
  var fold5 = /* @__PURE__ */ (() => foldableArray.foldMap(monoidArray)(identity3))();
26384
26467
  var chunkMonoid3 = /* @__PURE__ */ chunkMonoid(docSemigroup);
26385
26468
  var listToChunk2 = /* @__PURE__ */ listToChunk(docMonoid);
26386
- var identity30 = (x) => x;
26469
+ var identity32 = (x) => x;
26387
26470
  var mempty2 = /* @__PURE__ */ (() => $Tuple(monoidMaybe(semigroupString).mempty, chunkMonoid3.mempty))();
26388
26471
  var usageHelp = (chunk) => ({
26389
26472
  helpUsage: chunk,
@@ -26423,7 +26506,7 @@ var optDesc = (pprefs) => (style) => (info2) => (opt) => {
26423
26506
  })()));
26424
26507
  return (() => {
26425
26508
  if (opt.optProps.propDescMod.tag === "Nothing") {
26426
- return identity30;
26509
+ return identity32;
26427
26510
  }
26428
26511
  if (opt.optProps.propDescMod.tag === "Just") {
26429
26512
  return functorMaybe.map(opt.optProps.propDescMod._1);
@@ -27103,12 +27186,12 @@ var helper = /* @__PURE__ */ (() => abortOption(ShowHelpText)(foldableArray.fold
27103
27186
  $Mod(
27104
27187
  optionFieldsHasName.name($OptName("OptLong", "help")),
27105
27188
  $DefaultProp(Nothing, Nothing),
27106
- identity26
27189
+ identity28
27107
27190
  ),
27108
27191
  $Mod(
27109
27192
  optionFieldsHasName.name($OptName("OptShort", "h")),
27110
27193
  $DefaultProp(Nothing, Nothing),
27111
- identity26
27194
+ identity28
27112
27195
  ),
27113
27196
  help("Show this help text"),
27114
27197
  hidden
@@ -27194,9 +27277,9 @@ var monadErrorErrorNodeT = /* @__PURE__ */ monadErrorReaderT(monadErrorAff);
27194
27277
  var monadReaderFileCxtNodeT = /* @__PURE__ */ monadReaderReaderT(monadAff);
27195
27278
  var loadFileNodeT2 = /* @__PURE__ */ loadFileNodeT(monadAff);
27196
27279
  var loadProgCxt2 = /* @__PURE__ */ loadProgCxt(monadAffNodeT)(monadErrorErrorNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2);
27280
+ var loadFile2 = /* @__PURE__ */ loadFile(loadFileNodeT2)(/* @__PURE__ */ monadReaderT(monadAff))(monadErrorErrorNodeT)(monadAffNodeT);
27197
27281
  var prepConfig2 = /* @__PURE__ */ prepConfig(monadAffNodeT)(monadErrorErrorNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2);
27198
27282
  var graphEval2 = /* @__PURE__ */ graphEval(monadAffNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2)(monadErrorErrorNodeT);
27199
- var fromFoldable26 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
27200
27283
  var Evaluate = (value0) => $Command(value0);
27201
27284
  var parseLocal = /* @__PURE__ */ $Parser(
27202
27285
  "AltP",
@@ -27215,30 +27298,14 @@ var parseLocal = /* @__PURE__ */ $Parser(
27215
27298
  })()),
27216
27299
  /* @__PURE__ */ $Parser("NilP", false)
27217
27300
  );
27218
- var parseImports = /* @__PURE__ */ $Parser(
27219
- "BindP",
27220
- /* @__PURE__ */ manyM(/* @__PURE__ */ option(readerAsk)(/* @__PURE__ */ (() => {
27221
- const $0 = help("Comma-separated list of files to import");
27222
- const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
27223
- const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
27224
- return $Mod(
27225
- (x) => $0._1({
27226
- optNames: [$OptName("OptShort", "i"), $OptName("OptLong", "imports"), ...x.optNames],
27227
- optCompleter: x.optCompleter,
27228
- optNoArgError: x.optNoArgError
27229
- }),
27230
- $DefaultProp($1.tag === "Nothing" ? Nothing : $1, $2.tag === "Nothing" ? Nothing : $2),
27231
- (x) => $0._3(x)
27232
- );
27233
- })()))
27234
- );
27235
27301
  var evaluate = (v) => {
27236
27302
  const $0 = v._1.fileName;
27237
- return bind3(loadProgCxt2(v._1.imports)(v._1.datasets))((progCxt) => bind3(prepConfig2($0)(progCxt))((v1) => bind3(graphEval2(v1.gconfig)(v1.e))((v2) => {
27303
+ const fluidSrcPaths = [v._1.fluidSrcPath, ...v._1.local ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []];
27304
+ return bind3(loadProgCxt2(v._1.datasets))((progCxt) => bind3(loadFile2(fluidSrcPaths)($0))((fluidSrc) => bind3(prepConfig2(progCxt)(fluidSrc))((v1) => bind3(graphEval2(v1.gconfig)(v1.e))((v2) => {
27238
27305
  const $1 = _pure(functorVal.map((v$1) => {
27239
27306
  })(v2["out\u03B1"]));
27240
27307
  return (v$1) => $1;
27241
- })))({ fluidSrcPaths: [v._1.fluidSrcPath, ...v._1.local ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []] });
27308
+ }))))({ fluidSrcPaths });
27242
27309
  };
27243
27310
  var dispatchCommand = (v) => _bind(evaluate(v._1))((v1) => _liftEffect(log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v1)).lines))));
27244
27311
  var callback = (v) => {
@@ -27303,14 +27370,8 @@ var parseEvaluate = /* @__PURE__ */ (() => $Parser(
27303
27370
  $Parser(
27304
27371
  "MultP",
27305
27372
  $MultPE(
27306
- $Parser(
27307
- "MultP",
27308
- $MultPE(
27309
- parserFunctor.map((v) => (v1) => (v2) => (v3) => (v4) => $EvalArgs({ local: v, imports: v1, datasets: v2, fileName: v3, fluidSrcPath: v4 }))(parseLocal),
27310
- parserFunctor.map(fromFoldable26)(parseImports)
27311
- )
27312
- ),
27313
- parserFunctor.map(fromFoldable26)(parseDatasets)
27373
+ parserFunctor.map((v) => (v1) => (v2) => (v3) => $EvalArgs({ local: v, datasets: v1, fileName: v2, fluidSrcPath: v3 }))(parseLocal),
27374
+ parserFunctor.map(fromFoldableImpl(foldableList.foldr))(parseDatasets)
27314
27375
  )
27315
27376
  ),
27316
27377
  option(readerAsk)((() => {