@explorable-viz/fluid 0.7.99 → 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.
@@ -36216,7 +36216,7 @@ var unary = (dictBoundedJoinSemilattice) => {
36216
36216
  arity: 1,
36217
36217
  op: (dictMonadWithGraphAlloc) => {
36218
36218
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
36219
- return (dictMonadError) => (dictLoadFile) => (v) => {
36219
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
36220
36220
  if (v.tag === "Cons" && v._2.tag === "Nil") {
36221
36221
  const $0 = v._1._2;
36222
36222
  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))));
@@ -36365,7 +36365,7 @@ var binaryZero = (dictBoundedJoinSemilattice) => {
36365
36365
  arity: 2,
36366
36366
  op: (dictMonadWithGraphAlloc) => {
36367
36367
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
36368
- return (dictMonadError) => (dictLoadFile) => (v) => {
36368
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
36369
36369
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
36370
36370
  const $0 = f.i.unpack(v._1._3);
36371
36371
  const $1 = f.i.unpack(v._2._1._3);
@@ -36413,7 +36413,7 @@ var binary = (dictBoundedJoinSemilattice) => {
36413
36413
  arity: 2,
36414
36414
  op: (dictMonadWithGraphAlloc) => {
36415
36415
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
36416
- return (dictMonadError) => (dictLoadFile) => (v) => {
36416
+ return (dictMonadError) => (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
36417
36417
  if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._2.tag === "Nil") {
36418
36418
  return $$new((a) => Val(a)(None))(insert3(ordVertex)(v._2._1._1)()($$$Map(
36419
36419
  "Two",
@@ -39532,6 +39532,27 @@ var applyStateT = (dictMonad) => {
39532
39532
  };
39533
39533
  };
39534
39534
  var applicativeStateT = (dictMonad) => ({ pure: (a) => (s) => dictMonad.Applicative0().pure($Tuple(a, s)), Apply0: () => applyStateT(dictMonad) });
39535
+ var monadAskStateT = (dictMonadAsk) => {
39536
+ const Monad0 = dictMonadAsk.Monad0();
39537
+ const monadStateT1 = { Applicative0: () => applicativeStateT(Monad0), Bind1: () => bindStateT(Monad0) };
39538
+ return {
39539
+ ask: (() => {
39540
+ const $0 = dictMonadAsk.ask;
39541
+ return (s) => Monad0.Bind1().bind($0)((x2) => Monad0.Applicative0().pure($Tuple(x2, s)));
39542
+ })(),
39543
+ Monad0: () => monadStateT1
39544
+ };
39545
+ };
39546
+ var monadReaderStateT = (dictMonadReader) => {
39547
+ const monadAskStateT1 = monadAskStateT(dictMonadReader.MonadAsk0());
39548
+ return {
39549
+ local: (x2) => {
39550
+ const $0 = dictMonadReader.local(x2);
39551
+ return (v) => (x$1) => $0(v(x$1));
39552
+ },
39553
+ MonadAsk0: () => monadAskStateT1
39554
+ };
39555
+ };
39535
39556
  var monadEffectState = (dictMonadEffect) => {
39536
39557
  const Monad0 = dictMonadEffect.Monad0();
39537
39558
  const monadStateT1 = { Applicative0: () => applicativeStateT(Monad0), Bind1: () => bindStateT(Monad0) };
@@ -39579,8 +39600,87 @@ var monadErrorStateT = (dictMonadError) => {
39579
39600
  return { catchError: (v) => (h) => (s) => dictMonadError.catchError(v(s))((e) => h(e)(s)), MonadThrow0: () => monadThrowStateT1 };
39580
39601
  };
39581
39602
 
39603
+ // output-es/Control.Monad.Reader.Trans/index.js
39604
+ var withReaderT = (f) => (v) => (x2) => v(f(x2));
39605
+ var bindReaderT = (dictBind) => {
39606
+ const $0 = dictBind.Apply0();
39607
+ const $1 = $0.Functor0();
39608
+ const applyReaderT1 = (() => {
39609
+ const functorReaderT1 = {
39610
+ map: (x2) => {
39611
+ const $2 = $1.map(x2);
39612
+ return (v) => (x$1) => $2(v(x$1));
39613
+ }
39614
+ };
39615
+ return { apply: (v) => (v1) => (r) => $0.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
39616
+ })();
39617
+ return { bind: (v) => (k) => (r) => dictBind.bind(v(r))((a) => k(a)(r)), Apply0: () => applyReaderT1 };
39618
+ };
39619
+ var monadReaderT = (dictMonad) => {
39620
+ const $0 = dictMonad.Applicative0();
39621
+ const $1 = $0.Apply0();
39622
+ const applicativeReaderT1 = (() => {
39623
+ const $2 = $1.Functor0();
39624
+ const functorReaderT1 = {
39625
+ map: (x2) => {
39626
+ const $3 = $2.map(x2);
39627
+ return (v) => (x$1) => $3(v(x$1));
39628
+ }
39629
+ };
39630
+ const applyReaderT1 = { apply: (v) => (v1) => (r) => $1.apply(v(r))(v1(r)), Functor0: () => functorReaderT1 };
39631
+ return {
39632
+ pure: (x2) => {
39633
+ const $3 = $0.pure(x2);
39634
+ return (v) => $3;
39635
+ },
39636
+ Apply0: () => applyReaderT1
39637
+ };
39638
+ })();
39639
+ const bindReaderT1 = bindReaderT(dictMonad.Bind1());
39640
+ return { Applicative0: () => applicativeReaderT1, Bind1: () => bindReaderT1 };
39641
+ };
39642
+ var monadReaderReaderT = (dictMonad) => {
39643
+ const monadReaderT1 = monadReaderT(dictMonad);
39644
+ const monadAskReaderT1 = { ask: dictMonad.Applicative0().pure, Monad0: () => monadReaderT1 };
39645
+ return { local: withReaderT, MonadAsk0: () => monadAskReaderT1 };
39646
+ };
39647
+ var monadEffectReader = (dictMonadEffect) => {
39648
+ const monadReaderT1 = monadReaderT(dictMonadEffect.Monad0());
39649
+ return {
39650
+ liftEffect: (x2) => {
39651
+ const $0 = dictMonadEffect.liftEffect(x2);
39652
+ return (v) => $0;
39653
+ },
39654
+ Monad0: () => monadReaderT1
39655
+ };
39656
+ };
39657
+ var monadThrowReaderT = (dictMonadThrow) => {
39658
+ const monadReaderT1 = monadReaderT(dictMonadThrow.Monad0());
39659
+ return {
39660
+ throwError: (x2) => {
39661
+ const $0 = dictMonadThrow.throwError(x2);
39662
+ return (v) => $0;
39663
+ },
39664
+ Monad0: () => monadReaderT1
39665
+ };
39666
+ };
39667
+ var monadErrorReaderT = (dictMonadError) => {
39668
+ const monadThrowReaderT1 = monadThrowReaderT(dictMonadError.MonadThrow0());
39669
+ return { catchError: (v) => (h) => (r) => dictMonadError.catchError(v(r))((e) => h(e)(r)), MonadThrow0: () => monadThrowReaderT1 };
39670
+ };
39671
+
39582
39672
  // output-es/Effect.Aff.Class/index.js
39583
39673
  var monadAffAff = { liftAff: (x2) => x2, MonadEffect0: () => monadEffectAff };
39674
+ var monadAffReader = (dictMonadAff) => {
39675
+ const monadEffectReader2 = monadEffectReader(dictMonadAff.MonadEffect0());
39676
+ return {
39677
+ liftAff: (x2) => {
39678
+ const $0 = dictMonadAff.liftAff(x2);
39679
+ return (v) => $0;
39680
+ },
39681
+ MonadEffect0: () => monadEffectReader2
39682
+ };
39683
+ };
39584
39684
  var monadAffState = (dictMonadAff) => {
39585
39685
  const MonadEffect0 = dictMonadAff.MonadEffect0();
39586
39686
  const monadEffectState2 = monadEffectState(MonadEffect0);
@@ -39986,23 +40086,28 @@ var closeDefs = (dictMonadWithGraphAlloc) => {
39986
40086
  };
39987
40087
  var new$p = (dictMonadWithGraphAlloc) => {
39988
40088
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
39989
- const MonadWithGraph2 = dictMonadWithGraphAlloc.MonadWithGraph2();
39990
- const Monad0 = MonadWithGraph2.Monad0();
39991
- const Bind1 = Monad0.Bind1();
39992
40089
  const fresh = dictMonadWithGraphAlloc.MonadAlloc0().fresh;
39993
- return (dictLoadFile) => (v) => (v1) => (v2) => (v3) => {
39994
- if (v2.tag === "None") {
39995
- return $$new((\u03B1s$p) => (u$p) => $Val(\u03B1s$p, None, u$p))(v1)(v3);
39996
- }
39997
- return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(v)((() => {
39998
- const $0 = {};
39999
- $0.this = $Val(\u03B1, None, v3);
40000
- return $0;
40001
- })()))(v2))((vdoc) => Bind1.bind(MonadWithGraph2.extend($Tuple(\u03B1, pack10($Val(\u03B1, vdoc, v3))))(v1))(() => Monad0.Applicative0().pure($Val(\u03B1, vdoc, v3)))));
40090
+ return (dictMonadReader) => (dictMonadAff) => {
40091
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40092
+ const Bind1 = Monad0.Bind1();
40093
+ return (dictLoadFile) => (v) => (v1) => (v2) => (v3) => {
40094
+ if (v2.tag === "None") {
40095
+ return $$new((\u03B1s$p) => (u$p) => $Val(\u03B1s$p, None, u$p))(v1)(v3);
40096
+ }
40097
+ return Bind1.bind(fresh)((\u03B1) => Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity18)(v)((() => {
40098
+ const $0 = {};
40099
+ $0.this = $Val(\u03B1, None, v3);
40100
+ return $0;
40101
+ })()))(v2))((vdoc) => Bind1.bind(dictMonadWithGraphAlloc.MonadWithGraph2().extend($Tuple(\u03B1, pack10($Val(\u03B1, vdoc, v3))))(v1))(() => Monad0.Applicative0().pure($Val(
40102
+ \u03B1,
40103
+ vdoc,
40104
+ v3
40105
+ )))));
40106
+ };
40002
40107
  };
40003
40108
  };
40004
- var evalDocOpt = (dictMonadWithGraphAlloc) => {
40005
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
40109
+ var evalDocOpt = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
40110
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40006
40111
  const Applicative0 = Monad0.Applicative0();
40007
40112
  const $0 = Monad0.Bind1().Apply0().Functor0();
40008
40113
  const sequence2 = traversableList.traverse(Applicative0)(identity7);
@@ -40016,7 +40121,7 @@ var evalDocOpt = (dictMonadWithGraphAlloc) => {
40016
40121
  return Applicative0.pure($DocCommentElem("Token", v2._1));
40017
40122
  }
40018
40123
  if (v2.tag === "Unquote") {
40019
- return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v2._1)(setSet4.empty));
40124
+ return $0.map(Unquote)($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v2._1)(setSet4.empty));
40020
40125
  }
40021
40126
  fail();
40022
40127
  })(v1._1)));
@@ -40028,195 +40133,210 @@ var $$eval = (dictMonadWithGraphAlloc) => {
40028
40133
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
40029
40134
  const withMsg2 = withMsg(MonadError1);
40030
40135
  const MonadThrow0 = MonadError1.MonadThrow0();
40031
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
40032
- const Bind1 = Monad0.Bind1();
40033
- const $0 = Bind1.Apply0().Functor0();
40034
- const Applicative0 = Monad0.Applicative0();
40035
- const traverse2 = traversableList.traverse(Applicative0);
40036
- const traverse3 = traversablePair.traverse(Applicative0);
40037
40136
  const checkArity2 = checkArity(MonadError1);
40038
- const sequence2 = traversableArray.traverse(Applicative0)(identity5);
40039
40137
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
40040
40138
  const match1 = match(dictMonadWithGraphAlloc);
40041
40139
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
40042
- return (dictLoadFile) => (v) => (v1) => (v2) => {
40043
- if (v1.tag === "Var") {
40044
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
40045
- }
40046
- if (v1.tag === "Op") {
40047
- return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
40048
- }
40049
- if (v1.tag === "Int") {
40050
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Int", v1._3));
40051
- }
40052
- if (v1.tag === "Float") {
40053
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Float", v1._3));
40054
- }
40055
- if (v1.tag === "Str") {
40056
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal("Str", v1._3));
40057
- }
40058
- if (v1.tag === "Dictionary") {
40059
- const $1 = v1._2;
40060
- const $2 = v1._1;
40061
- return Bind1.bind($0.map(unzip3)(traverse2(traverse3((() => {
40062
- const $3 = $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v);
40063
- return (a) => $3(a)(v2);
40064
- })()))(v1._3)))((v3) => {
40065
- 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));
40066
- return new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)($2)()(v2))($1)($BaseVal(
40067
- "Dictionary",
40068
- fromFoldable110(zipWith2(Tuple)(v4._1)(zipWith2(Tuple)(v4._2)(v3._2)))
40140
+ return (dictMonadReader) => (dictMonadAff) => {
40141
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40142
+ const Bind1 = Monad0.Bind1();
40143
+ const $0 = Bind1.Apply0().Functor0();
40144
+ const Applicative0 = Monad0.Applicative0();
40145
+ const traverse2 = traversableList.traverse(Applicative0);
40146
+ const traverse3 = traversablePair.traverse(Applicative0);
40147
+ const sequence2 = traversableArray.traverse(Applicative0)(identity5);
40148
+ return (dictLoadFile) => (v) => (v1) => (v2) => {
40149
+ if (v1.tag === "Var") {
40150
+ return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
40151
+ }
40152
+ if (v1.tag === "Op") {
40153
+ return withMsg2("Variable lookup")(lookup$p(MonadThrow0)(showString)(mapEnvStringVal)(v1._1)(v));
40154
+ }
40155
+ if (v1.tag === "Int") {
40156
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
40157
+ "Int",
40158
+ v1._3
40069
40159
  ));
40070
- });
40071
- }
40072
- if (v1.tag === "Constr") {
40073
- const $1 = v1._3;
40074
- const $2 = v1._2;
40075
- const $3 = v1._4;
40076
- const $4 = v1._1;
40077
- return Bind1.bind(checkArity2($1)((() => {
40078
- const go = (go$a0$copy) => (go$a1$copy) => {
40079
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40080
- while (go$c) {
40081
- const b = go$a0, v$1 = go$a1;
40082
- if (v$1.tag === "Nil") {
40083
- go$c = false;
40084
- go$r = b;
40085
- continue;
40086
- }
40087
- if (v$1.tag === "Cons") {
40088
- go$a0 = b + 1 | 0;
40089
- go$a1 = v$1._2;
40090
- continue;
40160
+ }
40161
+ if (v1.tag === "Float") {
40162
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
40163
+ "Float",
40164
+ v1._3
40165
+ ));
40166
+ }
40167
+ if (v1.tag === "Str") {
40168
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)(v1._1)()(v2))(v1._2)($BaseVal(
40169
+ "Str",
40170
+ v1._3
40171
+ ));
40172
+ }
40173
+ if (v1.tag === "Dictionary") {
40174
+ const $1 = v1._2;
40175
+ const $2 = v1._1;
40176
+ return Bind1.bind($0.map(unzip3)(traverse2(traverse3((() => {
40177
+ const $3 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
40178
+ return (a) => $3(a)(v2);
40179
+ })()))(v1._3)))((v3) => {
40180
+ 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));
40181
+ return new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)($2)()(v2))($1)($BaseVal(
40182
+ "Dictionary",
40183
+ fromFoldable110(zipWith2(Tuple)(v4._1)(zipWith2(Tuple)(v4._2)(v3._2)))
40184
+ ));
40185
+ });
40186
+ }
40187
+ if (v1.tag === "Constr") {
40188
+ const $1 = v1._3;
40189
+ const $2 = v1._2;
40190
+ const $3 = v1._4;
40191
+ const $4 = v1._1;
40192
+ return Bind1.bind(checkArity2($1)((() => {
40193
+ const go = (go$a0$copy) => (go$a1$copy) => {
40194
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40195
+ while (go$c) {
40196
+ const b = go$a0, v$1 = go$a1;
40197
+ if (v$1.tag === "Nil") {
40198
+ go$c = false;
40199
+ go$r = b;
40200
+ continue;
40201
+ }
40202
+ if (v$1.tag === "Cons") {
40203
+ go$a0 = b + 1 | 0;
40204
+ go$a1 = v$1._2;
40205
+ continue;
40206
+ }
40207
+ fail();
40091
40208
  }
40092
- fail();
40093
- }
40094
- return go$r;
40095
- };
40096
- return go(0)($3);
40097
- })()))(() => Bind1.bind(traverse2((() => {
40098
- const $5 = $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v);
40099
- return (a) => $5(a)(v2);
40100
- })())($3))((vs) => new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)($4)()(v2))($2)($BaseVal("Constr", $1, vs))));
40101
- }
40102
- if (v1.tag === "Matrix") {
40103
- const $1 = v1._2;
40104
- const $2 = v1._3;
40105
- const $3 = v1._4._1;
40106
- const $4 = v1._4._2;
40107
- const $5 = v1._1;
40108
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
40109
- const v5 = intPair.unpack(v3._3);
40110
- const $6 = v5._1._1;
40111
- const $7 = v5._2._1;
40112
- const $8 = v5._1._2;
40113
- const $9 = v5._2._2;
40114
- return Bind1.bind(check(MonadThrow0)(greaterThanOrEq($Tuple($6, $7))($Tuple(1, 1)))("array must be at least (" + show32($Tuple(1, 1)) + "); got (" + show32($Tuple(
40115
- $6,
40116
- $7
40117
- )) + ")"))(() => Bind1.bind(sequence2(arrayBind(range(1)($6))((i) => [
40118
- sequence2(arrayBind(range(1)($7))((j) => [
40119
- $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(v)(disjointUnion2((() => {
40120
- const $10 = {};
40121
- $10[$3] = $Val($8, None, $BaseVal("Int", i));
40122
- return $10;
40123
- })())((() => {
40124
- const $10 = {};
40125
- $10[$4] = $Val($9, None, $BaseVal("Int", j));
40126
- return $10;
40127
- })())))($2)(v2)
40128
- ]))
40129
- ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictLoadFile)(v)(insert3(ordVertex)($5)()(v2))($1)($BaseVal(
40130
- "Matrix",
40131
- $Tuple(vss, $Tuple($Tuple($6, $8), $Tuple($7, $9)))
40209
+ return go$r;
40210
+ };
40211
+ return go(0)($3);
40212
+ })()))(() => Bind1.bind(traverse2((() => {
40213
+ const $5 = $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v);
40214
+ return (a) => $5(a)(v2);
40215
+ })())($3))((vs) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)($4)()(v2))($2)($BaseVal(
40216
+ "Constr",
40217
+ $1,
40218
+ vs
40132
40219
  ))));
