@explorable-viz/fluid 0.7.100 → 0.7.101

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.
@@ -27,6 +27,75 @@ function intDiv(x, y) {
27
27
  return 0;
28
28
  }
29
29
 
30
+ // output-es/Control.Monad.Reader.Trans/index.js
31
+ var withReaderT = (f) => (v) => (x) => v(f(x));
32
+ var bindReaderT = (dictBind) => {
33
+ const $0 = dictBind.Apply0();
34
+ const $1 = $0.Functor0();
35
+ const applyReaderT1 = (() => {
36
+ const functorReaderT1 = {
37
+ map: (x) => {
38
+ const $2 = $1.map(x);
39
+ return (v) => (x$1) => $2(v(x$1));
40
+ }
41
+ };
42
+ return { apply: (v) => (v1) => (r) => $0.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
43
+ })();
44
+ return { bind: (v) => (k) => (r) => dictBind.bind(v(r))((a) => k(a)(r)), Apply0: () => applyReaderT1 };
45
+ };
46
+ var monadReaderT = (dictMonad) => {
47
+ const $0 = dictMonad.Applicative0();
48
+ const $1 = $0.Apply0();
49
+ const applicativeReaderT1 = (() => {
50
+ const $2 = $1.Functor0();
51
+ const functorReaderT1 = {
52
+ map: (x) => {
53
+ const $3 = $2.map(x);
54
+ return (v) => (x$1) => $3(v(x$1));
55
+ }
56
+ };
57
+ const applyReaderT1 = { apply: (v) => (v1) => (r) => $1.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
58
+ return {
59
+ pure: (x) => {
60
+ const $3 = $0.pure(x);
61
+ return (v) => $3;
62
+ },
63
+ Apply0: () => applyReaderT1
64
+ };
65
+ })();
66
+ const bindReaderT1 = bindReaderT(dictMonad.Bind1());
67
+ return { Applicative0: () => applicativeReaderT1, Bind1: () => bindReaderT1 };
68
+ };
69
+ var monadReaderReaderT = (dictMonad) => {
70
+ const monadReaderT12 = monadReaderT(dictMonad);
71
+ const monadAskReaderT1 = { ask: dictMonad.Applicative0().pure, Monad0: () => monadReaderT12 };
72
+ return { local: withReaderT, MonadAsk0: () => monadAskReaderT1 };
73
+ };
74
+ var monadEffectReader = (dictMonadEffect) => {
75
+ const monadReaderT12 = monadReaderT(dictMonadEffect.Monad0());
76
+ return {
77
+ liftEffect: (x) => {
78
+ const $0 = dictMonadEffect.liftEffect(x);
79
+ return (v) => $0;
80
+ },
81
+ Monad0: () => monadReaderT12
82
+ };
83
+ };
84
+ var monadThrowReaderT = (dictMonadThrow) => {
85
+ const monadReaderT12 = monadReaderT(dictMonadThrow.Monad0());
86
+ return {
87
+ throwError: (x) => {
88
+ const $0 = dictMonadThrow.throwError(x);
89
+ return (v) => $0;
90
+ },
91
+ Monad0: () => monadReaderT12
92
+ };
93
+ };
94
+ var monadErrorReaderT = (dictMonadError) => {
95
+ const monadThrowReaderT1 = monadThrowReaderT(dictMonadError.MonadThrow0());
96
+ return { catchError: (v) => (h) => (r) => dictMonadError.catchError(v(r))((e) => h(e)(r)), MonadThrow0: () => monadThrowReaderT1 };
97
+ };
98
+
30
99
  // output-es/Data.Function/index.js
31
100
  var $$const = (a) => (v) => a;
32
101
  var applyFlipped = (x) => (f) => f(x);
@@ -2599,45 +2668,6 @@ var force = function(l) {
2599
2668
  return l();
2600
2669
  };
2601
2670
 
2602
- // output-es/Control.Monad.Reader.Trans/index.js
2603
- var bindReaderT = (dictBind) => {
2604
- const $0 = dictBind.Apply0();
2605
- const $1 = $0.Functor0();
2606
- const applyReaderT1 = (() => {
2607
- const functorReaderT1 = {
2608
- map: (x) => {
2609
- const $2 = $1.map(x);
2610
- return (v) => (x$1) => $2(v(x$1));
2611
- }
2612
- };
2613
- return { apply: (v) => (v1) => (r) => $0.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
2614
- })();
2615
- return { bind: (v) => (k) => (r) => dictBind.bind(v(r))((a) => k(a)(r)), Apply0: () => applyReaderT1 };
2616
- };
2617
- var monadReaderT = (dictMonad) => {
2618
- const $0 = dictMonad.Applicative0();
2619
- const $1 = $0.Apply0();
2620
- const applicativeReaderT1 = (() => {
2621
- const $2 = $1.Functor0();
2622
- const functorReaderT1 = {
2623
- map: (x) => {
2624
- const $3 = $2.map(x);
2625
- return (v) => (x$1) => $3(v(x$1));
2626
- }
2627
- };
2628
- const applyReaderT1 = { apply: (v) => (v1) => (r) => $1.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
2629
- return {
2630
- pure: (x) => {
2631
- const $3 = $0.pure(x);
2632
- return (v) => $3;
2633
- },
2634
- Apply0: () => applyReaderT1
2635
- };
2636
- })();
2637
- const bindReaderT1 = bindReaderT(dictMonad.Bind1());
2638
- return { Applicative0: () => applicativeReaderT1, Bind1: () => bindReaderT1 };
2639
- };
2640
-
2641
2671
  // output-es/Control.Monad.State.Trans/index.js
2642
2672
  var evalStateT = (dictFunctor) => (v) => (s) => dictFunctor.map(fst)(v(s));
2643
2673
  var bindStateT = (dictMonad) => ({ bind: (v) => (f) => (s) => dictMonad.Bind1().bind(v(s))((v1) => f(v1._1)(v1._2)), Apply0: () => applyStateT(dictMonad) });
@@ -2653,6 +2683,27 @@ var applyStateT = (dictMonad) => {
2653
2683
  };
2654
2684
  };
2655
2685
  var applicativeStateT = (dictMonad) => ({ pure: (a) => (s) => dictMonad.Applicative0().pure($Tuple(a, s)), Apply0: () => applyStateT(dictMonad) });
2686
+ var monadAskStateT = (dictMonadAsk) => {
2687
+ const Monad0 = dictMonadAsk.Monad0();
2688
+ const monadStateT1 = { Applicative0: () => applicativeStateT(Monad0), Bind1: () => bindStateT(Monad0) };
2689
+ return {
2690
+ ask: (() => {
2691
+ const $0 = dictMonadAsk.ask;
2692
+ return (s) => Monad0.Bind1().bind($0)((x) => Monad0.Applicative0().pure($Tuple(x, s)));
2693
+ })(),
2694
+ Monad0: () => monadStateT1
2695
+ };
2696
+ };
2697
+ var monadReaderStateT = (dictMonadReader) => {
2698
+ const monadAskStateT1 = monadAskStateT(dictMonadReader.MonadAsk0());
2699
+ return {
2700
+ local: (x) => {
2701
+ const $0 = dictMonadReader.local(x);
2702
+ return (v) => (x$1) => $0(v(x$1));
2703
+ },
2704
+ MonadAsk0: () => monadAskStateT1
2705
+ };
2706
+ };
2656
2707
  var monadEffectState = (dictMonadEffect) => {
2657
2708
  const Monad0 = dictMonadEffect.Monad0();
2658
2709
  const monadStateT1 = { Applicative0: () => applicativeStateT(Monad0), Bind1: () => bindStateT(Monad0) };
@@ -2702,6 +2753,16 @@ var monadErrorStateT = (dictMonadError) => {
2702
2753
 
2703
2754
  // output-es/Effect.Aff.Class/index.js
2704
2755
  var monadAffAff = { liftAff: (x) => x, MonadEffect0: () => monadEffectAff };
2756
+ var monadAffReader = (dictMonadAff) => {
2757
+ const monadEffectReader2 = monadEffectReader(dictMonadAff.MonadEffect0());
2758
+ return {
2759
+ liftAff: (x) => {
2760
+ const $0 = dictMonadAff.liftAff(x);
2761
+ return (v) => $0;
2762
+ },
2763
+ MonadEffect0: () => monadEffectReader2
2764
+ };
2765
+ };
2705
2766
  var monadAffState = (dictMonadAff) => {
2706
2767
  const MonadEffect0 = dictMonadAff.MonadEffect0();
2707
2768
  const monadEffectState2 = monadEffectState(MonadEffect0);
@@ -9559,7 +9620,7 @@ function _mapWithKey(m0, f) {
9559
9620
  }
9560
9621
  return m;
9561
9622
  }
9562
- function _foldM(bind3) {
9623
+ function _foldM(bind4) {
9563
9624
  return function(f) {
9564
9625
  return function(mz) {
9565
9626
  return function(m) {
@@ -9571,7 +9632,7 @@ function _foldM(bind3) {
9571
9632
  }
9572
9633
  for (var k in m) {
9573
9634
  if (hasOwnProperty.call(m, k)) {
9574
- acc = bind3(acc)(g(k));
9635
+ acc = bind4(acc)(g(k));
9575
9636
  }
9576
9637
  }
9577
9638
  return acc;
@@ -17962,8 +18023,8 @@ var isZeroNumber = { isZero: ($0) => 0 === $0 };
17962
18023
  var isZeroInt = { isZero: ($0) => 0 === $0 };
17963
18024
  var unary = (dictBoundedJoinSemilattice) => {
17964
18025
  const bot = dictBoundedJoinSemilattice.bot;
17965
- return (id) => (f) => $Tuple(
17966
- id,
18026
+ return (id2) => (f) => $Tuple(
18027
+ id2,
17967
18028
  $Val(
17968
18029
  bot,
17969
18030
  None,
@@ -17972,12 +18033,12 @@ var unary = (dictBoundedJoinSemilattice) => {
17972
18033
  $Fun(
17973
18034
  "Foreign",
17974
18035
  $Tuple(
17975
- id,
18036
+ id2,
17976
18037
  $ForeignOp$p({
17977
18038
  arity: 1,
17978
18039
  op: (dictMonadWithGraphAlloc) => {
17979
18040
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
17980
- return (dictMonadError) => (dictLoadFile) => (v) => {
18041
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
17981
18042
  if (v.tag === "Cons" && v._2.tag === "Nil") {
17982
18043
  const $0 = v._1._2;
17983
18044
  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))));
@@ -18111,8 +18172,8 @@ var $$boolean = {
18111
18172
  };
18112
18173
  var binaryZero = (dictBoundedJoinSemilattice) => {
18113
18174
  const bot = dictBoundedJoinSemilattice.bot;
18114
- return (dictIsZero) => (id) => (f) => $Tuple(
18115
- id,
18175
+ return (dictIsZero) => (id2) => (f) => $Tuple(
18176
+ id2,
18116
18177
  $Val(
18117
18178
  bot,
18118
18179
  None,
@@ -18121,12 +18182,12 @@ var binaryZero = (dictBoundedJoinSemilattice) => {
18121
18182
  $Fun(
18122
18183
  "Foreign",
18123
18184
  $Tuple(
18124
- id,
18185
+ id2,
18125
18186
  $ForeignOp$p({
18126
18187
  arity: 2,
18127
18188
  op: (dictMonadWithGraphAlloc) => {
18128
18189
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18129
- return (dictMonadError) => (dictLoadFile) => (v) => {
18190
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
18130
18191
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
18131
18192
  const $0 = f.i.unpack(v._1._3);
18132
18193
  const $1 = f.i.unpack(v._2._1._3);
@@ -18159,8 +18220,8 @@ var binaryZero = (dictBoundedJoinSemilattice) => {
18159
18220
  };
18160
18221
  var binary = (dictBoundedJoinSemilattice) => {
18161
18222
  const bot = dictBoundedJoinSemilattice.bot;
18162
- return (id) => (f) => $Tuple(
18163
- id,
18223
+ return (id2) => (f) => $Tuple(
18224
+ id2,
18164
18225
  $Val(
18165
18226
  bot,
18166
18227
  None,
@@ -18169,12 +18230,12 @@ var binary = (dictBoundedJoinSemilattice) => {
18169
18230
  $Fun(
18170
18231
  "Foreign",
18171
18232
  $Tuple(
18172
- id,
18233
+ id2,
18173
18234
  $ForeignOp$p({
18174
18235
  arity: 2,
18175
18236
  op: (dictMonadWithGraphAlloc) => {
18176
18237
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18177
- return (dictMonadError) => (dictLoadFile) => (v) => {
18238
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
18178
18239
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
18179
18240
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
18180
18241
  "Two",
@@ -18374,23 +18435,28 @@ var closeDefs = (dictMonadWithGraphAlloc) => {
18374
18435
  };
18375
18436
  var new$p = (dictMonadWithGraphAlloc) => {
18376
18437
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18377
- const MonadWithGraph2 = dictMonadWithGraphAlloc.MonadWithGraph2();
18378
- const Monad0 = MonadWithGraph2.Monad0();
18379
- const Bind1 = Monad0.Bind1();
18380
18438
  const fresh = dictMonadWithGraphAlloc.MonadAlloc0().fresh;
18381
- return (dictLoadFile) => (v) => (v1) => (v2) => (v3) => {
18382
- if (v2.tag === "None") {
18383
- return $$new((\u03B1s$p) => (u$p) => $Val(\u03B1s$p, None, u$p))(v1)(v3);
18384
- }
18385
- return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18386
- const $0 = {};
18387
- $0.this = $Val(\u03B1, None, v3);
18388
- return $0;
18389
- })()))(v2))((vdoc) => Bind1.bind(MonadWithGraph2.extend($Tuple(\u03B1, pack3($Val(\u03B1, vdoc, v3))))(v1))(() => Monad0.Applicative0().pure($Val(\u03B1, vdoc, v3)))));
18439
+ return (dictMonadReader) => (dictMonadAff) => {
18440
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18441
+ const Bind1 = Monad0.Bind1();
18442
+ return (dictLoadFile) => (v) => (v1) => (v2) => (v3) => {
18443
+ if (v2.tag === "None") {
18444
+ return $$new((\u03B1s$p) => (u$p) => $Val(\u03B1s$p, None, u$p))(v1)(v3);
18445
+ }
18446
+ return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18447
+ const $0 = {};
18448
+ $0.this = $Val(\u03B1, None, v3);
18449
+ return $0;
18450
+ })()))(v2))((vdoc) => Bind1.bind(dictMonadWithGraphAlloc.MonadWithGraph2().extend($Tuple(\u03B1, pack3($Val(\u03B1, vdoc, v3))))(v1))(() => Monad0.Applicative0().pure($Val(
18451
+ \u03B1,
18452
+ vdoc,
18453
+ v3
18454
+ )))));
18455
+ };
18390
18456
  };
18391
18457
  };
18392
- var evalDocOpt = (dictMonadWithGraphAlloc) => {
18393
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18458
+ var evalDocOpt = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
18459
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18394
18460
  const Applicative0 = Monad0.Applicative0();
18395
18461
  const $0 = Monad0.Bind1().Apply0().Functor0();
18396
18462
  const sequence2 = traversableList.traverse(Applicative0)(identity5);
@@ -18404,7 +18470,7 @@ var evalDocOpt = (dictMonadWithGraphAlloc) => {
18404
18470
  return Applicative0.pure($DocCommentElem("Token", v2._1));
18405
18471
  }
18406
18472
  if (v2.tag === "Unquote") {
18407
- return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v2._1)(setSet4.empty));
18473
+ return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v2._1)(setSet4.empty));
18408
18474
  }
18409
18475
  fail();
18410
18476
  })(v1._1)));
@@ -18416,195 +18482,210 @@ var $$eval = (dictMonadWithGraphAlloc) => {
18416
18482
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
18417
18483
  const withMsg2 = withMsg(MonadError1);
18418
18484
  const MonadThrow0 = MonadError1.MonadThrow0();
18419
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18420
- const Bind1 = Monad0.Bind1();
18421
- const $0 = Bind1.Apply0().Functor0();
18422
- const Applicative0 = Monad0.Applicative0();
18423
- const traverse2 = traversableList.traverse(Applicative0);
18424
- const traverse3 = traversablePair.traverse(Applicative0);
18425
18485
  const checkArity2 = checkArity(MonadError1);
18426
- const sequence2 = traversableArray.traverse(Applicative0)(identity4);
18427
18486
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18428
18487
  const match1 = match(dictMonadWithGraphAlloc);
18429
18488
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
18430
- return (dictLoadFile) => (v) => (v1) => (v2) => {
18431
- if (v1.tag === "Var") {
18432
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
18433
- }
18434
- if (v1.tag === "Op") {
18435
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
18436
- }
18437
- if (v1.tag === "Int") {
18438
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Int", v1._3));
18439
- }
18440
- if (v1.tag === "Float") {
18441
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Float", v1._3));
18442
- }
18443
- if (v1.tag === "Str") {
18444
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Str", v1._3));
18445
- }
18446
- if (v1.tag === "Dictionary") {
18447
- const $1 = v1._2;
18448
- const $2 = v1._1;
18449
- return Bind1.bind($0.map(unzip3)(traverse2(traverse3((() => {
18450
- const $3 = $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v);
18451
- return (a) => $3(a)(v2);
18452
- })()))(v1._3)))((v3) => {
18453
- 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));
18454
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)($2)()(v2))($1)($BaseVal(
18455
- "Dictionary",
18456
- fromFoldable17(zipWith2(Tuple)(v4._1)(zipWith2(Tuple)(v4._2)(v3._2)))
18489
+ return (dictMonadReader) => (dictMonadAff) => {
18490
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18491
+ const Bind1 = Monad0.Bind1();
18492
+ const $0 = Bind1.Apply0().Functor0();
18493
+ const Applicative0 = Monad0.Applicative0();
18494
+ const traverse2 = traversableList.traverse(Applicative0);
18495
+ const traverse3 = traversablePair.traverse(Applicative0);
18496
+ const sequence2 = traversableArray.traverse(Applicative0)(identity4);
18497
+ return (dictLoadFile) => (v) => (v1) => (v2) => {
18498
+ if (v1.tag === "Var") {
18499
+ return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
18500
+ }
18501
+ if (v1.tag === "Op") {
18502
+ return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
18503
+ }
18504
+ 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
18457
18508
  ));
18458
- });
18459
- }
18460
- if (v1.tag === "Constr") {
18461
- const $1 = v1._3;
18462
- const $2 = v1._2;
18463
- const $3 = v1._4;
18464
- const $4 = v1._1;
18465
- return Bind1.bind(checkArity2($1)((() => {
18466
- const go = (go$a0$copy) => (go$a1$copy) => {
18467
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18468
- while (go$c) {
18469
- const b = go$a0, v$1 = go$a1;
18470
- if (v$1.tag === "Nil") {
18471
- go$c = false;
18472
- go$r = b;
18473
- continue;
18474
- }
18475
- if (v$1.tag === "Cons") {
18476
- go$a0 = b + 1 | 0;
18477
- go$a1 = v$1._2;
18478
- continue;
18509
+ }
18510
+ 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
+ ));
18515
+ }
18516
+ 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
+ ));
18521
+ }
18522
+ if (v1.tag === "Dictionary") {
18523
+ const $1 = v1._2;
18524
+ const $2 = v1._1;
18525
+ return Bind1.bind($0.map(unzip3)(traverse2(traverse3((() => {
18526
+ const $3 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
18527
+ return (a) => $3(a)(v2);
18528
+ })()))(v1._3)))((v3) => {
18529
+ 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(
18531
+ "Dictionary",
18532
+ fromFoldable17(zipWith2(Tuple)(v4._1)(zipWith2(Tuple)(v4._2)(v3._2)))
18533
+ ));
18534
+ });
18535
+ }
18536
+ if (v1.tag === "Constr") {
18537
+ const $1 = v1._3;
18538
+ const $2 = v1._2;
18539
+ const $3 = v1._4;
18540
+ const $4 = v1._1;
18541
+ return Bind1.bind(checkArity2($1)((() => {
18542
+ const go = (go$a0$copy) => (go$a1$copy) => {
18543
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18544
+ while (go$c) {
18545
+ const b = go$a0, v$1 = go$a1;
18546
+ if (v$1.tag === "Nil") {
18547
+ go$c = false;
18548
+ go$r = b;
18549
+ continue;
18550
+ }
18551
+ if (v$1.tag === "Cons") {
18552
+ go$a0 = b + 1 | 0;
18553
+ go$a1 = v$1._2;
18554
+ continue;
18555
+ }
18556
+ fail();
18479
18557
  }
18480
- fail();
18481
- }
18482
- return go$r;
18483
- };
18484
- return go(0)($3);
18485
- })()))(() => Bind1.bind(traverse2((() => {
18486
- const $5 = $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v);
18487
- return (a) => $5(a)(v2);
18488
- })())($3))((vs) => new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)($4)()(v2))($2)($BaseVal("Constr", $1, vs))));
18489
- }
18490
- if (v1.tag === "Matrix") {
18491
- const $1 = v1._2;
18492
- const $2 = v1._3;
18493
- const $3 = v1._4._1;
18494
- const $4 = v1._4._2;
18495
- const $5 = v1._1;
18496
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
18497
- const v5 = intPair.unpack(v3._3);
18498
- const $6 = v5._1._1;
18499
- const $7 = v5._2._1;
18500
- const $8 = v5._1._2;
18501
- const $9 = v5._2._2;
18502
- return Bind1.bind(check(MonadThrow0)(greaterThanOrEq($Tuple($6, $7))($Tuple(1, 1)))("array must be at least (" + show3($Tuple(1, 1)) + "); got (" + show3($Tuple(
18503
- $6,
18504
- $7
18505
- )) + ")"))(() => Bind1.bind(sequence2(arrayBind(range(1)($6))((i) => [
18506
- sequence2(arrayBind(range(1)($7))((j) => [
18507
- $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(disjointUnion2((() => {
18508
- const $10 = {};
18509
- $10[$3] = $Val($8, None, $BaseVal("Int", i));
18510
- return $10;
18511
- })())((() => {
18512
- const $10 = {};
18513
- $10[$4] = $Val($9, None, $BaseVal("Int", j));
18514
- return $10;
18515
- })())))($2)(v2)
18516
- ]))
18517
- ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert(ordVertex)($5)()(v2))($1)($BaseVal(
18518
- "Matrix",
18519
- $Tuple(vss, $Tuple($Tuple($6, $8), $Tuple($7, $9)))
18558
+ return go$r;
18559
+ };
18560
+ return go(0)($3);
18561
+ })()))(() => Bind1.bind(traverse2((() => {
18562
+ const $5 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
18563
+ 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
18520
18568
  ))));
18521
- });
18522
- }
18523
- if (v1.tag === "Lambda") {
18524
- return $$new((a) => Val(a)(None))(insert(ordVertex)(v1._1)()(v2))($BaseVal(
18525
- "Fun",
18526
- $Fun(
18527
- "Closure",
18528
- (() => {
18529
- const $1 = fVElim.fv(v1._2);
18530
- return filterWithKey2((x) => {
18531
- const $2 = setSet(ordString).member(x)($1);
18532
- return (v$1) => $2;
18533
- })(v);
18534
- })(),
18535
- empty,
18536
- v1._2
18537
- )
18538
- ));
18539
- }
18540
- if (v1.tag === "Project") {
18541
- const $1 = v1._1;
18542
- const $2 = v1._3;
18543
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
18544
- if (v3._3.tag === "Dictionary") {
18545
- return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $2 + '" not found')((() => {
18546
- const $3 = _lookup(Nothing, Just, $2, v3._3._1);
18547
- if ($3.tag === "Just") {
18548
- return $Maybe("Just", $3._1._2);
18549
- }
18550
- return Nothing;
18551
- })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v$p)($1));
18552
- }
18553
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dictionary"));
18554
- });
18555
- }
18556
- if (v1.tag === "DProject") {
18557
- const $1 = v1._1;
18558
- const $2 = v1._3;
18559
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)($2)(v2))((v$p) => {
18560
- if (v3._3.tag === "Dictionary") {
18561
- if (v$p._3.tag === "Str") {
18562
- return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
18563
- const $3 = _lookup(Nothing, Just, v$p._3._1, v3._3._1);
18569
+ }
18570
+ if (v1.tag === "Matrix") {
18571
+ const $1 = v1._2;
18572
+ const $2 = v1._3;
18573
+ const $3 = v1._4._1;
18574
+ const $4 = v1._4._2;
18575
+ const $5 = v1._1;
18576
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
18577
+ const v5 = intPair.unpack(v3._3);
18578
+ const $6 = v5._1._1;
18579
+ const $7 = v5._2._1;
18580
+ const $8 = v5._1._2;
18581
+ const $9 = v5._2._2;
18582
+ return Bind1.bind(check(MonadThrow0)(greaterThanOrEq($Tuple($6, $7))($Tuple(1, 1)))("array must be at least (" + show3($Tuple(
18583
+ 1,
18584
+ 1
18585
+ )) + "); got (" + show3($Tuple($6, $7)) + ")"))(() => Bind1.bind(sequence2(arrayBind(range(1)($6))((i) => [
18586
+ sequence2(arrayBind(range(1)($7))((j) => [
18587
+ $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(disjointUnion2((() => {
18588
+ const $10 = {};
18589
+ $10[$3] = $Val($8, None, $BaseVal("Int", i));
18590
+ return $10;
18591
+ })())((() => {
18592
+ const $10 = {};
18593
+ $10[$4] = $Val($9, None, $BaseVal("Int", j));
18594
+ return $10;
18595
+ })())))($2)(v2)
18596
+ ]))
18597
+ ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert(ordVertex)($5)()(v2))($1)($BaseVal(
18598
+ "Matrix",
18599
+ $Tuple(vss, $Tuple($Tuple($6, $8), $Tuple($7, $9)))
18600
+ ))));
18601
+ });
18602
+ }
18603
+ if (v1.tag === "Lambda") {
18604
+ return $$new((a) => Val(a)(None))(insert(ordVertex)(v1._1)()(v2))($BaseVal(
18605
+ "Fun",
18606
+ $Fun(
18607
+ "Closure",
18608
+ (() => {
18609
+ const $1 = fVElim.fv(v1._2);
18610
+ return filterWithKey2((x) => {
18611
+ const $2 = setSet(ordString).member(x)($1);
18612
+ return (v$1) => $2;
18613
+ })(v);
18614
+ })(),
18615
+ empty,
18616
+ v1._2
18617
+ )
18618
+ ));
18619
+ }
18620
+ if (v1.tag === "Project") {
18621
+ const $1 = v1._1;
18622
+ const $2 = v1._3;
18623
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
18624
+ if (v3._3.tag === "Dictionary") {
18625
+ return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $2 + '" not found')((() => {
18626
+ const $3 = _lookup(Nothing, Just, $2, v3._3._1);
18564
18627
  if ($3.tag === "Just") {
18565
18628
  return $Maybe("Just", $3._1._2);
18566
18629
  }
18567
18630
  return Nothing;
18568
- })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v$p$p)($1));
18631
+ })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p)($1));
18569
18632
  }
18570
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v$p)).lines) + ", expected string"));
18571
- }
18572
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dict"));
18573
- }));
18574
- }
18575
- if (v1.tag === "App") {
18576
- const $1 = v1._1;
18577
- const $2 = v1._3;
18578
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)($2)(v2))((v$p) => Bind1.bind(apply2(dictMonadWithGraphAlloc)(dictLoadFile)(v3)(v$p))((v4) => {
18579
- const $3 = v4._3;
18580
- const $4 = v4._1;
18581
- return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18582
- const $5 = {};
18583
- $5.this = v4;
18584
- return $5;
18585
- })()))($1))((vdoc) => Applicative0.pure($Val($4, vdoc, $3)));
18586
- })));
18587
- }
18588
- if (v1.tag === "Let") {
18589
- const $1 = v1._2;
18590
- const $2 = v1._1._1;
18591
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._1._2)(v2))((v3) => Bind1.bind(match1(v3)($2))((v4) => $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(v4._1))($1)(v4._2._2)));
18592
- }
18593
- if (v1.tag === "LetRec") {
18594
- const $1 = v1._2;
18595
- const $2 = v1._1._1;
18596
- return Bind1.bind(closeDefs1(v)(v1._1._2)(insert(ordVertex)($2)()(v2)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(v)(\u03B3$p))($1)(insert(ordVertex)($2)()(v2)));
18597
- }
18598
- fail();
18633
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dictionary"));
18634
+ });
18635
+ }
18636
+ if (v1.tag === "DProject") {
18637
+ const $1 = v1._1;
18638
+ 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) => {
18640
+ if (v3._3.tag === "Dictionary") {
18641
+ if (v$p._3.tag === "Str") {
18642
+ return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
18643
+ const $3 = _lookup(Nothing, Just, v$p._3._1, v3._3._1);
18644
+ if ($3.tag === "Just") {
18645
+ return $Maybe("Just", $3._1._2);
18646
+ }
18647
+ return Nothing;
18648
+ })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p$p)($1));
18649
+ }
18650
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v$p)).lines) + ", expected string"));
18651
+ }
18652
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dict"));
18653
+ }));
18654
+ }
18655
+ if (v1.tag === "App") {
18656
+ const $1 = v1._1;
18657
+ 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) => {
18659
+ const $3 = v4._3;
18660
+ const $4 = v4._1;
18661
+ return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(v)((() => {
18662
+ const $5 = {};
18663
+ $5.this = v4;
18664
+ return $5;
18665
+ })()))($1))((vdoc) => Applicative0.pure($Val($4, vdoc, $3)));
18666
+ })));
18667
+ }
18668
+ if (v1.tag === "Let") {
18669
+ const $1 = v1._2;
18670
+ 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)));
18672
+ }
18673
+ if (v1.tag === "LetRec") {
18674
+ const $1 = v1._2;
18675
+ 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)));
18677
+ }
18678
+ fail();
18679
+ };
18599
18680
  };