40133
- });
40134
- }
40135
- if (v1.tag === "Lambda") {
40136
- return $$new((a) => Val(a)(None))(insert3(ordVertex)(v1._1)()(v2))($BaseVal(
40137
- "Fun",
40138
- $Fun(
40139
- "Closure",
40140
- (() => {
40141
- const $1 = fVElim.fv(v1._2);
40142
- return filterWithKey((x2) => {
40143
- const $2 = setSet(ordString).member(x2)($1);
40144
- return (v$1) => $2;
40145
- })(v);
40146
- })(),
40147
- empty,
40148
- v1._2
40149
- )
40150
- ));
40151
- }
40152
- if (v1.tag === "Project") {
40153
- const $1 = v1._1;
40154
- const $2 = v1._3;
40155
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
40156
- if (v3._3.tag === "Dictionary") {
40157
- return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $2 + '" not found')((() => {
40158
- const $3 = _lookup(Nothing, Just, $2, v3._3._1);
40159
- if ($3.tag === "Just") {
40160
- return $Maybe("Just", $3._1._2);
40161
- }
40162
- return Nothing;
40163
- })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v$p)($1));
40164
- }
40165
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dictionary"));
40166
- });
40167
- }
40168
- if (v1.tag === "DProject") {
40169
- const $1 = v1._1;
40170
- const $2 = v1._3;
40171
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._2)(v2))((v3) => Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)($2)(v2))((v$p) => {
40172
- if (v3._3.tag === "Dictionary") {
40173
- if (v$p._3.tag === "Str") {
40174
- return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
40175
- const $3 = _lookup(Nothing, Just, v$p._3._1, v3._3._1);
40220
+ }
40221
+ if (v1.tag === "Matrix") {
40222
+ const $1 = v1._2;
40223
+ const $2 = v1._3;
40224
+ const $3 = v1._4._1;
40225
+ const $4 = v1._4._2;
40226
+ const $5 = v1._1;
40227
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._5)(v2))((v3) => {
40228
+ const v5 = intPair.unpack(v3._3);
40229
+ const $6 = v5._1._1;
40230
+ const $7 = v5._2._1;
40231
+ const $8 = v5._1._2;
40232
+ const $9 = v5._2._2;
40233
+ return Bind1.bind(check(MonadThrow0)(greaterThanOrEq($Tuple($6, $7))($Tuple(1, 1)))("array must be at least (" + show32($Tuple(
40234
+ 1,
40235
+ 1
40236
+ )) + "); got (" + show32($Tuple($6, $7)) + ")"))(() => Bind1.bind(sequence2(arrayBind(range(1)($6))((i) => [
40237
+ sequence2(arrayBind(range(1)($7))((j) => [
40238
+ $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity18)(v)(disjointUnion2((() => {
40239
+ const $10 = {};
40240
+ $10[$3] = $Val($8, None, $BaseVal("Int", i));
40241
+ return $10;
40242
+ })())((() => {
40243
+ const $10 = {};
40244
+ $10[$4] = $Val($9, None, $BaseVal("Int", j));
40245
+ return $10;
40246
+ })())))($2)(v2)
40247
+ ]))
40248
+ ])))((vss) => new$p(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(insert3(ordVertex)($5)()(v2))($1)($BaseVal(
40249
+ "Matrix",
40250
+ $Tuple(vss, $Tuple($Tuple($6, $8), $Tuple($7, $9)))
40251
+ ))));
40252
+ });
40253
+ }
40254
+ if (v1.tag === "Lambda") {
40255
+ return $$new((a) => Val(a)(None))(insert3(ordVertex)(v1._1)()(v2))($BaseVal(
40256
+ "Fun",
40257
+ $Fun(
40258
+ "Closure",
40259
+ (() => {
40260
+ const $1 = fVElim.fv(v1._2);
40261
+ return filterWithKey((x2) => {
40262
+ const $2 = setSet(ordString).member(x2)($1);
40263
+ return (v$1) => $2;
40264
+ })(v);
40265
+ })(),
40266
+ empty,
40267
+ v1._2
40268
+ )
40269
+ ));
40270
+ }
40271
+ if (v1.tag === "Project") {
40272
+ const $1 = v1._1;
40273
+ const $2 = v1._3;
40274
+ return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v1._2)(v2))((v3) => {
40275
+ if (v3._3.tag === "Dictionary") {
40276
+ return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + $2 + '" not found')((() => {
40277
+ const $3 = _lookup(Nothing, Just, $2, v3._3._1);
40176
40278
  if ($3.tag === "Just") {
40177
40279
  return $Maybe("Just", $3._1._2);
40178
40280
  }
40179
40281
  return Nothing;
40180
- })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v$p$p)($1));
40282
+ })())))((v$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p)($1));
40181
40283
  }
40182
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v$p)).lines) + ", expected string"));
40183
- }
40184
- return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dict"));
40185
- }));
40186
- }
40187
- if (v1.tag === "App") {
40188
- const $1 = v1._1;
40189
- const $2 = v1._3;
40190
- 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) => {
40191
- const $3 = v4._3;
40192
- const $4 = v4._1;
40193
- return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(v)((() => {
40194
- const $5 = {};
40195
- $5.this = v4;
40196
- return $5;
40197
- })()))($1))((vdoc) => Applicative0.pure($Val($4, vdoc, $3)));
40198
- })));
40199
- }
40200
- if (v1.tag === "Let") {
40201
- const $1 = v1._2;
40202
- const $2 = v1._1._1;
40203
- return Bind1.bind($$eval(dictMonadWithGraphAlloc)(dictLoadFile)(v)(v1._1._2)(v2))((v3) => Bind1.bind(match1(v3)($2))((v4) => $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(v)(v4._1))($1)(v4._2._2)));
40204
- }
40205
- if (v1.tag === "LetRec") {
40206
- const $1 = v1._2;
40207
- const $2 = v1._1._1;
40208
- return Bind1.bind(closeDefs1(v)(v1._1._2)(insert3(ordVertex)($2)()(v2)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(v)(\u03B3$p))($1)(insert3(ordVertex)($2)()(v2)));
40209
- }
40210
- fail();
40284
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dictionary"));
40285
+ });
40286
+ }
40287
+ if (v1.tag === "DProject") {
40288
+ const $1 = v1._1;
40289
+ const $2 = v1._3;
40290
+ 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) => {
40291
+ if (v3._3.tag === "Dictionary") {
40292
+ if (v$p._3.tag === "Str") {
40293
+ return Bind1.bind(withMsg2("Dict lookup")(orElse(MonadThrow0)('Key "' + v$p._3._1 + '" not found')((() => {
40294
+ const $3 = _lookup(Nothing, Just, v$p._3._1, v3._3._1);
40295
+ if ($3.tag === "Just") {
40296
+ return $Maybe("Just", $3._1._2);
40297
+ }
40298
+ return Nothing;
40299
+ })())))((v$p$p) => concatDocs(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(v)(v$p$p)($1));
40300
+ }
40301
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v$p)).lines) + ", expected string"));
40302
+ }
40303
+ return MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v3)).lines) + ", expected dict"));
40304
+ }));
40305
+ }
40306
+ if (v1.tag === "App") {
40307
+ const $1 = v1._1;
40308
+ const $2 = v1._3;
40309
+ 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) => {
40310
+ const $3 = v4._3;
40311
+ const $4 = v4._1;
40312
+ return Bind1.bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity18)(v)((() => {
40313
+ const $5 = {};
40314
+ $5.this = v4;
40315
+ return $5;
40316
+ })()))($1))((vdoc) => Applicative0.pure($Val($4, vdoc, $3)));
40317
+ })));
40318
+ }
40319
+ if (v1.tag === "Let") {
40320
+ const $1 = v1._2;
40321
+ const $2 = v1._1._1;
40322
+ 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)(unionWith((v$1) => identity18)(v)(v4._1))($1)(v4._2._2)));
40323
+ }
40324
+ if (v1.tag === "LetRec") {
40325
+ const $1 = v1._2;
40326
+ const $2 = v1._1._1;
40327
+ return Bind1.bind(closeDefs1(v)(v1._1._2)(insert3(ordVertex)($2)()(v2)))((\u03B3$p) => $$eval(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity18)(v)(\u03B3$p))($1)(insert3(ordVertex)($2)()(v2)));
40328
+ }
40329
+ fail();
40330
+ };
40211
40331
  };
40212
40332
  };
40213
- var concatDocs = (dictMonadWithGraphAlloc) => {
40214
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
40333
+ var concatDocs = (dictMonadWithGraphAlloc) => (dictMonadReader) => (dictMonadAff) => {
40334
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40215
40335
  return (dictLoadFile) => (\u03B3) => (v) => (doc2) => {
40216
40336
  const $0 = v._3;
40217
40337
  const $1 = v._2;
40218
40338
  const $2 = v._1;
40219
- return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictLoadFile)(unionWith((v$1) => identity18)(\u03B3)((() => {
40339
+ return Monad0.Bind1().bind(evalDocOpt(dictMonadWithGraphAlloc)(dictMonadReader)(dictMonadAff)(dictLoadFile)(unionWith((v$1) => identity18)(\u03B3)((() => {
40220
40340
  const $3 = {};
40221
40341
  $3.this = $Val($2, None, $0);
40222
40342
  return $3;
@@ -40224,163 +40344,183 @@ var concatDocs = (dictMonadWithGraphAlloc) => {
40224
40344
  };
40225
40345
  };
40226
40346
  var apply2 = (dictMonadWithGraphAlloc) => {
40227
- const Bind1 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0().Bind1();
40228
40347
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
40229
40348
  const match1 = match(dictMonadWithGraphAlloc);
40230
40349
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
40231
40350
  const MonadError1 = dictMonadWithGraphAlloc.MonadError1();
40232
40351
  const MonadThrow0 = MonadError1.MonadThrow0();
40233
- return (dictLoadFile) => (v) => (v1) => {
40234
- const $0 = (v2) => MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v2)).lines) + ", expected function"));
40235
- if (v._3.tag === "Fun") {
40236
- if (v._3._1.tag === "Closure") {
40237
- const $1 = v._1;
40238
- const $2 = v._3._1._1;
40239
- const $3 = v._3._1._3;
40240
- 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)(unionWith((v$1) => identity18)(unionWith((v$1) => identity18)($2)(\u03B32))(v3._1))(v3._2._1.tag === "ContExpr" ? v3._2._1._1 : throwException(error("Expression expected"))())(insert3(ordVertex)($1)()(v3._2._2))));
40241
- }
40242
- if (v._3._1.tag === "Foreign") {
40243
- const $1 = v._3._1._1._2;
40244
- const vs$p = foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2);
40245
- if ((() => {
40246
- const go = (go$a0$copy) => (go$a1$copy) => {
40247
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40248
- while (go$c) {
40249
- const b = go$a0, v$1 = go$a1;
40250
- if (v$1.tag === "Nil") {
40251
- go$c = false;
40252
- go$r = b;
40253
- continue;
40254
- }
40255
- if (v$1.tag === "Cons") {
40256
- go$a0 = b + 1 | 0;
40257
- go$a1 = v$1._2;
40258
- continue;
40352
+ return (dictMonadReader) => (dictMonadAff) => {
40353
+ const Bind1 = dictMonadAff.MonadEffect0().Monad0().Bind1();
40354
+ return (dictLoadFile) => (v) => (v1) => {
40355
+ const $0 = (v2) => MonadThrow0.throwError(error("Found " + intercalate4("\n")(removeDocWS(prettyVal(highlightableVertex).pretty(v2)).lines) + ", expected function"));
40356
+ if (v._3.tag === "Fun") {
40357
+ if (v._3._1.tag === "Closure") {
40358
+ const $1 = v._1;
40359
+ const $2 = v._3._1._1;
40360
+ const $3 = v._3._1._3;
40361
+ 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)(unionWith((v$1) => identity18)(unionWith((v$1) => identity18)($2)(\u03B32))(v3._1))(v3._2._1.tag === "ContExpr" ? v3._2._1._1 : throwException(error("Expression expected"))())(insert3(ordVertex)($1)()(v3._2._2))));
40362
+ }
40363
+ if (v._3._1.tag === "Foreign") {
40364
+ const $1 = v._3._1._1._2;
40365
+ const vs$p = foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2);
40366
+ if ((() => {
40367
+ const go = (go$a0$copy) => (go$a1$copy) => {
40368
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40369
+ while (go$c) {
40370
+ const b = go$a0, v$1 = go$a1;
40371
+ if (v$1.tag === "Nil") {
40372
+ go$c = false;
40373
+ go$r = b;
40374
+ continue;
40375
+ }
40376
+ if (v$1.tag === "Cons") {
40377
+ go$a0 = b + 1 | 0;
40378
+ go$a1 = v$1._2;
40379
+ continue;
40380
+ }
40381
+ fail();
40259
40382
  }
40260
- fail();
40261
- }
40262
- return go$r;
40263
- };
40264
- return $1._1.arity > go(0)(vs$p);
40265
- })()) {
40266
- return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1, void 0, Leaf2))($BaseVal(
40267
- "Fun",
40268
- $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
40269
- ));
40383
+ return go$r;
40384
+ };
40385
+ return $1._1.arity > go(0)(vs$p);
40386
+ })()) {
40387
+ return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1, void 0, Leaf2))($BaseVal(
40388
+ "Fun",
40389
+ $Fun("Foreign", $Tuple(v._3._1._1._1, $1), vs$p)
40390
+ ));
40391
+ }
40392
+ return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictMonadAff)(dictMonadReader)(dictLoadFile)(vs$p);
40270
40393
  }
40271
- return $1._1.op(dictMonadWithGraphAlloc)(MonadError1)(dictLoadFile)(vs$p);
40272
- }
40273
- if (v._3._1.tag === "PartialConstr") {
40274
- const $1 = v._1;
40275
- const n = defined(arity(monadThrowExceptT(monadIdentity))(v._3._1._1));
40276
- const v$p = (() => {
40277
- const go = (go$a0$copy) => (go$a1$copy) => {
40278
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40279
- while (go$c) {
40280
- const b = go$a0, v$1 = go$a1;
40281
- if (v$1.tag === "Nil") {
40282
- go$c = false;
40283
- go$r = b;
40284
- continue;
40285
- }
40286
- if (v$1.tag === "Cons") {
40287
- go$a0 = b + 1 | 0;
40288
- go$a1 = v$1._2;
40289
- continue;
40394
+ if (v._3._1.tag === "PartialConstr") {
40395
+ const $1 = v._1;
40396
+ const n = defined(arity(monadThrowExceptT(monadIdentity))(v._3._1._1));
40397
+ const v$p = (() => {
40398
+ const go = (go$a0$copy) => (go$a1$copy) => {
40399
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40400
+ while (go$c) {
40401
+ const b = go$a0, v$1 = go$a1;
40402
+ if (v$1.tag === "Nil") {
40403
+ go$c = false;
40404
+ go$r = b;
40405
+ continue;
40406
+ }
40407
+ if (v$1.tag === "Cons") {
40408
+ go$a0 = b + 1 | 0;
40409
+ go$a1 = v$1._2;
40410
+ continue;
40411
+ }
40412
+ fail();
40290
40413
  }
40291
- fail();
40292
- }
40293
- return go$r;
40294
- };
40295
- return go(0)(v._3._1._2) < (n - 1 | 0);
40296
- })() ? $BaseVal(
40297
- "Fun",
40298
- $Fun(
40299
- "PartialConstr",
40414
+ return go$r;
40415
+ };
40416
+ return go(0)(v._3._1._2) < (n - 1 | 0);
40417
+ })() ? $BaseVal(
40418
+ "Fun",
40419
+ $Fun(
40420
+ "PartialConstr",
40421
+ v._3._1._1,
40422
+ foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
40423
+ )
40424
+ ) : $BaseVal(
40425
+ "Constr",
40300
40426
  v._3._1._1,
40301
40427
  foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2)
40302
- )
40303
- ) : $BaseVal("Constr", v._3._1._1, foldableList.foldr(Cons)($List("Cons", v1, Nil))(v._3._1._2));
40304
- return Bind1.bind(check(MonadThrow0)((() => {
40305
- const go = (go$a0$copy) => (go$a1$copy) => {
40306
- let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40307
- while (go$c) {
40308
- const b = go$a0, v$1 = go$a1;
40309
- if (v$1.tag === "Nil") {
40310
- go$c = false;
40311
- go$r = b;
40312
- continue;
40313
- }
40314
- if (v$1.tag === "Cons") {
40315
- go$a0 = b + 1 | 0;
40316
- go$a1 = v$1._2;
40317
- continue;
40428
+ );
40429
+ return Bind1.bind(check(MonadThrow0)((() => {
40430
+ const go = (go$a0$copy) => (go$a1$copy) => {
40431
+ let go$a0 = go$a0$copy, go$a1 = go$a1$copy, go$c = true, go$r;
40432
+ while (go$c) {
40433
+ const b = go$a0, v$1 = go$a1;
40434
+ if (v$1.tag === "Nil") {
40435
+ go$c = false;
40436
+ go$r = b;
40437
+ continue;
40438
+ }
40439
+ if (v$1.tag === "Cons") {
40440
+ go$a0 = b + 1 | 0;
40441
+ go$a1 = v$1._2;
40442
+ continue;
40443
+ }
40444
+ fail();
40318
40445
  }
40319
- fail();
40320
- }
40321
- return go$r;
40322
- };
40323
- return go(0)(v._3._1._2) < n;
40324
- })())("Too many arguments to " + showCtr(v._3._1._1)))(() => $$new((a) => Val(a)(None))($$$Map(
40325
- "Two",
40326
- Leaf2,
40327
- $1,
40328
- void 0,
40329
- Leaf2
40330
- ))(v$p));
40446
+ return go$r;
40447
+ };
40448
+ return go(0)(v._3._1._2) < n;
40449
+ })())("Too many arguments to " + showCtr(v._3._1._1)))(() => $$new((a) => Val(a)(None))($$$Map(
40450
+ "Two",
40451
+ Leaf2,
40452
+ $1,
40453
+ void 0,
40454
+ Leaf2
40455
+ ))(v$p));
40456
+ }
40331
40457
  }
40332
- }
40333
- return $0(v1);
40458
+ return $0(v1);
40459
+ };
40334
40460
  };