18600
18681
  };
18601
- var concatDocs = (dictMonadWithGraphAlloc) => {
18602
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18682
+ var concatDocs = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
18683
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
18603
18684
  return (dictLoadFile) => (\u03B3) => (v) => (doc) => {
18604
18685
  const $0 = v._3;
18605
18686
  const $1 = v._2;
18606
18687
  const $2 = v._1;
18607
- return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith2((v$1) => identity13)(\u03B3)((() => {
18688
+ return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith2((v$1) => identity13)(\u03B3)((() => {
18608
18689
  const $3 = {};
18609
18690
  $3.this = $Val($2, None, $0);
18610
18691
  return $3;
@@ -18612,163 +18693,183 @@ var concatDocs = (dictMonadWithGraphAlloc) => {
18612
18693
  };
18613
18694
  };
18614
18695
  var apply2 = (dictMonadWithGraphAlloc) => {
18615
- const Bind1 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0().Bind1();
18616
18696
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
18617
18697
  const match1 = match(dictMonadWithGraphAlloc);
18618
18698
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
18619
18699
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
18620
18700
  const MonadThrow0 = MonadError1.MonadThrow0();
18621
- return (dictLoadFile) => (v) => (v1) => {
18622
- const $0 = (v2) => MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v2)).lines) + ", expected function"));
18623
- if (v._3.tag === "Fun") {
18624
- if (v._3._1.tag === "Closure") {
18625
- const $1 = v._1;
18626
- const $2 = v._3._1._1;
18627
- const $3 = v._3._1._3;
18628
- 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)(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))));
18629
- }
18630
- if (v._3._1.tag === "Foreign") {
18631
- const $1 = v._3._1._1._2;
18632
- const vs$p = foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2);
18633
- if ((() => {
18634
- const go = (go$a0$copy) => (go$a1$copy) => {
18635
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18636
- while (go$c) {
18637
- const b = go$a0, v$1 = go$a1;
18638
- if (v$1.tag === "Nil") {
18639
- go$c = false;
18640
- go$r = b;
18641
- continue;
18642
- }
18643
- if (v$1.tag === "Cons") {
18644
- go$a0 = b + 1 | 0;
18645
- go$a1 = v$1._2;
18646
- continue;
18647
- }
18648
- fail();
18649
- }
18650
- return go$r;
18651
- };
18652
- return $1._1.arity > go(0)(vs$p);
18653
- })()) {
18654
- return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1, void 0, Leaf2))($BaseVal(
18655
- "Fun",
18656
- $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
18657
- ));
18701
+ return (dictMonadReader) => (dictMonadAff) => {
18702
+ const Bind1 = dictMonadAff.MonadEffect0().Monad0().Bind1();
18703
+ return (dictLoadFile) => (v) => (v1) => {
18704
+ const $0 = (v2) => MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v2)).lines) + ", expected function"));
18705
+ if (v._3.tag === "Fun") {
18706
+ if (v._3._1.tag === "Closure") {
18707
+ const $1 = v._1;
18708
+ const $2 = v._3._1._1;
18709
+ 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))));
18658
18711
  }
18659
- return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictLoadFile)(vs$p);
18660
- }
18661
- if (v._3._1.tag === "PartialConstr") {
18662
- const $1 = v._1;
18663
- const n = defined(arity(monadThrowExceptT(monadIdentity))(v._3._1._1));
18664
- const v$p = (() => {
18665
- const go = (go$a0$copy) => (go$a1$copy) => {
18666
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18667
- while (go$c) {
18668
- const b = go$a0, v$1 = go$a1;
18669
- if (v$1.tag === "Nil") {
18670
- go$c = false;
18671
- go$r = b;
18672
- continue;
18712
+ if (v._3._1.tag === "Foreign") {
18713
+ const $1 = v._3._1._1._2;
18714
+ const vs$p = foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2);
18715
+ if ((() => {
18716
+ const go = (go$a0$copy) => (go$a1$copy) => {
18717
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18718
+ while (go$c) {
18719
+ const b = go$a0, v$1 = go$a1;
18720
+ if (v$1.tag === "Nil") {
18721
+ go$c = false;
18722
+ go$r = b;
18723
+ continue;
18724
+ }
18725
+ if (v$1.tag === "Cons") {
18726
+ go$a0 = b + 1 | 0;
18727
+ go$a1 = v$1._2;
18728
+ continue;
18729
+ }
18730
+ fail();
18673
18731
  }
18674
- if (v$1.tag === "Cons") {
18675
- go$a0 = b + 1 | 0;
18676
- go$a1 = v$1._2;
18677
- continue;
18732
+ return go$r;
18733
+ };
18734
+ return $1._1.arity > go(0)(vs$p);
18735
+ })()) {
18736
+ return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1, void 0, Leaf2))($BaseVal(
18737
+ "Fun",
18738
+ $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
18739
+ ));
18740
+ }
18741
+ return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadAff)(dictMonadReader)(dictLoadFile)(vs$p);
18742
+ }
18743
+ if (v._3._1.tag === "PartialConstr") {
18744
+ const $1 = v._1;
18745
+ const n = defined(arity(monadThrowExceptT(monadIdentity))(v._3._1._1));
18746
+ const v$p = (() => {
18747
+ const go = (go$a0$copy) => (go$a1$copy) => {
18748
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18749
+ while (go$c) {
18750
+ const b = go$a0, v$1 = go$a1;
18751
+ if (v$1.tag === "Nil") {
18752
+ go$c = false;
18753
+ go$r = b;
18754
+ continue;
18755
+ }
18756
+ if (v$1.tag === "Cons") {
18757
+ go$a0 = b + 1 | 0;
18758
+ go$a1 = v$1._2;
18759
+ continue;
18760
+ }
18761
+ fail();
18678
18762
  }
18679
- fail();
18680
- }
18681
- return go$r;
18682
- };
18683
- return go(0)(v._3._1._2) < (n - 1 | 0);
18684
- })() ? $BaseVal(
18685
- "Fun",
18686
- $Fun(
18687
- "PartialConstr",
18763
+ return go$r;
18764
+ };
18765
+ return go(0)(v._3._1._2) < (n - 1 | 0);
18766
+ })() ? $BaseVal(
18767
+ "Fun",
18768
+ $Fun(
18769
+ "PartialConstr",
18770
+ v._3._1._1,
18771
+ foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
18772
+ )
18773
+ ) : $BaseVal(
18774
+ "Constr",
18688
18775
  v._3._1._1,
18689
18776
  foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
18690
- )
18691
- ) : $BaseVal("Constr", v._3._1._1, foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2));
18692
- return Bind1.bind(check(MonadThrow0)((() => {
18693
- const go = (go$a0$copy) => (go$a1$copy) => {
18694
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18695
- while (go$c) {
18696
- const b = go$a0, v$1 = go$a1;
18697
- if (v$1.tag === "Nil") {
18698
- go$c = false;
18699
- go$r = b;
18700
- continue;
18701
- }
18702
- if (v$1.tag === "Cons") {
18703
- go$a0 = b + 1 | 0;
18704
- go$a1 = v$1._2;
18705
- continue;
18777
+ );
18778
+ return Bind1.bind(check(MonadThrow0)((() => {
18779
+ const go = (go$a0$copy) => (go$a1$copy) => {
18780
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
18781
+ while (go$c) {
18782
+ const b = go$a0, v$1 = go$a1;
18783
+ if (v$1.tag === "Nil") {
18784
+ go$c = false;
18785
+ go$r = b;
18786
+ continue;
18787
+ }
18788
+ if (v$1.tag === "Cons") {
18789
+ go$a0 = b + 1 | 0;
18790
+ go$a1 = v$1._2;
18791
+ continue;
18792
+ }
18793
+ fail();
18706
18794
  }
18707
- fail();
18708
- }
18709
- return go$r;
18710
- };
18711
- return go(0)(v._3._1._2) < n;
18712
- })())("Too many arguments to " + showCtr(v._3._1._1)))(() => $$new((a) => Val(a)(None))($$$Map(
18713
- "Two",
18714
- Leaf2,
18715
- $1,
18716
- void 0,
18717
- Leaf2
18718
- ))(v$p));
18795
+ return go$r;
18796
+ };
18797
+ return go(0)(v._3._1._2) < n;
18798
+ })())("Too many arguments to " + showCtr(v._3._1._1)))(() => $$new((a) => Val(a)(None))($$$Map(
18799
+ "Two",
18800
+ Leaf2,
18801
+ $1,
18802
+ void 0,
18803
+ Leaf2
18804
+ ))(v$p));
18805
+ }
18719
18806
  }