40335
40461
  };
40336
40462
  var eval_module = (dictMonadWithGraphAlloc) => {
40337
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
40338
- const $0 = Monad0.Bind1();
40339
40463
  const eval1 = $$eval(dictMonadWithGraphAlloc);
40340
40464
  const match1 = match(dictMonadWithGraphAlloc);
40341
40465
  const closeDefs1 = closeDefs(dictMonadWithGraphAlloc);
40342
- return (dictLoadFile) => {
40343
- const eval2 = eval1(dictLoadFile);
40344
- return (\u03B3) => {
40345
- const go = (v) => (v1) => (v2) => {
40346
- if (v1.tag === "Nil") {
40347
- return Monad0.Applicative0().pure(v);
40348
- }
40349
- if (v1.tag === "Cons") {
40350
- if (v1._1.tag === "Left") {
40351
- const $1 = v1._2;
40352
- const $2 = v1._1._1._1;
40353
- return $0.bind(eval2(unionWith((v$1) => identity18)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith((v$1) => identity18)(v)(v4._1))($1)(v4._2._2)));
40354
- }
40355
- if (v1._1.tag === "Right") {
40356
- const $1 = v1._2;
40357
- return $0.bind(closeDefs1(unionWith((v$1) => identity18)(\u03B3)(v))(v1._1._1._2)(insert3(ordVertex)(v1._1._1._1)()(v2)))((\u03B3$p$p) => go(unionWith((v$1) => identity18)(v)(\u03B3$p$p))($1)(v2));
40358
- }
40359
- }
40360
- fail();
40466
+ return (dictMonadReader) => {
40467
+ const eval2 = eval1(dictMonadReader);
40468
+ return (dictMonadAff) => {
40469
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40470
+ const $0 = Monad0.Bind1();
40471
+ const eval3 = eval2(dictMonadAff);
40472
+ return (dictLoadFile) => {
40473
+ const eval4 = eval3(dictLoadFile);
40474
+ return (\u03B3) => {
40475
+ const go = (v) => (v1) => (v2) => {
40476
+ if (v1.tag === "Nil") {
40477
+ return Monad0.Applicative0().pure(v);
40478
+ }
40479
+ if (v1.tag === "Cons") {
40480
+ if (v1._1.tag === "Left") {
40481
+ const $1 = v1._2;
40482
+ const $2 = v1._1._1._1;
40483
+ return $0.bind(eval4(unionWith((v$1) => identity18)(\u03B3)(v))(v1._1._1._2)(v2))((v3) => $0.bind(match1(v3)($2))((v4) => go(unionWith((v$1) => identity18)(v)(v4._1))($1)(v4._2._2)));
40484
+ }
40485
+ if (v1._1.tag === "Right") {
40486
+ const $1 = v1._2;
40487
+ return $0.bind(closeDefs1(unionWith((v$1) => identity18)(\u03B3)(v))(v1._1._1._2)(insert3(ordVertex)(v1._1._1._1)()(v2)))((\u03B3$p$p) => go(unionWith((v$1) => identity18)(v)(\u03B3$p$p))($1)(v2));
40488
+ }
40489
+ }
40490
+ fail();
40491
+ };
40492
+ return go(empty);
40493
+ };
40361
40494
  };
40362
- return go(empty);
40363
40495
  };
40364
40496
  };
40365
40497
  };
40366
40498
  var eval_progCxt = (dictMonadWithGraphAlloc) => {
40367
- const Monad0 = dictMonadWithGraphAlloc.MonadWithGraph2().Monad0();
40368
- const $0 = Monad0.Bind1();
40369
40499
  const eval_module1 = eval_module(dictMonadWithGraphAlloc);
40370
- const $1 = Monad0.Applicative0();
40371
40500
  const eval1 = $$eval(dictMonadWithGraphAlloc);
40372
- const concatM1 = concatM(Monad0);
40373
- return (dictLoadFile) => {
40374
- const eval_module2 = eval_module1(dictLoadFile);
40375
- const eval2 = eval1(dictLoadFile);
40376
- return (v) => concatM1(foldableList.foldr(Cons)(listMap((v1) => (\u03B3) => {
40377
- const $2 = v1._1;
40378
- return $0.bind(eval2(\u03B3)(v1._2)(setSet4.empty))((v2) => $1.pure(unionWith((v$1) => identity18)(\u03B3)((() => {
40379
- const $3 = {};
40380
- $3[$2] = v2;
40381
- return $3;
40382
- })())));
40383
- })(reverse2(v.datasets)))(listMap((mod) => (\u03B3) => $0.bind(eval_module2(\u03B3)(mod)(setSet4.empty))((\u03B3$p) => $1.pure(unionWith((v$1) => identity18)(\u03B3)(\u03B3$p))))(reverse2(v.mods))))(v.primitives);
40501
+ return (dictMonadReader) => {
40502
+ const eval_module2 = eval_module1(dictMonadReader);
40503
+ const eval2 = eval1(dictMonadReader);
40504
+ return (dictMonadAff) => {
40505
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
40506
+ const $0 = Monad0.Bind1();
40507
+ const eval_module3 = eval_module2(dictMonadAff);
40508
+ const $1 = Monad0.Applicative0();
40509
+ const eval3 = eval2(dictMonadAff);
40510
+ const concatM1 = concatM(Monad0);
40511
+ return (dictLoadFile) => {
40512
+ const eval_module4 = eval_module3(dictLoadFile);
40513
+ const eval4 = eval3(dictLoadFile);
40514
+ return (v) => concatM1(foldableList.foldr(Cons)(listMap((v1) => (\u03B3) => {
40515
+ const $2 = v1._1;
40516
+ return $0.bind(eval4(\u03B3)(v1._2)(setSet4.empty))((v2) => $1.pure(unionWith((v$1) => identity18)(\u03B3)((() => {
40517
+ const $3 = {};
40518
+ $3[$2] = v2;
40519
+ return $3;
40520
+ })())));
40521
+ })(reverse2(v.datasets)))(listMap((mod) => (\u03B3) => $0.bind(eval_module4(\u03B3)(mod)(setSet4.empty))((\u03B3$p) => $1.pure(unionWith((v$1) => identity18)(\u03B3)(\u03B3$p))))(reverse2(v.mods))))(v.primitives);
40522
+ };
40523
+ };
40384
40524
  };
40385
40525
  };
40386
40526
  var graphEval = (dictMonadAff) => {
@@ -40393,50 +40533,85 @@ var graphEval = (dictMonadAff) => {
40393
40533
  Applicative0: () => applicativeStateT(Monad0),
40394
40534
  Bind1: () => bindStateT(Monad0)
40395
40535
  })(graphGraphImpl);
40396
- const $1 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
40536
+ const monadAffState2 = monadAffState(dictMonadAff);
40537
+ const monadAffState1 = monadAffState(monadAffState2);
40538
+ const $1 = monadAffState2.MonadEffect0().Monad0();
40397
40539
  const $2 = dictMonadAff.MonadEffect0().Monad0();
40398
- return (dictLoadFile) => (dictMonadError) => {
40399
- const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))((() => {
40400
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
40401
- return {
40402
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
40403
- const $3 = loadFile1(folders);
40404
- return (x2) => {
40405
- const $4 = $3(x2);
40406
- 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(
40407
- x$1,
40408
- s
40409
- )));
40410
- };
40411
- }
40540
+ return (dictMonadReader) => {
40541
+ const monadReaderStateT2 = monadReaderStateT(monadReaderStateT(dictMonadReader));
40542
+ return (dictLoadFile) => (dictMonadError) => {
40543
+ const eval1 = $$eval(monadWithGraphAllocWithGr(dictMonadError))(monadReaderStateT2)(monadAffState1)((() => {
40544
+ const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
40545
+ return {
40546
+ loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
40547
+ const $3 = loadFile1(folders);
40548
+ return (x2) => {
40549
+ const $4 = $3(x2);
40550
+ 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(
40551
+ x$1,
40552
+ s
40553
+ )));
40554
+ };
40555
+ }
40556
+ };
40557
+ })());
40558
+ const check2 = check(monadThrowStateT(dictMonadError.MonadThrow0()));
40559
+ return (v) => (e) => {
40560
+ const $3 = v["\u03B3"];
40561
+ const $4 = spyFunWhen(false)("fwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(fwdSlice2);
40562
+ const $5 = spyFunWhen(false)("bwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(bwdSlice2);
40563
+ return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1($3)(e\u03B1)(Leaf2))(verticesEnvExprVertex.vertices($EnvExpr(
40564
+ $3,
40565
+ e\u03B1
40566
+ ))))((v1) => {
40567
+ const $6 = v1._1;
40568
+ const $7 = v1._2;
40569
+ return bindStateT2.bind(check2(difference2(ordDVertex$p)(verticesValVertex.vertices($7))(verticesGraphImpl.vertices($6)).tag === "Leaf")("outputs in graph"))(() => applicativeStateT(Monad0).pure($Tuple(
40570
+ $6,
40571
+ $Tuple($EnvExpr($3, e\u03B1), $7)
40572
+ )));
40573
+ })))(v.n))((v1) => Monad0.Applicative0().pure({
40574
+ g: v1._2._2._1,
40575
+ graph_fwd: (a) => (b) => $4($Tuple(a, b)),
40576
+ graph_bwd: (a) => (b) => $5($Tuple(a, b)),
40577
+ "in\u03B1": v1._2._2._2._1,
40578
+ "out\u03B1": v1._2._2._2._2
40579
+ }));
40412
40580
  };
40413
- })());
40414
- const check2 = check(monadThrowStateT(dictMonadError.MonadThrow0()));
40415
- return (v) => (e) => {
40416
- const $3 = v["\u03B3"];
40417
- const $4 = spyFunWhen(false)("fwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(fwdSlice2);
40418
- const $5 = spyFunWhen(false)("bwdSlice")((x2) => $Tuple(showVertices(x2._1), showEdgeList(toEdgeList(graphGraphImpl)(x2._2))))(showGraph(graphGraphImpl))(bwdSlice2);
40419
- return Monad0.Bind1().bind(runAllocT(Monad0)(bindStateT2.bind(alloc(e))((e\u03B1) => bindStateT2.bind(runWithGraphT_spy2(eval1($3)(e\u03B1)(Leaf2))(verticesEnvExprVertex.vertices($EnvExpr(
40420
- $3,
40421
- e\u03B1
40422
- ))))((v1) => {
40423
- const $6 = v1._1;
40424
- const $7 = v1._2;
40425
- return bindStateT2.bind(check2(difference2(ordDVertex$p)(verticesValVertex.vertices($7))(verticesGraphImpl.vertices($6)).tag === "Leaf")("outputs in graph"))(() => applicativeStateT(Monad0).pure($Tuple(
40426
- $6,
40427
- $Tuple($EnvExpr($3, e\u03B1), $7)
40428
- )));
40429
- })))(v.n))((v1) => Monad0.Applicative0().pure({
40430
- g: v1._2._2._1,
40431
- graph_fwd: (a) => (b) => $4($Tuple(a, b)),
40432
- graph_bwd: (a) => (b) => $5($Tuple(a, b)),
40433
- "in\u03B1": v1._2._2._2._1,
40434
- "out\u03B1": v1._2._2._2._2
40435
- }));
40436
40581
  };
40437
40582
  };
40438
40583
  };
40439
40584
 