18720
- }
18721
- return $0(v1);
18807
+ return $0(v1);
18808
+ };
18722
18809
  };
18723
18810
  };
18724
18811
  var eval_module = (dictMonadWithGraphAlloc) => {
18725
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18726
- const $0 = Monad0.Bind1();
18727
18812
  const eval1 = $$eval(dictMonadWithGraphAlloc);
18728
18813
  const match1 = match(dictMonadWithGraphAlloc);
18729
18814
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
18730
- return (dictLoadFile) => {
18731
- const eval2 = eval1(dictLoadFile);
18732
- return (\u03B3) => {
18733
- const go = (v) => (v1) => (v2) => {
18734
- if (v1.tag === "Nil") {
18735
- return Monad0.Applicative0().pure(v);
18736
- }
18737
- if (v1.tag === "Cons") {
18738
- if (v1._1.tag === "Left") {
18739
- const $1 = v1._2;
18740
- const $2 = v1._1._1._1;
18741
- return $0.bind(eval2(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)));
18742
- }
18743
- if (v1._1.tag === "Right") {
18744
- const $1 = v1._2;
18745
- 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));
18746
- }
18747
- }
18748
- fail();
18815
+ return (dictMonadReader) => {
18816
+ 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);
18827
+ }
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
+ }
18838
+ }
18839
+ fail();
18840
+ };
18841
+ return go(empty);
18842
+ };
18749
18843
  };
18750
- return go(empty);
18751
18844
  };
18752
18845
  };
18753
18846
  };
18754
18847
  var eval_progCxt = (dictMonadWithGraphAlloc) => {
18755
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
18756
- const $0 = Monad0.Bind1();
18757
18848
  const eval_module1 = eval_module(dictMonadWithGraphAlloc);
18758
- const $1 = Monad0.Applicative0();
18759
18849
  const eval1 = $$eval(dictMonadWithGraphAlloc);
18760
- const concatM1 = concatM(Monad0);
18761
- return (dictLoadFile) => {
18762
- const eval_module2 = eval_module1(dictLoadFile);
18763
- const eval2 = eval1(dictLoadFile);
18764
- return (v) => concatM1(foldableList.foldr(Cons)(listMap((v1) => (\u03B3) => {
18765
- const $2 = v1._1;
18766
- return $0.bind(eval2(\u03B3)(v1._2)(setSet4.empty))((v2) => $1.pure(unionWith2((v$1) => identity13)(\u03B3)((() => {
18767
- const $3 = {};
18768
- $3[$2] = v2;
18769
- return $3;
18770
- })())));
18771
- })(reverse2(v.datasets)))(listMap((mod) => (\u03B3) => $0.bind(eval_module2(\u03B3)(mod)(setSet4.empty))((\u03B3$p) => $1.pure(unionWith2((v$1) => identity13)(\u03B3)(\u03B3$p))))(reverse2(v.mods))))(v.primitives);
18850
+ return (dictMonadReader) => {
18851
+ const eval_module2 = eval_module1(dictMonadReader);
18852
+ 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);
18871
+ };
18872
+ };
18772
18873
  };
18773
18874
  };
18774
18875
  var graphEval = (dictMonadAff) => {
@@ -18781,46 +18882,51 @@ var graphEval = (dictMonadAff) => {
18781
18882
  Applicative0: () => applicativeStateT(Monad0),
18782
18883
  Bind1: () => bindStateT(Monad0)
18783
18884
  })(graphGraphImpl);
18784
- const $1 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
18885
+ const monadAffState2 = monadAffState(dictMonadAff);
18886
+ const monadAffState1 = monadAffState(monadAffState2);
18887
+ const $1 = monadAffState2.MonadEffect0().Monad0();
18785
18888
  const $2 = dictMonadAff.MonadEffect0().Monad0();
18786
- return (dictLoadFile) => (dictMonadError) => {
18787
- const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))((() => {
18788
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
18789
- return {
18790
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
18791
- const $3 = loadFile1(folders);
18792
- return (x) => {
18793
- const $4 = $3(x);
18794
- 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(
18795
- x$1,
18796
- s
18797
- )));
18798
- };
18799
- }
18889
+ return (dictMonadReader) => {
18890
+ const monadReaderStateT2 = monadReaderStateT(monadReaderStateT(dictMonadReader));
18891
+ return (dictLoadFile) => (dictMonadError) => {
18892
+ const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))(monadReaderStateT2)(monadAffState1)((() => {
18893
+ const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
18894
+ 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
+ };
18904
+ }
18905
+ };
18906
+ })());
18907
+ const check2 = check(monadThrowStateT(dictMonadError.MonadThrow0()));
18908
+ return (v) => (e) => {
18909
+ const $3 = v["\u03B3"];
18910
+ const $4 = spyFunWhen(false)("fwdSlice")((x) => $Tuple(showVertices(x._1), showEdgeList(toEdgeList(graphGraphImpl)(x._2))))(showGraph(graphGraphImpl))(fwdSlice2);
18911
+ const $5 = spyFunWhen(false)("bwdSlice")((x) => $Tuple(showVertices(x._1), showEdgeList(toEdgeList(graphGraphImpl)(x._2))))(showGraph(graphGraphImpl))(bwdSlice2);
18912
+ return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1($3)(e\u03B1)(Leaf2))(verticesEnvExprVertex.vertices($EnvExpr(
18913
+ $3,
18914
+ e\u03B1
18915
+ ))))((v1) => {
18916
+ const $6 = v1._1;
18917
+ const $7 = v1._2;
18918
+ return bindStateT2.bind(check2(difference2(ordDVertex$p)(verticesValVertex.vertices($7))(verticesGraphImpl.vertices($6)).tag === "Leaf")("outputs in graph"))(() => applicativeStateT(Monad0).pure($Tuple(
18919
+ $6,
18920
+ $Tuple($EnvExpr($3, e\u03B1), $7)
18921
+ )));
18922
+ })))(v.n))((v1) => Monad0.Applicative0().pure({
18923
+ g: v1._2._2._1,
18924
+ graph_fwd: (a) => (b) => $4($Tuple(a, b)),
18925
+ graph_bwd: (a) => (b) => $5($Tuple(a, b)),
18926
+ "in\u03B1": v1._2._2._2._1,
18927
+ "out\u03B1": v1._2._2._2._2
18928
+ }));
18800
18929
  };
18801
- })());
18802
- const check2 = check(monadThrowStateT(dictMonadError.MonadThrow0()));
18803
- return (v) => (e) => {
18804
- const $3 = v["\u03B3"];
18805
- const $4 = spyFunWhen(false)("fwdSlice")((x) => $Tuple(showVertices(x._1), showEdgeList(toEdgeList(graphGraphImpl)(x._2))))(showGraph(graphGraphImpl))(fwdSlice2);
18806
- const $5 = spyFunWhen(false)("bwdSlice")((x) => $Tuple(showVertices(x._1), showEdgeList(toEdgeList(graphGraphImpl)(x._2))))(showGraph(graphGraphImpl))(bwdSlice2);
18807
- return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1($3)(e\u03B1)(Leaf2))(verticesEnvExprVertex.vertices($EnvExpr(
18808
- $3,
18809
- e\u03B1
18810
- ))))((v1) => {
18811
- const $6 = v1._1;
18812
- const $7 = v1._2;
18813
- return bindStateT2.bind(check2(difference2(ordDVertex$p)(verticesValVertex.vertices($7))(verticesGraphImpl.vertices($6)).tag === "Leaf")("outputs in graph"))(() => applicativeStateT(Monad0).pure($Tuple(
18814
- $6,
18815
- $Tuple($EnvExpr($3, e\u03B1), $7)
18816
- )));
18817
- })))(v.n))((v1) => Monad0.Applicative0().pure({
18818
- g: v1._2._2._1,
18819
- graph_fwd: (a) => (b) => $4($Tuple(a, b)),
18820
- graph_bwd: (a) => (b) => $5($Tuple(a, b)),
18821
- "in\u03B1": v1._2._2._2._1,
18822
- "out\u03B1": v1._2._2._2._2
18823
- }));
18824
18930
  };
18825
18931
  };
18826
18932
  };
@@ -22971,7 +23077,7 @@ var matrixUpdate = /* @__PURE__ */ $Tuple(
22971
23077
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
22972
23078
  return (dictMonadError) => {
22973
23079
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
22974
- return (dictLoadFile) => (v) => {
23080
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
22975
23081
  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") {
22976
23082
  const $0 = v._2._2._1;
22977
23083
  return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._1, void 0, Leaf2))($BaseVal(
@@ -22990,12 +23096,12 @@ var matrixLookup = /* @__PURE__ */ $Tuple(
22990
23096
  /* @__PURE__ */ $ForeignOp$p({
22991
23097
  arity: 2,
22992
23098
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
22993
- const MonadThrow0 = dictMonadError.MonadThrow0();
22994
- return (dictLoadFile) => (v) => {
23099
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23100
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
22995
23101
  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") {
22996
- 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));
23102
+ 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));
22997
23103
  }
22998
- return MonadThrow0.throwError(error("Matrix and pair of integers expected"));
23104
+ return $$throw2("Matrix and pair of integers expected");
22999
23105
  };
23000
23106
  }
23001
23107
  })