40585
+ // output-es/Data.Argonaut.Decode.Error/index.js
40586
+ var $JsonDecodeError = (tag, _1, _2) => ({ tag, _1, _2 });
40587
+ var AtIndex = (value0) => (value1) => $JsonDecodeError("AtIndex", value0, value1);
40588
+ var AtKey = (value0) => (value1) => $JsonDecodeError("AtKey", value0, value1);
40589
+ var Named = (value0) => (value1) => $JsonDecodeError("Named", value0, value1);
40590
+ var MissingValue = /* @__PURE__ */ $JsonDecodeError("MissingValue");
40591
+ var showJsonDecodeError = {
40592
+ show: (v) => {
40593
+ if (v.tag === "TypeMismatch") {
40594
+ return "(TypeMismatch " + showStringImpl(v._1) + ")";
40595
+ }
40596
+ if (v.tag === "UnexpectedValue") {
40597
+ return "(UnexpectedValue " + stringify(v._1) + ")";
40598
+ }
40599
+ if (v.tag === "AtIndex") {
40600
+ return "(AtIndex " + showIntImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
40601
+ }
40602
+ if (v.tag === "AtKey") {
40603
+ return "(AtKey " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
40604
+ }
40605
+ if (v.tag === "Named") {
40606
+ return "(Named " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
40607
+ }
40608
+ if (v.tag === "MissingValue") {
40609
+ return "MissingValue";
40610
+ }
40611
+ fail();
40612
+ }
40613
+ };
40614
+
40440
40615
  // output-es/Data.CodePoint.Unicode/index.js
40441
40616
  var isUpper = (x2) => checkAttr([512, 524288])(x2);
40442
40617
  var isSpace = (c) => {
@@ -43721,7 +43896,7 @@ var matrixUpdate = /* @__PURE__ */ $Tuple(
43721
43896
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43722
43897
  return (dictMonadError) => {
43723
43898
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43724
- return (dictLoadFile) => (v) => {
43899
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43725
43900
  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") {
43726
43901
  const $0 = v._2._2._1;
43727
43902
  return $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._1, void 0, Leaf2))($BaseVal(
@@ -43740,12 +43915,12 @@ var matrixLookup = /* @__PURE__ */ $Tuple(
43740
43915
  /* @__PURE__ */ $ForeignOp$p({
43741
43916
  arity: 2,
43742
43917
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
43743
- const MonadThrow0 = dictMonadError.MonadThrow0();
43744
- return (dictLoadFile) => (v) => {
43918
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43919
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43745
43920
  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") {
43746
- 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));
43921
+ 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));
43747
43922
  }
43748
- return MonadThrow0.throwError(error("Matrix and pair of integers expected"));
43923
+ return $$throw2("Matrix and pair of integers expected");
43749
43924
  };
43750
43925
  }
43751
43926
  })
@@ -43759,6 +43934,32 @@ var log3 = (v2) => {
43759
43934
  }
43760
43935
  fail();
43761
43936
  };
43937
+ var loadJson = /* @__PURE__ */ $Tuple(
43938
+ "loadJson",
43939
+ /* @__PURE__ */ $ForeignOp$p({
43940
+ arity: 1,
43941
+ op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
43942
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43943
+ return (dictMonadAff) => {
43944
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
43945
+ const $0 = Monad0.Bind1();
43946
+ return (dictMonadReader) => {
43947
+ const ask = dictMonadReader.MonadAsk0().ask;
43948
+ return (dictLoadFile) => {
43949
+ const loadFile = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
43950
+ return (v) => {
43951
+ if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
43952
+ const $1 = v._1._3._1;
43953
+ return $0.bind(ask)((v1) => $0.bind(loadFile(v1.fluidSrcPaths)($1))((str) => Monad0.Applicative0().pure(throwException(error($1))())));
43954
+ }
43955
+ return $$throw2("String expected");
43956
+ };
43957
+ };
43958
+ };
43959
+ };
43960
+ }
43961
+ })
43962
+ );
43762
43963
  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));
43763
43964
  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));
43764
43965
  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));
@@ -43773,12 +43974,12 @@ var error_ = /* @__PURE__ */ $Tuple(
43773
43974
  /* @__PURE__ */ $ForeignOp$p({
43774
43975
  arity: 1,
43775
43976
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
43776
- const MonadThrow0 = dictMonadError.MonadThrow0();
43777
- return (dictLoadFile) => (v) => {
43977
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43978
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43778
43979
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Nil") {
43779
- return MonadThrow0.Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
43980
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(throwException(error(v._1._3._1))());
43780
43981
  }
43781
- return MonadThrow0.throwError(error("String expected"));
43982
+ return $$throw2("String expected");
43782
43983
  };
43783
43984
  }
43784
43985
  })
@@ -43791,26 +43992,28 @@ var dims = /* @__PURE__ */ $Tuple(
43791
43992
  op: (dictMonadWithGraphAlloc) => {
43792
43993
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43793
43994
  return (dictMonadError) => {
43794
- const MonadThrow0 = dictMonadError.MonadThrow0();
43795
- const $0 = MonadThrow0.Monad0().Bind1();
43796
- return (dictLoadFile) => (v) => {
43797
- if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
43798
- const $1 = v._1._3._1._2._2._1;
43799
- const $2 = v._1._1;
43800
- const $3 = v._1._3._1._2._2._2;
43801
- return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
43802
- "Int",
43803
- v._1._3._1._2._1._1
43804
- )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
43805
- "Int",
43806
- $1
43807
- )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
43808
- "Constr",
43809
- "Pair",
43810
- $List("Cons", v1, $List("Cons", v2, Nil))
43811
- ))));
43812
- }
43813
- return MonadThrow0.throwError(error("Matrix expected"));
43995
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43996
+ return (dictMonadAff) => {
43997
+ const $0 = dictMonadAff.MonadEffect0().Monad0().Bind1();
43998
+ return (dictMonadReader) => (dictLoadFile) => (v) => {
43999
+ if (v.tag === "Cons" && v._1._3.tag === "Matrix" && v._2.tag === "Nil") {
44000
+ const $1 = v._1._3._1._2._2._1;
44001
+ const $2 = v._1._1;
44002
+ const $3 = v._1._3._1._2._2._2;
44003
+ return $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, v._1._3._1._2._1._2, void 0, Leaf2))($BaseVal(
44004
+ "Int",
44005
+ v._1._3._1._2._1._1
44006
+ )))((v1) => $0.bind($$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $3, void 0, Leaf2))($BaseVal(
44007
+ "Int",
44008
+ $1
44009
+ )))((v2) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $2, void 0, Leaf2))($BaseVal(
44010
+ "Constr",
44011
+ "Pair",
44012
+ $List("Cons", v1, $List("Cons", v2, Nil))
44013
+ ))));
44014
+ }
44015
+ return $$throw2("Matrix expected");
44016
+ };
43814
44017
  };
43815
44018
  };
43816
44019
  }
@@ -43824,25 +44027,30 @@ var dict_map = /* @__PURE__ */ $Tuple(
43824
44027
  const apply3 = apply2(dictMonadWithGraphAlloc);
43825
44028
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43826
44029
  return (dictMonadError) => {
43827
- const MonadThrow0 = dictMonadError.MonadThrow0();
43828
- const Monad0 = MonadThrow0.Monad0();
43829
- const Bind1 = Monad0.Bind1();
43830
- const traverse1 = traversableDict.traverse(Monad0.Applicative0());
43831
- return (dictLoadFile) => {
43832
- const apply1 = apply3(dictLoadFile);
43833
- return (v) => {
43834
- if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
43835
- const $0 = v._1;
43836
- const $1 = v._2._1._1;
43837
- return Bind1.bind(traverse1((v2) => {
43838
- const $2 = v2._1;
43839
- return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply1($0)(v2._2));
43840
- })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
43841
- "Dictionary",
43842
- d$p
43843
- )));
43844
- }
43845
- return MonadThrow0.throwError(error("Function and dictionary expected"));
44030
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
44031
+ return (dictMonadAff) => {
44032
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
44033
+ const Bind1 = Monad0.Bind1();
44034
+ const traverse1 = traversableDict.traverse(Monad0.Applicative0());
44035
+ return (dictMonadReader) => {
44036
+ const apply1 = apply3(dictMonadReader)(dictMonadAff);
44037
+ return (dictLoadFile) => {
44038
+ const apply22 = apply1(dictLoadFile);
44039
+ return (v) => {
44040
+ if (v.tag === "Cons" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
44041
+ const $0 = v._1;
44042
+ const $1 = v._2._1._1;
44043
+ return Bind1.bind(traverse1((v2) => {
44044
+ const $2 = v2._1;
44045
+ return Bind1.Apply0().Functor0().map((v3) => $Tuple($2, v3))(apply22($0)(v2._2));
44046
+ })(v._2._1._3._1))((d$p) => $$new((a) => Val(a)(None))($$$Map("Two", Leaf2, $1, void 0, Leaf2))($BaseVal(
44047
+ "Dictionary",
44048
+ d$p
44049
+ )));
44050
+ }
44051
+ return $$throw2("Function and dictionary expected");
44052
+ };
44053
+ };
43846
44054
  };
43847
44055
  };
43848
44056
  };