@@ -23009,6 +23115,32 @@ var log3 = (v2) => {
23009
23115
  }
23010
23116
  fail();
23011
23117
  };
23118
+ var loadJson = /* @__PURE__ */ $Tuple(
23119
+ "loadJson",
23120
+ /* @__PURE__ */ $ForeignOp$p({
23121
+ arity: 1,
23122
+ op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23123
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23124
+ return (dictMonadAff) => {
23125
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23126
+ const $0 = Monad0.Bind1();
23127
+ return (dictMonadReader) => {
23128
+ const ask = dictMonadReader.MonadAsk0().ask;
23129
+ return (dictLoadFile) => {
23130
+ const loadFile = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23131
+ return (v) => {
23132
+ if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
23133
+ const $1 = v._1._3._1;
23134
+ return $0.bind(ask)((v1) => $0.bind(loadFile(v1.fluidSrcPaths)($1))((str) => Monad0.Applicative0().pure(throwException(error($1))())));
23135
+ }
23136
+ return $$throw2("String expected");
23137
+ };
23138
+ };
23139
+ };
23140
+ };
23141
+ }
23142
+ })
23143
+ );
23012
23144
  var lessThanEquals = /* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asIntNumberOrString)(asIntNumberOrString)((a1) => (a2) => a1 <= a2)(/* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asNumberString)(asNumberString)((a1) => (a2) => a1 <= a2)((a1) => (a2) => a1 <= a2));
23013
23145
  var lessThan = /* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asIntNumberOrString)(asIntNumberOrString)((a1) => (a2) => a1 < a2)(/* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asNumberString)(asNumberString)((a1) => (a2) => a1 < a2)((a1) => (a2) => a1 < a2));
23014
23146
  var greaterThanEquals = /* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asIntNumberOrString)(asIntNumberOrString)((a1) => (a2) => a1 >= a2)(/* @__PURE__ */ union6(asBooleanBoolean)(asBooleanBoolean)(asNumberString)(asNumberString)((a1) => (a2) => a1 >= a2)((a1) => (a2) => a1 >= a2));
@@ -23023,12 +23155,12 @@ var error_ = /* @__PURE__ */ $Tuple(
23023
23155
  /* @__PURE__ */ $ForeignOp$p({
23024
23156
  arity: 1,
23025
23157
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23026
- const MonadThrow0 = dictMonadError.MonadThrow0();
23027
- return (dictLoadFile) => (v) => {
23158
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23159
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23028
23160
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
23029
- return MonadThrow0.Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
23161
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
23030
23162
  }
23031
- return MonadThrow0.throwError(error("String expected"));
23163
+ return $$throw2("String expected");
23032
23164
  };
23033
23165
  }
23034
23166
  })
@@ -23041,26 +23173,28 @@ var dims = /* @__PURE__ */ $Tuple(
23041
23173
  op: (dictMonadWithGraphAlloc) => {
23042
23174
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23043
23175
  return (dictMonadError) => {
23044
- const MonadThrow0 = dictMonadError.MonadThrow0();
23045
- const $0 = MonadThrow0.Monad0().Bind1();
23046
- return (dictLoadFile) => (v) => {
23047
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
23048
- const $1 = v._1._3._1._2._2._1;
23049
- const $2 = v._1._1;
23050
- const $3 = v._1._3._1._2._2._2;
23051
- return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
23052
- "Int",
23053
- v._1._3._1._2._1._1
23054
- )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
23055
- "Int",
23056
- $1
23057
- )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
23058
- "Constr",
23059
- "Pair",
23060
- $List("Cons", v1, $List("Cons", v2, Nil))
23061
- ))));
23062
- }
23063
- return MonadThrow0.throwError(error("Matrix expected"));
23176
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23177
+ return (dictMonadAff) => {
23178
+ const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
23179
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
23180
+ if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
23181
+ const $1 = v._1._3._1._2._2._1;
23182
+ const $2 = v._1._1;
23183
+ const $3 = v._1._3._1._2._2._2;
23184
+ return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
23185
+ "Int",
23186
+ v._1._3._1._2._1._1
23187
+ )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
23188
+ "Int",
23189
+ $1
23190
+ )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
23191
+ "Constr",
23192
+ "Pair",
23193
+ $List("Cons", v1, $List("Cons", v2, Nil))
23194
+ ))));
23195
+ }
23196
+ return $$throw2("Matrix expected");
23197
+ };
23064
23198
  };
23065
23199
  };
23066
23200
  }
@@ -23074,25 +23208,30 @@ var dict_map = /* @__PURE__ */ $Tuple(
23074
23208
  const apply5 = apply2(dictMonadWithGraphAlloc);
23075
23209
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23076
23210
  return (dictMonadError) => {
23077
- const MonadThrow0 = dictMonadError.MonadThrow0();
23078
- const Monad0 = MonadThrow0.Monad0();
23079
- const Bind1 = Monad0.Bind1();
23080
- const traverse1 = traversableDict.traverse(Monad0.Applicative0());
23081
- return (dictLoadFile) => {
23082
- const apply12 = apply5(dictLoadFile);
23083
- return (v) => {
23084
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23085
- const $0 = v._1;
23086
- const $1 = v._2._1._1;
23087
- return Bind1.bind(traverse1((v2) => {
23088
- const $2 = v2._1;
23089
- return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply12($0)(v2._2));
23090
- })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
23091
- "Dictionary",
23092
- d$p
23093
- )));
23094
- }
23095
- return MonadThrow0.throwError(error("Function and dictionary expected"));
23211
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23212
+ return (dictMonadAff) => {
23213
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23214
+ const Bind1 = Monad0.Bind1();
23215
+ const traverse1 = traversableDict.traverse(Monad0.Applicative0());
23216
+ return (dictMonadReader) => {
23217
+ const apply12 = apply5(dictMonadReader)(dictMonadAff);
23218
+ return (dictLoadFile) => {
23219
+ const apply22 = apply12(dictLoadFile);
23220
+ return (v) => {
23221
+ if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23222
+ const $0 = v._1;
23223
+ const $1 = v._2._1._1;
23224
+ return Bind1.bind(traverse1((v2) => {
23225
+ const $2 = v2._1;
23226
+ return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply22($0)(v2._2));
23227
+ })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
23228
+ "Dictionary",
23229
+ d$p
23230
+ )));
23231
+ }
23232
+ return $$throw2("Function and dictionary expected");
23233
+ };
23234
+ };
23096
23235
  };
23097
23236
  };
23098
23237
  };