@@ -43857,38 +44065,43 @@ var dict_intersectionWith = /* @__PURE__ */ $Tuple(
43857
44065
  const apply3 = apply2(dictMonadWithGraphAlloc);
43858
44066
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43859
44067
  return (dictMonadError) => {
43860
- const MonadThrow0 = dictMonadError.MonadThrow0();
43861
- const Monad0 = MonadThrow0.Monad0();
43862
- const Bind1 = Monad0.Bind1();
43863
- const Applicative0 = Monad0.Applicative0();
43864
- const $0 = Bind1.Apply0().Functor0();
43865
- return (dictLoadFile) => {
43866
- const apply1 = apply3(dictLoadFile);
43867
- return (v) => {
43868
- 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") {
43869
- const $1 = v._1;
43870
- const $2 = v._2._1._1;
43871
- const $3 = v._2._2._1._1;
43872
- return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity19)(intersectionWith_Object((v2) => (v3) => {
43873
- const $4 = v3._2;
43874
- const $5 = v2._1;
43875
- const $6 = v3._1;
43876
- return Bind1.bind(Bind1.bind(apply1($1)(v2._2))((a) => apply1(a)($4)))((v4) => Bind1.bind($$new((a) => Val(a)(None))(insert3(ordVertex)($6)()($$$Map(
43877
- "Two",
43878
- Leaf2,
43879
- $5,
43880
- void 0,
43881
- Leaf2
43882
- )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
43883
- })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert3(ordVertex)($3)()($$$Map(
43884
- "Two",
43885
- Leaf2,
43886
- $2,
43887
- void 0,
43888
- Leaf2
43889
- )))(v$p));
43890
- }
43891
- return MonadThrow0.throwError(error("Function and two dictionaries expected"));
44068
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
44069
+ return (dictMonadAff) => {
44070
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
44071
+ const Bind1 = Monad0.Bind1();
44072
+ const Applicative0 = Monad0.Applicative0();
44073
+ const $0 = Bind1.Apply0().Functor0();
44074
+ return (dictMonadReader) => {
44075
+ const apply1 = apply3(dictMonadReader)(dictMonadAff);
44076
+ return (dictLoadFile) => {
44077
+ const apply22 = apply1(dictLoadFile);
44078
+ return (v) => {
44079
+ 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") {
44080
+ const $1 = v._1;
44081
+ const $2 = v._2._1._1;
44082
+ const $3 = v._2._2._1._1;
44083
+ return Bind1.bind($0.map(Dictionary3)($0.map(DictRep)(traversableDict.traverse(Applicative0)(identity19)(intersectionWith_Object((v2) => (v3) => {
44084
+ const $4 = v3._2;
44085
+ const $5 = v2._1;
44086
+ const $6 = v3._1;
44087
+ return Bind1.bind(Bind1.bind(apply22($1)(v2._2))((a) => apply22(a)($4)))((v4) => Bind1.bind($$new((a) => Val(a)(None))(insert3(ordVertex)($6)()($$$Map(
44088
+ "Two",
44089
+ Leaf2,
44090
+ $5,
44091
+ void 0,
44092
+ Leaf2
44093
+ )))(v4._3))((v5) => Applicative0.pure($Tuple(v5._1, v4))));
44094
+ })(v._2._1._3._1)(v._2._2._1._3._1)))))((v$p) => $$new((a) => Val(a)(None))(insert3(ordVertex)($3)()($$$Map(
44095
+ "Two",
44096
+ Leaf2,
44097
+ $2,
44098
+ void 0,
44099
+ Leaf2
44100
+ )))(v$p));
44101
+ }
44102
+ return $$throw2("Function and two dictionaries expected");
44103
+ };
44104
+ };
43892
44105
  };
43893
44106
  };
43894
44107
  };
@@ -43901,7 +44114,7 @@ var dict_get = /* @__PURE__ */ $Tuple(
43901
44114
  arity: 2,
43902
44115
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
43903
44116
  const MonadThrow0 = dictMonadError.MonadThrow0();
43904
- return (dictLoadFile) => (v) => {
44117
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43905
44118
  if (v.tag === "Cons" && v._1._3.tag === "Str" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
43906
44119
  return orElse(MonadThrow0)('Key "' + v._1._3._1 + '" not found')((() => {
43907
44120
  const $0 = _lookup(Nothing, Just, v._1._3._1, v._2._1._3._1);
@@ -43923,19 +44136,24 @@ var dict_foldl = /* @__PURE__ */ $Tuple(
43923
44136
  op: (dictMonadWithGraphAlloc) => {
43924
44137
  const apply3 = apply2(dictMonadWithGraphAlloc);
43925
44138
  return (dictMonadError) => {
43926
- const MonadThrow0 = dictMonadError.MonadThrow0();
43927
- const Monad0 = MonadThrow0.Monad0();
43928
- return (dictLoadFile) => {
43929
- const apply1 = apply3(dictLoadFile);
43930
- return (v) => {
43931
- 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") {
43932
- const $0 = v._1;
43933
- return foldM4(Monad0)((u1) => (v2) => {
43934
- const $1 = v2._2;
43935
- return Monad0.Bind1().bind(apply1($0)(u1))((a) => apply1(a)($1));
43936
- })(v._2._1)(v._2._2._1._3._1);
43937
- }
43938
- return MonadThrow0.throwError(error("Function, value and dictionary expected"));
44139
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
44140
+ return (dictMonadAff) => {
44141
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
44142
+ return (dictMonadReader) => {
44143
+ const apply1 = apply3(dictMonadReader)(dictMonadAff);
44144
+ return (dictLoadFile) => {
44145
+ const apply22 = apply1(dictLoadFile);
44146
+ return (v) => {
44147
+ 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") {
44148
+ const $0 = v._1;
44149
+ return foldM4(Monad0)((u1) => (v2) => {
44150
+ const $1 = v2._2;
44151
+ return Monad0.Bind1().bind(apply22($0)(u1))((a) => apply22(a)($1));
44152
+ })(v._2._1)(v._2._2._1._3._1);
44153
+ }
44154
+ return $$throw2("Function, value and dictionary expected");
44155
+ };
44156
+ };
43939
44157
  };
43940
44158
  };
43941
44159
  };
@@ -43950,7 +44168,7 @@ var dict_disjointUnion = /* @__PURE__ */ $Tuple(
43950
44168
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43951
44169
  return (dictMonadError) => {
43952
44170
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43953
- return (dictLoadFile) => (v) => {
44171
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43954
44172
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
43955
44173
  return $$new((a) => Val(a)(None))(insert3(ordVertex)(v._2._1._1)()($$$Map(
43956
44174
  "Two",
@@ -43974,7 +44192,7 @@ var dict_difference = /* @__PURE__ */ $Tuple(
43974
44192
  const $$new = dictMonadWithGraphAlloc.new(typeNameVal);
43975
44193
  return (dictMonadError) => {
43976
44194
  const $$throw2 = $$throw(dictMonadError.MonadThrow0());
43977
- return (dictLoadFile) => (v) => {
44195
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
43978
44196
  if (v.tag === "Cons" && v._1._3.tag === "Dictionary" && v._2.tag === "Cons" && v._2._1._3.tag === "Dictionary" && v._2._2.tag === "Nil") {
43979
44197
  return $$new((a) => Val(a)(None))(insert3(ordVertex)(v._2._1._1)()($$$Map(
43980
44198
  "Two",
@@ -43995,13 +44213,13 @@ var debugLog = /* @__PURE__ */ $Tuple(
43995
44213
  /* @__PURE__ */ $ForeignOp$p({
43996
44214
  arity: 1,
43997
44215
  op: (dictMonadWithGraphAlloc) => (dictMonadError) => {
43998
- const MonadThrow0 = dictMonadError.MonadThrow0();
43999
- return (dictLoadFile) => (v) => {
44216
+ const $$throw2 = $$throw(dictMonadError.MonadThrow0());
44217
+ return (dictMonadAff) => (dictMonadReader) => (dictLoadFile) => (v) => {
44000
44218
  if (v.tag === "Cons" && v._2.tag === "Nil") {
44001
44219
  const $0 = v._1;
44002
- return MonadThrow0.Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
44220
+ return dictMonadAff.MonadEffect0().Monad0().Applicative0().pure(_trace($0, (v$1) => $0));
44003
44221
  }
44004
- return MonadThrow0.throwError(error("Single value expected"));
44222
+ return $$throw2("Single value expected");
44005
44223
  };
44006
44224
  }
44007
44225
  })
@@ -44015,6 +44233,7 @@ var primitives = /* @__PURE__ */ fromFoldable(foldableArray)([
44015
44233
  /* @__PURE__ */ extern1(debugLog),
44016
44234
  /* @__PURE__ */ extern1(dims),
44017
44235
  /* @__PURE__ */ extern1(error_),
44236
+ /* @__PURE__ */ extern1(loadJson),
44018
44237
  /* @__PURE__ */ unary2("floor")({ i: number5, o: $$int, fwd: floor2 }),
44019
44238
  /* @__PURE__ */ unary2("log")({ i: intOrNumber, o: number5, fwd: log3 }),
44020
44239
  /* @__PURE__ */ unary2("numToStr")({ i: intOrNumber, o: string2, fwd: numToStr }),
@@ -44092,7 +44311,6 @@ var verticesProgCxtVertex = {
44092
44311
  };
44093
44312
  var functorProgCxt = {
44094
44313
  map: (f) => (m) => ({
44095
- fluidSrcPaths: m.fluidSrcPaths,
44096
44314
  primitives: _fmapObject(m.primitives, functorVal.map(f)),
44097
44315
  mods: listMap(functorModule.map(f))(m.mods),
44098
44316
  datasets: listMap((m$1) => $Tuple(m$1._1, functorExpr.map(f)(m$1._2)))(m.datasets)
@@ -44162,7 +44380,7 @@ var traversableProgCxt = {
44162
44380
  const traverse7 = traversableExpr.traverse(dictApplicative);
44163
44381
  const traverse8 = traversableModule.traverse(dictApplicative);
44164
44382
  const traverse9 = traversableEnv.traverse(dictApplicative);
44165
- 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));
44383
+ 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));
44166
44384
  },
44167
44385
  sequence: (dictApplicative) => (v) => traversableProgCxt.traverse(dictApplicative)(identity32)(v),
44168
44386
  Functor0: () => functorProgCxt,
@@ -44208,7 +44426,6 @@ var module_2 = (dictMonadAff) => {
44208
44426
  return (folders) => (file) => (v) => {
44209
44427
  const $0 = v.mods;
44210
44428
  return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile(folders)(file))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
44211
- fluidSrcPaths: v.fluidSrcPaths,
44212
44429
  primitives: v.primitives,
44213
44430
  mods: $List("Cons", mod, $0),
44214
44431
  datasets: v.datasets
@@ -44229,36 +44446,41 @@ var initialConfig = (dictMonadAff) => {
44229
44446
  Applicative0: () => applicativeStateT(Monad0),
44230
44447
  Bind1: () => bindStateT(Monad0)
44231
44448
  })(graphGraphImpl);
44232
- const $2 = monadAffState(dictMonadAff).MonadEffect0().Monad0();
44449
+ const monadAffState2 = monadAffState(dictMonadAff);
44450
+ const monadAffState1 = monadAffState(monadAffState2);
44451
+ const $2 = monadAffState2.MonadEffect0().Monad0();
44233
44452
  const $3 = dictMonadAff.MonadEffect0().Monad0();
44234
44453
  return (dictMonadError) => {
44235
44454
  const eval_progCxt2 = eval_progCxt(monadWithGraphAllocWithGr(dictMonadError));
44236
- return (dictLoadFile) => {
44237
- const eval_progCxt1 = eval_progCxt2((() => {
44238
- const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
44239
- return {
44240
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
44241
- const $4 = loadFile1(folders);
44242
- return (x2) => {
44243
- const $5 = $4(x2);
44244
- 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(
44245
- x$1,
44246
- s
44247
- )));
44248
- };
44249
- }
44250
- };
44251
- })());
44252
- 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(
44253
- progCxt$p,
44254
- (() => {
44255
- const $4 = dictFV.fv(e);
44256
- return filterWithKey((x2) => {
44257
- const $5 = setSet(ordString).member(x2)($4);
44258
- return (v$1) => $5;
44259
- })(v._2);
44260
- })()
44261
- )))))(0))((v) => Applicative0.pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2 })));
44455
+ return (dictMonadReader) => {
44456
+ const eval_progCxt1 = eval_progCxt2(monadReaderStateT(monadReaderStateT(dictMonadReader)))(monadAffState1);
44457
+ return (dictLoadFile) => {
44458
+ const eval_progCxt22 = eval_progCxt1((() => {
44459
+ const loadFile1 = dictLoadFile.loadFile(dictMonadError)(dictMonadAff);
44460
+ return {
44461
+ loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => {
44462
+ const $4 = loadFile1(folders);
44463
+ return (x2) => {
44464
+ const $5 = $4(x2);
44465
+ 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(
44466
+ x$1,
44467
+ s
44468
+ )));
44469
+ };
44470
+ }
44471
+ };
44472
+ })());
44473
+ 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(
44474
+ progCxt$p,
44475
+ (() => {
44476
+ const $4 = dictFV.fv(e);
44477
+ return filterWithKey((x2) => {
44478
+ const $5 = setSet(ordString).member(x2)($4);
44479
+ return (v$1) => $5;
44480
+ })(v._2);
44481
+ })()
44482
+ )))))(0))((v) => Applicative0.pure({ n: v._1, progCxt: v._2._2._1, "\u03B3": v._2._2._2 })));
44483
+ };
44262
44484
  };
44263
44485
  };
44264
44486
  };
@@ -44269,13 +44491,17 @@ var prepConfig = (dictMonadAff) => {
44269
44491
  return (dictMonadError) => {
44270
44492
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
44271
44493
  const initialConfig2 = initialConfig1(dictMonadError);
44272
- return (dictLoadFile) => {
44273
- const initialConfig3 = initialConfig2(dictLoadFile)(fVExpr);
44274
- 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({
44275
- s,
44276
- e,
44277
- gconfig
44278
- }))));
44494
+ return (dictMonadReader) => {
44495
+ const ask = dictMonadReader.MonadAsk0().ask;
44496
+ const initialConfig3 = initialConfig2(dictMonadReader);
44497
+ return (dictLoadFile) => {
44498
+ const initialConfig4 = initialConfig3(dictLoadFile)(fVExpr);
44499
+ 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({
44500
+ s,
44501
+ e,
44502
+ gconfig
44503
+ })))));
44504
+ };
44279
44505
  };
44280
44506
  };
44281
44507
  };
@@ -44288,7 +44514,6 @@ var datasetAs = (dictMonadAff) => {
44288
44514
  const $1 = v1.datasets;
44289
44515
  const $2 = v._1;
44290
44516
  return $0.bind($0.bind(parseProgram(dictLoadFile)(folders)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
44291
- fluidSrcPaths: v1.fluidSrcPaths,
44292
44517
  primitives: v1.primitives,
44293
44518
  mods: v1.mods,
44294
44519
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -44305,18 +44530,20 @@ var loadProgCxt = (dictMonadAff) => {
44305
44530
  return (dictMonadError) => {
44306
44531
  const module_22 = module_1(dictMonadError);
44307
44532
  const datasetAs2 = datasetAs1(dictMonadError);
44308
- return (dictLoadFile) => {
44309
- const module_3 = module_22(dictLoadFile);
44310
- const datasetAs3 = datasetAs2(dictLoadFile);
44311
- return (v) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
44312
- fluidSrcPaths: v.fluidSrcPaths,
44313
- primitives,
44314
- mods: Nil,
44315
- datasets: Nil
44316
- }))(concatM1(arrayMap(module_3(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
44317
- const $1 = datasetAs3(v.fluidSrcPaths);
44318
- return (x2) => $1($Tuple(x2._1, x2._2));
44319
- })())(datasets)));
44533
+ return (dictMonadReader) => {
44534
+ const ask = dictMonadReader.MonadAsk0().ask;
44535
+ return (dictLoadFile) => {
44536
+ const module_3 = module_22(dictLoadFile);
44537
+ const datasetAs3 = datasetAs2(dictLoadFile);
44538
+ return (mods) => (datasets) => $0.bind(ask)((v) => $0.bind($0.bind(Monad0.Applicative0().pure({
44539
+ primitives,
44540
+ mods: Nil,
44541
+ datasets: Nil
44542
+ }))(concatM1(arrayMap(module_3(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
44543
+ const $1 = datasetAs3(v.fluidSrcPaths);
44544
+ return (x2) => $1($Tuple(x2._1, x2._2));
44545
+ })())(datasets))));
44546
+ };
44320
44547
  };
44321
44548
  };
44322
44549
  };
@@ -44669,114 +44896,118 @@ var loadFig = (dictMonadAff) => {
44669
44896
  return (dictMonadError) => {
44670
44897
  const loadProgCxt1 = loadProgCxt2(dictMonadError);
44671
44898
  const prepConfig1 = prepConfig2(dictMonadError);
44672
- return (dictLoadFile) => {
44673
- const loadProgCxt22 = loadProgCxt1(dictLoadFile);
44674
- const prepConfig22 = prepConfig1(dictLoadFile);
44675
- const graphEval1 = graphEval2(dictLoadFile)(dictMonadError);
44676
- return (v) => {
44677
- const $1 = v.file;
44678
- const $2 = v.fluidSrcPaths;
44679
- const $3 = v.inputs;
44680
- const $4 = v.linking;
44681
- return $0.bind(loadProgCxt22({ fluidSrcPaths: $2 })(v.imports)(v.datasets))((progCxt) => $0.bind(prepConfig22({ fluidSrcPaths: $2 })($1)(progCxt))((v1) => {
44682
- const $5 = v1.s;
44683
- return $0.bind(graphEval1(v1.gconfig)(v1.e))((v2) => {
44684
- const $6 = v2.g;
44685
- const $7 = v2["out\u03B1"];
44686
- const $8 = v2["in\u03B1"]._1;
44687
- const opEval = {
44688
- g: $GraphImpl({ out: v2.g._1.in_, in_: v2.g._1.out, sinks: v2.g._1.sources, sources: v2.g._1.sinks, vertices: v2.g._1.vertices }),
44689
- graph_fwd: v2.graph_fwd,
44690
- graph_bwd: v2.graph_bwd,
44691
- "in\u03B1": v2["out\u03B1"],
44692
- "out\u03B1": v2["in\u03B1"]
44693
- };
44694
- const inputs$p = fromFoldable25($3);
44695
- const v3 = functorEnvExpr.map((v$1) => {
44696
- })(v2["in\u03B1"]);
44697
- const $9 = unrestrictGC(boundedMeetSemilatticeBoo)(v3._1)(inputs$p);
44698
- const $10 = unprojExpr(boundedMeetSemilatticeBoo)($EnvExpr(v3._1, v3._2));
44699
- const $11 = filterWithKey((x2) => {
44700
- const $112 = setSet(ordString).member(x2)(inputs$p);
44701
- return (v$1) => $112;
44702
- })($8);
44703
- const $12 = _fmapObject($8, functorVal.map((v$1) => false));
44704
- const $13 = functorVal.map((v$1) => false)($7);
44705
- const graphgc_op = graphGC1(opEval);
44706
- const graphgc = graphGC22(v2);
44707
- const inertFwd = verticesGraphImpl.vertices(graphgc.fwd($10.fwd($9.fwd($12)))._2);
44708
- const inertBwd = setSet5.difference(verticesGraphImpl.vertices($6))(verticesGraphImpl.vertices(graphgc.bwd(functorVal.map((v$1) => true)($7))._2));
44709
- const $14 = select\u03B1s\u{1D539}Vertex2["select\u{1D539}s"]($8)(inertBwd);
44710
- const $15 = select\u{1D539}s($7)(inertFwd);
44711
- const $16 = _fmapObject($14, functorVal.map(selState));
44712
- const $17 = functorVal.map(selState)($15);
44713
- const demands = lift1($16)((v6) => {
44714
- const $18 = graphgc.bwd(v6);
44715
- return $Tuple($9.bwd($10.bwd($18._1)), $18._2);
44716
- });
44717
- const demandedBy = lift2($17)((\u03B31) => graphgc_op.bwd(deMorgan((x2) => $10.fwd($9.fwd(x2)))(\u03B31)));
44718
- return Monad0.Applicative0().pure({
44719
- spec: v,
44720
- s: $5,
44721
- "\u03B3": intersectionWith_Object(apply)(_fmapObject(
44722
- intersectionWith_Object(apply)(_fmapObject(
44723
- _fmapObject($14, functorVal.map(selStates)),
44899
+ return (dictMonadReader) => {
44900
+ const loadProgCxt22 = loadProgCxt1(dictMonadReader);
44901
+ const prepConfig22 = prepConfig1(dictMonadReader);
44902
+ const graphEval1 = graphEval2(dictMonadReader);
44903
+ return (dictLoadFile) => {
44904
+ const loadProgCxt3 = loadProgCxt22(dictLoadFile);
44905
+ const prepConfig3 = prepConfig22(dictLoadFile);
44906
+ const graphEval22 = graphEval1(dictLoadFile)(dictMonadError);
44907
+ return (v) => {
44908
+ const $1 = v.file;
44909
+ const $2 = v.inputs;
44910
+ const $3 = v.linking;
44911
+ return $0.bind(loadProgCxt3(v.imports)(v.datasets))((progCxt) => $0.bind(prepConfig3($1)(progCxt))((v1) => {
44912
+ const $4 = v1.s;
44913
+ return $0.bind(graphEval22(v1.gconfig)(v1.e))((v2) => {
44914
+ const $5 = v2.g;
44915
+ const $6 = v2["out\u03B1"];
44916
+ const $7 = v2["in\u03B1"]._1;
44917
+ const opEval = {
44918
+ g: $GraphImpl({ out: v2.g._1.in_, in_: v2.g._1.out, sinks: v2.g._1.sources, sources: v2.g._1.sinks, vertices: v2.g._1.vertices }),
44919
+ graph_fwd: v2.graph_fwd,
44920
+ graph_bwd: v2.graph_bwd,
44921
+ "in\u03B1": v2["out\u03B1"],
44922
+ "out\u03B1": v2["in\u03B1"]
44923
+ };
44924
+ const inputs$p = fromFoldable25($2);
44925
+ const v3 = functorEnvExpr.map((v$1) => {
44926
+ })(v2["in\u03B1"]);
44927
+ const $8 = unrestrictGC(boundedMeetSemilatticeBoo)(v3._1)(inputs$p);
44928
+ const $9 = unprojExpr(boundedMeetSemilatticeBoo)($EnvExpr(v3._1, v3._2));
44929
+ const $10 = filterWithKey((x2) => {
44930
+ const $102 = setSet(ordString).member(x2)(inputs$p);
44931
+ return (v$1) => $102;
44932
+ })($7);
44933
+ const $11 = _fmapObject($7, functorVal.map((v$1) => false));
44934
+ const $12 = functorVal.map((v$1) => false)($6);
44935
+ const graphgc_op = graphGC1(opEval);
44936
+ const graphgc = graphGC22(v2);
44937
+ const inertFwd = verticesGraphImpl.vertices(graphgc.fwd($9.fwd($8.fwd($11)))._2);
44938
+ const inertBwd = setSet5.difference(verticesGraphImpl.vertices($5))(verticesGraphImpl.vertices(graphgc.bwd(functorVal.map((v$1) => true)($6))._2));
44939
+ const $13 = select\u03B1s\u{1D539}Vertex2["select\u{1D539}s"]($7)(inertBwd);
44940
+ const $14 = select\u{1D539}s($6)(inertFwd);
44941
+ const $15 = _fmapObject($13, functorVal.map(selState));
44942
+ const $16 = functorVal.map(selState)($14);
44943
+ const demands = lift1($15)((v6) => {
44944
+ const $17 = graphgc.bwd(v6);
44945
+ return $Tuple($8.bwd($9.bwd($17._1)), $17._2);
44946
+ });
44947
+ const demandedBy = lift2($16)((\u03B31) => graphgc_op.bwd(deMorgan((x2) => $9.fwd($8.fwd(x2)))(\u03B31)));
44948
+ return Monad0.Applicative0().pure({
44949
+ spec: v,
44950
+ s: $4,
44951
+ "\u03B3": intersectionWith_Object(apply)(_fmapObject(
44952
+ intersectionWith_Object(apply)(_fmapObject(
44953
+ _fmapObject($13, functorVal.map(selStates)),
44954
+ applyVal.apply
44955
+ ))($11),
44724
44956
  applyVal.apply
44725
- ))($12),
44726
- applyVal.apply
44727
- ))($12),
44728
- v: applyVal.apply(applyVal.apply(functorVal.map(selStates)($15))($13))($13),
44729
- "\u03B9": empty,
44730
- linkedOutputs: (selType) => (v6) => {
44731
- const v$p = functorVal.map(getSel(selType))(v6);
44732
- const v7 = demands(v$p);
44733
- return $Tuple(v7._1, $Tuple($4 ? demandedBy(v7._1)._1 : v$p, verticesGraphImpl.vertices(v7._2)));
44734
- },
44735
- linkedInputs: (selType) => (\u03B31) => {
44736
- const \u03B3$p = _fmapObject(\u03B31, functorVal.map(getSel(selType)));
44737
- const v6 = demandedBy(\u03B3$p);
44738
- return $Tuple($4 ? demands(v6._1)._1 : \u03B3$p, $Tuple(v6._1, verticesGraphImpl.vertices(v6._2)));
44739
- },
44740
- linkIntermediates: (\u03B9) => {
44741
- const \u03B1s = select\u03B1s\u{1D539}Vertex2["select\u03B1s"](_fmapObject(
44742
- \u03B9,
44743
- functorVal.map((x2) => {
44744
- const $18 = getSel(Transient)(x2);
44745
- if ($18.tag === "Inert") {
44746
- return false;
44747
- }
44748
- if ($18.tag === "Reactive") {
44749
- return $18._1;
44750
- }
44751
- fail();
44752
- })
44753
- ))(\u03B9from\u03B1s(graphGraphImpl)($6)(mapObjectString.keys(\u03B9)));
44754
- return $Tuple(
44755
- intersectionWith_Object(apply)(_fmapObject($16, applyVal.apply))(select\u03B1s\u{1D539}Vertex2["select\u{1D539}s"]($8)(verticesGraphImpl.vertices(bwdSlice3($Tuple(
44756
- \u03B1s,
44757
- v2.g
44758
- ))))),
44759
- $Tuple(
44760
- applyVal.apply($17)(select\u{1D539}s($7)(verticesGraphImpl.vertices(bwdSlice3($Tuple(\u03B1s, opEval.g))))),
44761
- map2(ordDVertex$p)((\u03B1) => $Tuple(
44762
- \u03B1,
44763
- definitely("in graph")(_lookup(Nothing, Just, \u03B1, $6._1.out))._2
44764
- ))(\u03B1s)
44765
- )
44766
- );
44767
- },
44768
- dir: { persistent: LinkedOutputs, transient: LinkedOutputs },
44769
- in_views: _fmapObject($11, (v$1) => Nothing),
44770
- out_view: Nothing,
44771
- intermediate_views: empty,
44772
- in_roots: fold((z) => (v$1) => (a) => insert3(ordVertex)(a)()(z))(Leaf2)(_fmapObject(
44773
- $11,
44774
- (v6) => v6._1
44775
- )),
44776
- inerts: intersection3(inertFwd)(inertBwd)
44957
+ ))($11),
44958
+ v: applyVal.apply(applyVal.apply(functorVal.map(selStates)($14))($12))($12),
44959
+ "\u03B9": empty,
44960
+ linkedOutputs: (selType) => (v6) => {
44961
+ const v$p = functorVal.map(getSel(selType))(v6);
44962
+ const v7 = demands(v$p);
44963
+ return $Tuple(v7._1, $Tuple($3 ? demandedBy(v7._1)._1 : v$p, verticesGraphImpl.vertices(v7._2)));
44964
+ },
44965
+ linkedInputs: (selType) => (\u03B31) => {
44966
+ const \u03B3$p = _fmapObject(\u03B31, functorVal.map(getSel(selType)));
44967
+ const v6 = demandedBy(\u03B3$p);
44968
+ return $Tuple($3 ? demands(v6._1)._1 : \u03B3$p, $Tuple(v6._1, verticesGraphImpl.vertices(v6._2)));
44969
+ },
44970
+ linkIntermediates: (\u03B9) => {
44971
+ const \u03B1s = select\u03B1s\u{1D539}Vertex2["select\u03B1s"](_fmapObject(
44972
+ \u03B9,
44973
+ functorVal.map((x2) => {
44974
+ const $17 = getSel(Transient)(x2);
44975
+ if ($17.tag === "Inert") {
44976
+ return false;
44977
+ }
44978
+ if ($17.tag === "Reactive") {
44979
+ return $17._1;
44980
+ }
44981
+ fail();
44982
+ })
44983
+ ))(\u03B9from\u03B1s(graphGraphImpl)($5)(mapObjectString.keys(\u03B9)));
44984
+ return $Tuple(
44985
+ intersectionWith_Object(apply)(_fmapObject($15, applyVal.apply))(select\u03B1s\u{1D539}Vertex2["select\u{1D539}s"]($7)(verticesGraphImpl.vertices(bwdSlice3($Tuple(
44986
+ \u03B1s,
44987
+ v2.g
44988
+ ))))),
44989
+ $Tuple(
44990
+ applyVal.apply($16)(select\u{1D539}s($6)(verticesGraphImpl.vertices(bwdSlice3($Tuple(\u03B1s, opEval.g))))),
44991
+ map2(ordDVertex$p)((\u03B1) => $Tuple(
44992
+ \u03B1,
44993
+ definitely("in graph")(_lookup(Nothing, Just, \u03B1, $5._1.out))._2
44994
+ ))(\u03B1s)
44995
+ )
44996
+ );
44997
+ },
44998
+ dir: { persistent: LinkedOutputs, transient: LinkedOutputs },
44999
+ in_views: _fmapObject($10, (v$1) => Nothing),
45000
+ out_view: Nothing,
45001
+ intermediate_views: empty,
45002
+ in_roots: fold((z) => (v$1) => (a) => insert3(ordVertex)(a)()(z))(Leaf2)(_fmapObject(
45003
+ $10,
45004
+ (v6) => v6._1
45005
+ )),
45006
+ inerts: intersection3(inertFwd)(inertBwd)
45007
+ });
44777
45008
  });
44778
- });
44779
- }));
45009
+ }));
45010
+ };
44780
45011
  };
44781
45012
  };
44782
45013
  };
@@ -44934,36 +45165,6 @@ var drawFile = (v) => {
44934
45165
  };
44935
45166
  };
44936
45167
 
44937
- // output-es/Data.Argonaut.Decode.Error/index.js
44938
- var $JsonDecodeError = (tag, _1, _2) => ({ tag, _1, _2 });
44939
- var AtIndex = (value0) => (value1) => $JsonDecodeError("AtIndex", value0, value1);
44940
- var AtKey = (value0) => (value1) => $JsonDecodeError("AtKey", value0, value1);
44941
- var Named = (value0) => (value1) => $JsonDecodeError("Named", value0, value1);
44942
- var MissingValue = /* @__PURE__ */ $JsonDecodeError("MissingValue");
44943
- var showJsonDecodeError = {
44944
- show: (v) => {
44945
- if (v.tag === "TypeMismatch") {
44946
- return "(TypeMismatch " + showStringImpl(v._1) + ")";
44947
- }
44948
- if (v.tag === "UnexpectedValue") {
44949
- return "(UnexpectedValue " + stringify(v._1) + ")";
44950
- }
44951
- if (v.tag === "AtIndex") {
44952
- return "(AtIndex " + showIntImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
44953
- }
44954
- if (v.tag === "AtKey") {
44955
- return "(AtKey " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
44956
- }
44957
- if (v.tag === "Named") {
44958
- return "(Named " + showStringImpl(v._1) + " " + showJsonDecodeError.show(v._2) + ")";
44959
- }
44960
- if (v.tag === "MissingValue") {
44961
- return "MissingValue";
44962
- }
44963
- fail();
44964
- }
44965
- };
44966
-
44967
45168
  // output-es/Data.Argonaut.Decode.Decoders/index.js
44968
45169
  var traverseWithIndex = /* @__PURE__ */ (() => traversableWithIndexArray.traverseWithIndex(applicativeEither))();
44969
45170
  var decodeJArray = (x2) => {
@@ -45109,15 +45310,17 @@ var Folder = (x2) => x2;
45109
45310
 
45110
45311
  // output-es/Module.Web/index.js
45111
45312
  var findM = (xs) => (f) => (base2) => foldrArray((x2) => (acc) => applyAff.apply(_map(altEither.alt)(acc))(f(x2)))(_pure(base2))(xs);
45112
- var loadFileWebT = (dictMonadAff) => {
45113
- const Monad0 = dictMonadAff.MonadEffect0().Monad0();
45114
- const bindExceptT2 = bindExceptT(Monad0);
45115
- const applicativeExceptT2 = applicativeExceptT(Monad0);
45116
- const pure22 = Monad0.Applicative0().pure;
45117
- return (dictMonadError) => ({
45118
- loadFile: (dictMonadError1) => (dictMonadAff1) => (folders) => (v) => Monad0.Bind1().bind(bindExceptT2.bind(dictMonadAff1.liftAff(findM(arrayMap((() => {
45119
- const $0 = v + ".fld";
45120
- return (a) => a + "/" + $0;
45313
+ var loadFileWebT = (dictMonadThrow) => {
45314
+ const Monad0 = dictMonadThrow.Monad0();
45315
+ const bind1 = bindReaderT(Monad0.Bind1()).bind;
45316
+ const monadWebT1 = monadReaderT(Monad0);
45317
+ const bindExceptT2 = bindExceptT(monadWebT1);
45318
+ const applicativeExceptT2 = applicativeExceptT(monadWebT1);
45319
+ const $0 = Monad0.Applicative0();
45320
+ return {
45321
+ loadFile: (dictMonadError) => (dictMonadAff) => (folders) => (v) => bind1(bindExceptT2.bind(dictMonadAff.liftAff(findM(arrayMap((() => {
45322
+ const $1 = v + ".fld";
45323
+ return (a) => a + "/" + $1;
45121
45324
  })())(folders))((v1) => _bind(request(driver)({
45122
45325
  method: $Either("Left", HEAD),
45123
45326
  url: v1,
@@ -45140,10 +45343,10 @@ var loadFileWebT = (dictMonadAff) => {
45140
45343
  }
45141
45344
  fail();
45142
45345
  })())))($Either("Left", RequestFailedError))))((v1) => {
45143
- const $0 = v1._2;
45144
- return bindExceptT2.bind(applicativeExceptT2.pure())(() => bindExceptT2.bind(dictMonadAff1.liftAff(request(driver)({
45346
+ const $1 = v1._2;
45347
+ return bindExceptT2.bind(applicativeExceptT2.pure())(() => bindExceptT2.bind(dictMonadAff.liftAff(request(driver)({
45145
45348
  method: $Either("Left", GET),
45146
- url: $0,
45349
+ url: $1,
45147
45350
  headers: [],
45148
45351
  content: Nothing,
45149
45352
  username: Nothing,
@@ -45154,14 +45357,15 @@ var loadFileWebT = (dictMonadAff) => {
45154
45357
  })))((contents) => applicativeExceptT2.pure(contents.body)));
45155
45358
  }))((result) => {
45156
45359
  if (result.tag === "Left") {
45157
- return dictMonadError.MonadThrow0().throwError(error(printError(result._1)));
45360
+ return monadThrowReaderT(dictMonadThrow).throwError(error(printError(result._1)));
45158
45361
  }
45159
45362
  if (result.tag === "Right") {
45160
- return pure22(result._1);
45363
+ const $1 = $0.pure(result._1);
45364
+ return (v$1) => $1;
45161
45365
  }
45162
45366
  fail();
45163
45367
  })
45164
- });
45368
+ };
45165
45369
  };
45166
45370
 
45167
45371
  // output-es/App.LoadFigure/index.js
@@ -45234,8 +45438,10 @@ var decodeJson = /* @__PURE__ */ (() => decodeRecord(gDecodeJsonCons((() => {
45234
45438
  })()())({ reflectSymbol: () => "inputs" })()())({ reflectSymbol: () => "imports" })()())({ reflectSymbol: () => "fluidSrcPath" })()())({ reflectSymbol: () => "file" })()())({
45235
45439
  reflectSymbol: () => "datasets"
45236
45440
  })()())().decodeJson)();
45237
- var loadFileWebT2 = /* @__PURE__ */ loadFileWebT(monadAffAff)(monadErrorAff);
45238
- var loadFig2 = /* @__PURE__ */ loadFig(monadAffAff)(monadErrorAff)(loadFileWebT2);
45441
+ var monadAffWebT = /* @__PURE__ */ monadAffReader(monadAffAff);
45442
+ var monadErrorErrorWebT = /* @__PURE__ */ monadErrorReaderT(monadErrorAff);
45443
+ var loadFileWebT2 = /* @__PURE__ */ loadFileWebT(monadThrowAff);
45444
+ var loadFig2 = /* @__PURE__ */ loadFig(monadAffWebT)(monadErrorErrorWebT)(/* @__PURE__ */ monadReaderReaderT(monadAff))(loadFileWebT2);
45239
45445
  var loadFile$p = (folders) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().Apply0().Functor0().map((v) => $Tuple(file, v))(loadFileWebT2.loadFile(dictMonadError)(dictMonadAff)(folders)(file));
45240
45446
  var figSpecFromJson = (v) => ({
45241
45447
  fluidSrcPaths: arrayMap(Folder)(v.fluidSrcPath),
@@ -45272,13 +45478,14 @@ var loadFigure = (fileName) => runAffs_((v) => drawFig(v._1)(v._2))([
45272
45478
  return throwException(error("JSON decoding failed with " + showJsonDecodeError.show(v._1)))();
45273
45479
  }
45274
45480
  if (v.tag === "Right") {
45275
- return _map((v1) => $Tuple("fig", v1))(loadFig2(figSpecFromJson(v._1)));
45481
+ const v1 = figSpecFromJson(v._1);
45482
+ return _map((v2) => $Tuple("fig", v2))(loadFig2(v1)({ fluidSrcPaths: v1.fluidSrcPaths }));
45276
45483
  }
45277
45484
  }
45278
45485
  fail();
45279
45486
  })
45280
45487
  ]);
45281
- var drawCode2 = (folder) => (file) => runAffs_(drawFile)([loadFile$p([folder])(file)(monadAffAff)(monadErrorAff)]);
45488
+ var drawCode2 = (folder) => (file) => runAffs_(drawFile)([loadFile$p([folder])(file)(monadAffWebT)(monadErrorErrorWebT)({ fluidSrcPaths: [folder] })]);
45282
45489
  export {
45283
45490
  decodeJson,
45284
45491
  drawCode2 as drawCode,
@@ -45288,5 +45495,7 @@ export {
45288
45495
  loadFig2 as loadFig,
45289
45496
  loadFigure,
45290
45497
  loadFile$p,
45291
- loadFileWebT2 as loadFileWebT
45498
+ loadFileWebT2 as loadFileWebT,
45499
+ monadAffWebT,
45500
+ monadErrorErrorWebT
45292
45501
  };