@@ -23107,38 +23246,43 @@ var dict_intersectionWith = /* @__PURE__ */ $Tuple(
23107
23246
  const apply5 = apply2(dictMonadWithGraphAlloc);
23108
23247
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23109
23248
  return (dictMonadError) => {
23110
- const MonadThrow0 = dictMonadError.MonadThrow0();
23111
- const Monad0 = MonadThrow0.Monad0();
23112
- const Bind1 = Monad0.Bind1();
23113
- const Applicative0 = Monad0.Applicative0();
23114
- const $0 = Bind1.Apply0().Functor0();
23115
- return (dictLoadFile) => {
23116
- const apply12 = apply5(dictLoadFile);
23117
- return (v) => {
23118
- 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") {
23119
- const $1 = v._1;
23120
- const $2 = v._2._1._1;
23121
- const $3 = v._2._2._1._1;
23122
- return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity14)(intersectionWith_Object((v2) => (v3) => {
23123
- const $4 = v3._2;
23124
- const $5 = v2._1;
23125
- const $6 = v3._1;
23126
- return Bind1.bind(Bind1.bind(apply12($1)(v2._2))((a) => apply12(a)($4)))((v4) => Bind1.bind($$new((a) => Val(a)(None))(insert(ordVertex)($6)()($$$Map(
23127
- "Two",
23128
- Leaf2,
23129
- $5,
23130
- void 0,
23131
- Leaf2
23132
- )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
23133
- })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert(ordVertex)($3)()($$$Map(
23134
- "Two",
23135
- Leaf2,
23136
- $2,
23137
- void 0,
23138
- Leaf2
23139
- )))(v$p));
23140
- }
23141
- return MonadThrow0.throwError(error("Function and two dictionaries expected"));
23249
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23250
+ return (dictMonadAff) => {
23251
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23252
+ const Bind1 = Monad0.Bind1();
23253
+ const Applicative0 = Monad0.Applicative0();
23254
+ const $0 = Bind1.Apply0().Functor0();
23255
+ return (dictMonadReader) => {
23256
+ const apply12 = apply5(dictMonadReader)(dictMonadAff);
23257
+ return (dictLoadFile) => {
23258
+ const apply22 = apply12(dictLoadFile);
23259
+ return (v) => {
23260
+ 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") {
23261
+ const $1 = v._1;
23262
+ const $2 = v._2._1._1;
23263
+ const $3 = v._2._2._1._1;
23264
+ return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity14)(intersectionWith_Object((v2) => (v3) => {
23265
+ const $4 = v3._2;
23266
+ const $5 = v2._1;
23267
+ const $6 = v3._1;
23268
+ 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(
23269
+ "Two",
23270
+ Leaf2,
23271
+ $5,
23272
+ void 0,
23273
+ Leaf2
23274
+ )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
23275
+ })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert(ordVertex)($3)()($$$Map(
23276
+ "Two",
23277
+ Leaf2,
23278
+ $2,
23279
+ void 0,
23280
+ Leaf2
23281
+ )))(v$p));
23282
+ }
23283
+ return $$throw2("Function and two dictionaries expected");
23284
+ };
23285
+ };
23142
23286
  };
23143
23287
  };
23144
23288
  };
@@ -23151,7 +23295,7 @@ var dict_get = /* @__PURE__ */ $Tuple(
23151
23295
  arity: 2,
23152
23296
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23153
23297
  const MonadThrow0 = dictMonadError.MonadThrow0();
23154
- return (dictLoadFile) => (v) => {
23298
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23155
23299
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23156
23300
  return orElse(MonadThrow0)('Key "' + v._1._3._1 + '" not found')((() => {
23157
23301
  const $0 = _lookup(Nothing, Just, v._1._3._1, v._2._1._3._1);
@@ -23173,19 +23317,24 @@ var dict_foldl = /* @__PURE__ */ $Tuple(
23173
23317
  op: (dictMonadWithGraphAlloc) => {
23174
23318
  const apply5 = apply2(dictMonadWithGraphAlloc);
23175
23319
  return (dictMonadError) => {
23176
- const MonadThrow0 = dictMonadError.MonadThrow0();
23177
- const Monad0 = MonadThrow0.Monad0();
23178
- return (dictLoadFile) => {
23179
- const apply12 = apply5(dictLoadFile);
23180
- return (v) => {
23181
- 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") {
23182
- const $0 = v._1;
23183
- return foldM4(Monad0)((u1) => (v2) => {
23184
- const $1 = v2._2;
23185
- return Monad0.Bind1().bind(apply12($0)(u1))((a) => apply12(a)($1));
23186
- })(v._2._1)(v._2._2._1._3._1);
23187
- }
23188
- return MonadThrow0.throwError(error("Function, value and dictionary expected"));
23320
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23321
+ return (dictMonadAff) => {
23322
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23323
+ return (dictMonadReader) => {
23324
+ const apply12 = apply5(dictMonadReader)(dictMonadAff);
23325
+ return (dictLoadFile) => {
23326
+ const apply22 = apply12(dictLoadFile);
23327
+ return (v) => {
23328
+ 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") {
23329
+ const $0 = v._1;
23330
+ return foldM4(Monad0)((u1) => (v2) => {
23331
+ const $1 = v2._2;
23332
+ return Monad0.Bind1().bind(apply22($0)(u1))((a) => apply22(a)($1));
23333
+ })(v._2._1)(v._2._2._1._3._1);
23334
+ }
23335
+ return $$throw2("Function, value and dictionary expected");
23336
+ };
23337
+ };
23189
23338
  };
23190
23339
  };
23191
23340
  };
@@ -23200,7 +23349,7 @@ var dict_disjointUnion = /* @__PURE__ */ $Tuple(
23200
23349
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23201
23350
  return (dictMonadError) => {
23202
23351
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23203
- return (dictLoadFile) => (v) => {
23352
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23204
23353
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23205
23354
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
23206
23355
  "Two",
@@ -23224,7 +23373,7 @@ var dict_difference = /* @__PURE__ */ $Tuple(
23224
23373
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
23225
23374
  return (dictMonadError) => {
23226
23375
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23227
- return (dictLoadFile) => (v) => {
23376
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23228
23377
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
23229
23378
  return $$new((a) => Val(a)(None))(insert(ordVertex)(v._2._1._1)()($$$Map(
23230
23379
  "Two",
@@ -23245,13 +23394,13 @@ var debugLog = /* @__PURE__ */ $Tuple(
23245
23394
  /* @__PURE__ */ $ForeignOp$p({
23246
23395
  arity: 1,
23247
23396
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
23248
- const MonadThrow0 = dictMonadError.MonadThrow0();
23249
- return (dictLoadFile) => (v) => {
23397
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
23398
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
23250
23399
  if (v.tag === "Cons" && v._2.tag === "Nil") {
23251
23400
  const $0 = v._1;
23252
- return MonadThrow0.Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
23401
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
23253
23402
  }
23254
- return MonadThrow0.throwError(error("Single value expected"));
23403
+ return $$throw2("Single value expected");
23255
23404
  };
23256
23405
  }
23257
23406
  })
@@ -23265,6 +23414,7 @@ var primitives = /* @__PURE__ */ fromFoldable2(foldableArray)([
23265
23414
  /* @__PURE__ */ extern1(debugLog),
23266
23415
  /* @__PURE__ */ extern1(dims),
23267
23416
  /* @__PURE__ */ extern1(error_),
23417
+ /* @__PURE__ */ extern1(loadJson),
23268
23418
  /* @__PURE__ */ unary2("floor")({ i: number, o: $$int, fwd: floor2 }),
23269
23419
  /* @__PURE__ */ unary2("log")({ i: intOrNumber, o: number, fwd: log3 }),
23270
23420
  /* @__PURE__ */ unary2("numToStr")({ i: intOrNumber, o: string, fwd: numToStr }),
@@ -23342,7 +23492,6 @@ var verticesProgCxtVertex = {
23342
23492
  };
23343
23493
  var functorProgCxt = {
23344
23494
  map: (f) => (m) => ({
23345
- fluidSrcPaths: m.fluidSrcPaths,
23346
23495
  primitives: _fmapObject(m.primitives, functorVal.map(f)),
23347
23496
  mods: listMap(functorModule.map(f))(m.mods),
23348
23497
  datasets: listMap((m$1) => $Tuple(m$1._1, functorExpr.map(f)(m$1._2)))(m.datasets)
@@ -23412,7 +23561,7 @@ var traversableProgCxt = {
23412
23561
  const traverse7 = traversableExpr.traverse(dictApplicative);
23413
23562
  const traverse8 = traversableModule.traverse(dictApplicative);
23414
23563
  const traverse9 = traversableEnv.traverse(dictApplicative);
23415
- return (f) => (m) => Apply0.apply(Apply0.apply(Apply0.Functor0().map((v1) => (v2) => (v3) => ({ fluidSrcPaths: m.fluidSrcPaths, primitives: v3, mods: v2, datasets: v1 }))(traverse5(traversableTuple.traverse(dictApplicative)(traverse7(f)))(m.datasets)))(traverse5(traverse8(f))(m.mods)))(traverse9(f)(m.primitives));
23564
+ 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));
23416
23565
  },
23417
23566
  sequence: (dictApplicative) => (v) => traversableProgCxt.traverse(dictApplicative)(identity25)(v),
23418
23567
  Functor0: () => functorProgCxt,
@@ -23458,7 +23607,6 @@ var module_2 = (dictMonadAff) => {
23458
23607
  return (folders) => (file) => (v) => {
23459
23608
  const $0 = v.mods;
23460
23609
  return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile(folders)(file))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
23461
- fluidSrcPaths: v.fluidSrcPaths,
23462
23610
  primitives: v.primitives,
23463
23611
  mods: $List("Cons", mod, $0),
23464
23612
  datasets: v.datasets
@@ -23479,36 +23627,41 @@ var initialConfig = (dictMonadAff) => {
23479
23627
  Applicative0: () => applicativeStateT(Monad0),
23480
23628
  Bind1: () => bindStateT(Monad0)
23481
23629
  })(graphGraphImpl);
23482
- const $2 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
23630
+ const monadAffState2 = monadAffState(dictMonadAff);
23631
+ const monadAffState1 = monadAffState(monadAffState2);
23632
+ const $2 = monadAffState2.MonadEffect0().Monad0();
23483
23633
  const $3 = dictMonadAff.MonadEffect0().Monad0();
23484
23634
  return (dictMonadError) => {
23485
23635
  const eval_progCxt2 = eval_progCxt(monadWithGraphAllocWithGr(dictMonadError));
23486
- return (dictLoadFile) => {
23487
- const eval_progCxt1 = eval_progCxt2((() => {
23488
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23489
- return {
23490
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
23491
- const $4 = loadFile1(folders);
23492
- return (x) => {
23493
- const $5 = $4(x);
23494
- 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(
23495
- x$1,
23496
- s
23497
- )));
23498
- };
23499
- }
23500
- };
23501
- })());
23502
- return (dictFV) => (e) => (progCxt) => Bind1.bind(Applicative0.pure())(() => Bind1.bind(runAllocT(Monad0)($1.bind(alloc(progCxt))((progCxt$p) => $1.bind(runWithGraphT_spy2(eval_progCxt1(progCxt$p))(verticesProgCxtVertex.vertices(progCxt$p)))((v) => applicativeStateT(Monad0).pure($Tuple(
23503
- progCxt$p,
23504
- (() => {
23505
- const $4 = dictFV.fv(e);
23506
- return filterWithKey2((x) => {
23507
- const $5 = setSet(ordString).member(x)($4);
23508
- return (v$1) => $5;
23509
- })(v._2);
23510
- })()
23511
- )))))(0))((v) => Applicative0.pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2 })));
23636
+ return (dictMonadReader) => {
23637
+ const eval_progCxt1 = eval_progCxt2(monadReaderStateT(monadReaderStateT(dictMonadReader)))(monadAffState1);
23638
+ return (dictLoadFile) => {
23639
+ const eval_progCxt22 = eval_progCxt1((() => {
23640
+ const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
23641
+ return {
23642
+ loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
23643
+ const $4 = loadFile1(folders);
23644
+ return (x) => {
23645
+ const $5 = $4(x);
23646
+ 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(
23647
+ x$1,
23648
+ s
23649
+ )));
23650
+ };
23651
+ }
23652
+ };
23653
+ })());
23654
+ 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(
23655
+ progCxt$p,
23656
+ (() => {
23657
+ const $4 = dictFV.fv(e);
23658
+ return filterWithKey2((x) => {
23659
+ const $5 = setSet(ordString).member(x)($4);
23660
+ return (v$1) => $5;
23661
+ })(v._2);
23662
+ })()
23663
+ )))))(0))((v) => Applicative0.pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2 })));
23664
+ };
23512
23665
  };
23513
23666
  };
23514
23667
  };
@@ -23519,13 +23672,17 @@ var prepConfig = (dictMonadAff) => {
23519
23672
  return (dictMonadError) => {
23520
23673
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
23521
23674
  const initialConfig2 = initialConfig1(dictMonadError);
23522
- return (dictLoadFile) => {
23523
- const initialConfig3 = initialConfig2(dictLoadFile)(fVExpr);
23524
- return (v) => (file) => (progCxt) => $0.bind(parseProgram(dictLoadFile)(v.fluidSrcPaths)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig3(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
23525
- s,
23526
- e,
23527
- gconfig
23528
- }))));
23675
+ return (dictMonadReader) => {
23676
+ const ask = dictMonadReader.MonadAsk0().ask;
23677
+ const initialConfig3 = initialConfig2(dictMonadReader);
23678
+ return (dictLoadFile) => {
23679
+ const initialConfig4 = initialConfig3(dictLoadFile)(fVExpr);
23680
+ 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({
23681
+ s,
23682
+ e,
23683
+ gconfig
23684
+ })))));
23685
+ };
23529
23686
  };
23530
23687
  };
23531
23688
  };
@@ -23538,7 +23695,6 @@ var datasetAs = (dictMonadAff) => {
23538
23695
  const $1 = v1.datasets;
23539
23696
  const $2 = v._1;
23540
23697
  return $0.bind($0.bind(parseProgram(dictLoadFile)(folders)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
23541
- fluidSrcPaths: v1.fluidSrcPaths,
23542
23698
  primitives: v1.primitives,
23543
23699
  mods: v1.mods,
23544
23700
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -23555,18 +23711,20 @@ var loadProgCxt = (dictMonadAff) => {
23555
23711
  return (dictMonadError) => {
23556
23712
  const module_22 = module_1(dictMonadError);
23557
23713
  const datasetAs2 = datasetAs1(dictMonadError);
23558
- return (dictLoadFile) => {
23559
- const module_3 = module_22(dictLoadFile);
23560
- const datasetAs3 = datasetAs2(dictLoadFile);
23561
- return (v) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
23562
- fluidSrcPaths: v.fluidSrcPaths,
23563
- primitives,
23564
- mods: Nil,
23565
- datasets: Nil
23566
- }))(concatM1(arrayMap(module_3(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
23567
- const $1 = datasetAs3(v.fluidSrcPaths);
23568
- return (x) => $1($Tuple(x._1, x._2));
23569
- })())(datasets)));
23714
+ return (dictMonadReader) => {
23715
+ const ask = dictMonadReader.MonadAsk0().ask;
23716
+ return (dictLoadFile) => {
23717
+ const module_3 = module_22(dictLoadFile);
23718
+ const datasetAs3 = datasetAs2(dictLoadFile);
23719
+ return (mods) => (datasets) => $0.bind(ask)((v) => $0.bind($0.bind(Monad0.Applicative0().pure({
23720
+ primitives,
23721
+ mods: Nil,
23722
+ datasets: Nil
23723
+ }))(concatM1(arrayMap(module_3(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
23724
+ const $1 = datasetAs3(v.fluidSrcPaths);
23725
+ return (x) => $1($Tuple(x._1, x._2));
23726
+ })())(datasets))));
23727
+ };
23570
23728
  };
23571
23729
  };
23572
23730
  };
@@ -23701,32 +23859,35 @@ var findM = (dictMonad) => {
23701
23859
  const $0 = dictMonad.Bind1().Apply0();
23702
23860
  return (dictFoldable) => (xs) => (f) => (base) => dictFoldable.foldr((x) => (acc) => $0.apply($0.Functor0().map(altMaybe.alt)(acc))(f(x)))(dictMonad.Applicative0().pure(base))(xs);
23703
23861
  };
23704
- var loadFileNodeT = (dictMonadAff) => {
23705
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
23706
- const $0 = Monad0.Bind1();
23707
- const findM1 = findM(Monad0)(foldableArray);
23708
- return (dictMonadError) => ({
23709
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => (v) => $0.bind(findM1(arrayMap((() => {
23862
+ var loadFileNodeT = (dictMonad) => {
23863
+ const bind4 = bindReaderT(dictMonad.Bind1()).bind;
23864
+ const $0 = dictMonad.Applicative0();
23865
+ const findM1 = findM(monadReaderT(dictMonad))(foldableArray);
23866
+ return {
23867
+ loadFile: (dictMonadError) => (dictMonadAff) => (folders) => (v) => bind4(findM1(arrayMap((() => {
23710
23868
  const $1 = v + ".fld";
23711
23869
  return (a) => a + "/" + $1;
23712
- })())(folders))((v1) => $0.bind(dictMonadAff1.liftAff($$try3(toAff1(stat2)(v1))))((stats) => Monad0.Applicative0().pure((() => {
23713
- if (stats.tag === "Left") {
23714
- return false;
23715
- }
23716
- if (stats.tag === "Right") {
23717
- return isFileImpl(stats._1);
23718
- }
23719
- fail();
23720
- })() ? $Maybe("Just", v1) : Nothing)))(Nothing))((url) => {
23870
+ })())(folders))((v1) => bind4(dictMonadAff.liftAff($$try3(toAff1(stat2)(v1))))((stats) => {
23871
+ const $1 = $0.pure((() => {
23872
+ if (stats.tag === "Left") {
23873
+ return false;
23874
+ }
23875
+ if (stats.tag === "Right") {
23876
+ return isFileImpl(stats._1);
23877
+ }
23878
+ fail();
23879
+ })() ? $Maybe("Just", v1) : Nothing);
23880
+ return (v$1) => $1;
23881
+ }))(Nothing))((url) => {
23721
23882
  if (url.tag === "Nothing") {
23722
23883
  return throwException(error("File " + v + " not found."))();
23723
23884
  }
23724
23885
  if (url.tag === "Just") {
23725
- return dictMonadAff1.liftAff(toAff2(readTextFile)(UTF8)(url._1));
23886
+ return dictMonadAff.liftAff(toAff2(readTextFile)(UTF8)(url._1));
23726
23887
  }
23727
23888
  fail();
23728
23889
  })
23729
- });
23890
+ };
23730
23891
  };
23731
23892
 
23732
23893
  // output-es/Options.Applicative.Internal.Utils/index.js
@@ -26892,10 +27053,14 @@ var execParserPure = (pprefs) => (pinfo) => (args) => {
26892
27053
  // output-es/Fluid/index.js
26893
27054
  var $Command = (_1) => ({ tag: "Evaluate", _1 });
26894
27055
  var $EvalArgs = (_1) => ({ tag: "EvalArgs", _1 });
26895
- var loadFileNodeT2 = /* @__PURE__ */ loadFileNodeT(monadAffAff)(monadErrorAff);
26896
- var loadProgCxt2 = /* @__PURE__ */ loadProgCxt(monadAffAff)(monadErrorAff)(loadFileNodeT2);
26897
- var prepConfig2 = /* @__PURE__ */ prepConfig(monadAffAff)(monadErrorAff)(loadFileNodeT2);
26898
- var graphEval2 = /* @__PURE__ */ graphEval(monadAffAff)(loadFileNodeT2)(monadErrorAff);
27056
+ var bind3 = /* @__PURE__ */ (() => bindReaderT(bindAff).bind)();
27057
+ var monadAffNodeT = /* @__PURE__ */ monadAffReader(monadAffAff);
27058
+ var monadErrorErrorNodeT = /* @__PURE__ */ monadErrorReaderT(monadErrorAff);
27059
+ var monadReaderFileCxtNodeT = /* @__PURE__ */ monadReaderReaderT(monadAff);
27060
+ var loadFileNodeT2 = /* @__PURE__ */ loadFileNodeT(monadAff);
27061
+ var loadProgCxt2 = /* @__PURE__ */ loadProgCxt(monadAffNodeT)(monadErrorErrorNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2);
27062
+ var prepConfig2 = /* @__PURE__ */ prepConfig(monadAffNodeT)(monadErrorErrorNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2);
27063
+ var graphEval2 = /* @__PURE__ */ graphEval(monadAffNodeT)(monadReaderFileCxtNodeT)(loadFileNodeT2)(monadErrorErrorNodeT);
26899
27064
  var fromFoldable25 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
26900
27065
  var Evaluate = (value0) => $Command(value0);
26901
27066
  var parseLocal = /* @__PURE__ */ $Parser(
@@ -26934,9 +27099,11 @@ var parseImports = /* @__PURE__ */ $Parser(
26934
27099
  );
26935
27100
  var evaluate = (v) => {
26936
27101
  const $0 = v._1.fileName;
26937
- const fluidSrcPaths = [v._1.fluidSrcPath, ...v._1.local ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []];
26938
- return _bind(loadProgCxt2({ fluidSrcPaths })(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig2({ fluidSrcPaths })($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure(functorVal.map((v$1) => {
26939
- })(v2["out\u03B1"])))));
27102
+ return bind3(loadProgCxt2(v._1.imports)(v._1.datasets))((progCxt) => bind3(prepConfig2($0)(progCxt))((v1) => bind3(graphEval2(v1.gconfig)(v1.e))((v2) => {
27103
+ const $1 = _pure(functorVal.map((v$1) => {
27104
+ })(v2["out\u03B1"]));
27105
+ return (v$1) => $1;
27106
+ })))({ fluidSrcPaths: [v._1.fluidSrcPath, ...v._1.local ? ["node_modules/@explorable-viz/fluid/dist/fluid/fluid"] : []] });
26940
27107
  };
26941
27108
  var dispatchCommand = (v) => _bind(evaluate(v._1))((v1) => _liftEffect(log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v1)).lines))));
26942
27109
  var callback = (v) => {