@explorable-viz/fluid 0.7.59 → 0.7.61

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 6,
4
+ "sourceType": "module"
5
+ },
6
+ "extends": "eslint:recommended",
7
+ "env": {
8
+ "node": true
9
+ },
10
+ "rules": {
11
+ "strict": [2, "global"],
12
+ "block-scoped-var": 2,
13
+ "consistent-return": 2,
14
+ "eqeqeq": [2, "smart"],
15
+ "guard-for-in": 2,
16
+ "no-caller": 2,
17
+ "no-extend-native": 2,
18
+ "no-loop-func": 2,
19
+ "no-new": 2,
20
+ "no-param-reassign": 2,
21
+ "no-return-assign": 2,
22
+ "no-unused-expressions": 2,
23
+ "no-use-before-define": 2,
24
+ "radix": [2, "always"],
25
+ "indent": [2, 2],
26
+ "quotes": [2, "double"],
27
+ "semi": [2, "always"]
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ /.*
2
+ !/.gitignore
3
+ !/.eslintrc.json
4
+ !/.github/
5
+ /bower_components/
6
+ /node_modules/
7
+ /output/
8
+ package-lock.json
@@ -0,0 +1,29 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 6,
4
+ "sourceType": "module"
5
+ },
6
+ "extends": "eslint:recommended",
7
+ "env": {
8
+ "node": true
9
+ },
10
+ "rules": {
11
+ "strict": [2, "global"],
12
+ "block-scoped-var": 2,
13
+ "consistent-return": 2,
14
+ "eqeqeq": [2, "smart"],
15
+ "guard-for-in": 2,
16
+ "no-caller": 2,
17
+ "no-extend-native": 2,
18
+ "no-loop-func": 2,
19
+ "no-new": 2,
20
+ "no-param-reassign": 2,
21
+ "no-return-assign": 2,
22
+ "no-unused-expressions": 2,
23
+ "no-use-before-define": 2,
24
+ "radix": [2, "always"],
25
+ "indent": [2, 2],
26
+ "quotes": [2, "double"],
27
+ "semi": [2, "always"]
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ /.*
2
+ !/.gitignore
3
+ !/.eslintrc.json
4
+ !/.github/
5
+ /bower_components/
6
+ /node_modules/
7
+ /output/
8
+ package-lock.json
@@ -0,0 +1,29 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 6,
4
+ "sourceType": "module"
5
+ },
6
+ "extends": "eslint:recommended",
7
+ "env": {
8
+ "node": true
9
+ },
10
+ "rules": {
11
+ "strict": [2, "global"],
12
+ "block-scoped-var": 2,
13
+ "consistent-return": 2,
14
+ "eqeqeq": [2, "smart"],
15
+ "guard-for-in": 2,
16
+ "no-caller": 2,
17
+ "no-extend-native": 2,
18
+ "no-loop-func": 2,
19
+ "no-new": 2,
20
+ "no-param-reassign": 2,
21
+ "no-return-assign": 2,
22
+ "no-unused-expressions": 2,
23
+ "no-use-before-define": 2,
24
+ "radix": [2, "always"],
25
+ "indent": [2, 2],
26
+ "quotes": [2, "double"],
27
+ "semi": [2, "always"]
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ /.*
2
+ !/.gitignore
3
+ !/.eslintrc.json
4
+ !/.github/
5
+ /bower_components/
6
+ /node_modules/
7
+ /output/
8
+ package-lock.json
@@ -0,0 +1,8 @@
1
+ /.*
2
+ !/.github
3
+ !/.gitignore
4
+ !/.npmrc
5
+ !/.travis.yml
6
+ /bower_components/
7
+ /node_modules/
8
+ /output/
@@ -0,0 +1 @@
1
+ package-lock=false
package/README.md CHANGED
@@ -22,23 +22,42 @@ Additionally, for Windows users only:
22
22
  - Run `./script/setup/dev-setup.sh` from the top-level directory
23
23
  - Run `yarn build`
24
24
 
25
- #### Running tests on command line
25
+ ## Use
26
26
 
27
- After building, tests can be run from the command line via `yarn test-all`
27
+ The following assumes you have already succesfully run `yarn build` (see above).
28
28
 
29
- #### Running tests in browser
30
- - As per command-line tests above, but run `yarn test-browser`, which opens
31
- a browser window.
32
- - To observe the status of tests, click `Debug` in the browser window, and then open the JavaScript Console for your browser (e.g., via the Developer Tools).
29
+ ### Running programs from the command line
33
30
 
34
- #### Running the fluid.org website locally
31
+ Fluid examples in the `dist/fluid/fluid` can be evaluated from the command line as follows
32
+ (from the top-level directory):
35
33
 
36
- (Assumes you have already run `yarn build`)
34
+ ```
35
+ npx fluid evaluate -f <path>
36
+ ```
37
+ Note that the path is relative and should not include the `.fld` extension, e.g. for the `range.fld` example:
38
+ ```
39
+ % npx fluid evaluate -f example/range
40
+ ((0, 0) : ((0, 1) : ((1, 0) : ((1, 1) : []))))
41
+ Success
42
+ ```
43
+
44
+ ### Running the fluid.org website locally
37
45
 
38
46
  - `yarn serve fluid-org` (you may be prompted to proceed: type `y`).
39
47
  - Open a browser at the served URL (usually `127.0.0.1:8080`)
40
48
 
41
- #### Run Puppeteer tests for page Y of website X
49
+ ## Testing
50
+
51
+ ### Running the tests from the command line
52
+
53
+ After building, tests can be run from the command line via `yarn test-all`
54
+
55
+ ### Running tests in browser
56
+ - As per command-line tests above, but run `yarn test-browser`, which opens
57
+ a browser window.
58
+ - To observe the status of tests, click `Debug` in the browser window, and then open the JavaScript Console for your browser (e.g., via the Developer Tools).
59
+
60
+ ### Run Puppeteer tests for page Y of website X
42
61
 
43
62
  Rebuild with `puppeteerTests.headless` set to `false` to run in browser. Then:
44
63
  - `yarn bundle-website X`
Binary file
@@ -2,17 +2,17 @@ let likelihoodMap table prob = (fromSome (find (fun x -> x.prob <= prob) table))
2
2
 
3
3
  let mkPercent num = (numToStr (num * 100)) ++ "%";
4
4
 
5
- let leqP n m =
5
+ let leqP n m =
6
6
  if n <= m
7
7
  then "less"
8
8
  else "more";
9
9
 
10
- let gradedLeqP n m =
11
- let ratio = n / m
12
- in if ratio <= 1.0
10
+ let gradedLeqP n m =
11
+ let ratio = n / m
12
+ in if ratio <= 1.0
13
13
  then if ratio <=0.5
14
14
  then "much less"
15
15
  else "less"
16
16
  else if ratio >= 2.0
17
17
  then "much more"
18
- else "more";
18
+ else "more";
@@ -24828,17 +24828,18 @@ var parseProgram = (loadFile2) => (folder) => (file) => (dictMonadAff) => (dictM
24828
24828
  })());
24829
24829
  var module_2 = (dictMonadAff) => {
24830
24830
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
24831
- const $0 = Monad0.Bind1();
24831
+ const Bind1 = Monad0.Bind1();
24832
+ const Applicative0 = Monad0.Applicative0();
24832
24833
  return (dictMonadError) => {
24833
24834
  const parse1 = parse(dictMonadError);
24834
24835
  const desugarModuleFwd = moduleFwd(dictMonadError)(boundedLattice2);
24835
- return (loadFile2) => (file) => (v) => {
24836
- const $1 = v.mods;
24837
- return $0.bind(loadFile2("fluid")(file)(dictMonadAff)(dictMonadError))((src) => $0.bind($0.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Monad0.Applicative0().pure({
24836
+ return (loadFile2) => (folder) => (file) => (v) => {
24837
+ const $0 = v.mods;
24838
+ return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
24838
24839
  primitives: v.primitives,
24839
- mods: $List("Cons", mod, $1),
24840
+ mods: $List("Cons", mod, $0),
24840
24841
  datasets: v.datasets
24841
- })));
24842
+ }))));
24842
24843
  };
24843
24844
  };
24844
24845
  };
@@ -24872,7 +24873,7 @@ var prepConfig = (dictMonadAff) => {
24872
24873
  return (dictMonadError) => {
24873
24874
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
24874
24875
  const initialConfig1 = initialConfig(dictMonadError)(fVExpr);
24875
- return (loadFile2) => (file) => (progCxt) => $0.bind(parseProgram(loadFile2)("fluid/example")(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
24876
+ return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPath)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
24876
24877
  s,
24877
24878
  e,
24878
24879
  gconfig
@@ -24884,10 +24885,10 @@ var datasetAs = (dictMonadAff) => {
24884
24885
  const $0 = Monad0.Bind1();
24885
24886
  return (dictMonadError) => {
24886
24887
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
24887
- return (loadFile2) => (v) => (v1) => {
24888
+ return (loadFile2) => (folder) => (v) => (v1) => {
24888
24889
  const $1 = v1.datasets;
24889
24890
  const $2 = v._1;
24890
- return $0.bind($0.bind(parseProgram(loadFile2)("fluid")(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
24891
+ return $0.bind($0.bind(parseProgram(loadFile2)(folder)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
24891
24892
  primitives: v1.primitives,
24892
24893
  mods: v1.mods,
24893
24894
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -24904,12 +24905,12 @@ var loadProgCxt = (dictMonadAff) => {
24904
24905
  return (dictMonadError) => {
24905
24906
  const module_22 = module_1(dictMonadError);
24906
24907
  const datasetAs2 = datasetAs1(dictMonadError);
24907
- return (loadFile2) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
24908
+ return (v) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
24908
24909
  primitives,
24909
24910
  mods: Nil,
24910
24911
  datasets: Nil
24911
- }))(concatM1(arrayMap(module_22(loadFile2))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
24912
- const $1 = datasetAs2(loadFile2);
24912
+ }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPath))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
24913
+ const $1 = datasetAs2(v.loadFile)(v.fluidSrcPath);
24913
24914
  return (x) => $1($Tuple(x._1, x._2));
24914
24915
  })())(datasets)));
24915
24916
  };
@@ -25068,6 +25069,20 @@ var loadFile = (v) => (v1) => (dictMonadAff) => {
25068
25069
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
25069
25070
  return (dictMonadError) => Monad0.Bind1().bind(dictMonadAff.liftAff(toAff2(readTextFile)(UTF8)(v + "/" + v1 + ".fld")))((buffer) => Monad0.Applicative0().pure(buffer));
25070
25071
  };
25072
+ var loadProgCxt2 = (dictMonadAff) => {
25073
+ const loadProgCxt1 = loadProgCxt(dictMonadAff);
25074
+ return (dictMonadError) => {
25075
+ const loadProgCxt22 = loadProgCxt1(dictMonadError);
25076
+ return (fluidSrcPath) => loadProgCxt22({ loadFile, fluidSrcPath });
25077
+ };
25078
+ };
25079
+ var prepConfig2 = (dictMonadAff) => {
25080
+ const prepConfig1 = prepConfig(dictMonadAff);
25081
+ return (dictMonadError) => {
25082
+ const prepConfig22 = prepConfig1(dictMonadError);
25083
+ return (fluidSrcPath) => prepConfig22({ loadFile, fluidSrcPath });
25084
+ };
25085
+ };
25071
25086
 
25072
25087
  // output-es/Node.ChildProcess/foreign.js
25073
25088
  import { spawn, exec, execFile, execSync, execFileSync, fork as cp_fork } from "child_process";
@@ -28359,8 +28374,8 @@ var execParserPure = (pprefs) => (pinfo) => (args) => {
28359
28374
  // output-es/Fluid/index.js
28360
28375
  var $Command = (tag, _1, _2) => ({ tag, _1, _2 });
28361
28376
  var $Program = (_1) => ({ tag: "Program", _1 });
28362
- var loadProgCxt2 = /* @__PURE__ */ loadProgCxt(monadAffAff)(monadErrorAff)(loadFile);
28363
- var prepConfig2 = /* @__PURE__ */ prepConfig(monadAffAff)(monadErrorAff)(loadFile);
28377
+ var loadProgCxt3 = /* @__PURE__ */ loadProgCxt2(monadAffAff)(monadErrorAff);
28378
+ var prepConfig3 = /* @__PURE__ */ prepConfig2(monadAffAff)(monadErrorAff);
28364
28379
  var graphEval2 = /* @__PURE__ */ graphEval(monadErrorAff);
28365
28380
  var fromFoldable29 = /* @__PURE__ */ (() => fromFoldableImpl(foldableList.foldr))();
28366
28381
  var Evaluate = (value0) => $Command("Evaluate", value0);
@@ -28368,7 +28383,7 @@ var Publish = (value0) => (value1) => $Command("Publish", value0, value1);
28368
28383
  var parseImports = /* @__PURE__ */ $Parser(
28369
28384
  "BindP",
28370
28385
  /* @__PURE__ */ manyM(/* @__PURE__ */ option(readerAsk)(/* @__PURE__ */ (() => {
28371
- const $0 = help("A comma separated list of import file locations");
28386
+ const $0 = help("Comma-separated list of files to import");
28372
28387
  const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28373
28388
  const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28374
28389
  return $Mod(
@@ -28384,7 +28399,7 @@ var parseImports = /* @__PURE__ */ $Parser(
28384
28399
  );
28385
28400
  var evaluate = (v) => {
28386
28401
  const $0 = v._1.fileName;
28387
- return _bind(loadProgCxt2(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig2($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure($Val(
28402
+ return _bind(loadProgCxt3("fluid")(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig3("fluid")($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure($Val(
28388
28403
  void 0,
28389
28404
  functorBaseVal.map((v$1) => {
28390
28405
  })(v2["out\u03B1"]._2)
@@ -28401,19 +28416,22 @@ var copyOptions = {
28401
28416
  encoding: Nothing,
28402
28417
  shell: Nothing
28403
28418
  };
28404
- var publish = (website) => ($$package) => exec2($$package ? "./node_modules/@explorable-viz/fluid/script/bundle-website.sh -w " + website + " -r true" : "./script/bundle-website.sh -w " + website)(copyOptions)((v) => {
28405
- if (v.error.tag === "Just") {
28406
- return log(showErrorImpl(v.error._1));
28407
- }
28408
- if (v.error.tag === "Nothing") {
28409
- const $0 = toString2(monadEffect)(ASCII)(v.stdout);
28410
- return () => {
28411
- const $1 = $0();
28412
- return log($1)();
28413
- };
28414
- }
28415
- fail();
28416
- });
28419
+ var publish = (website) => ($$package) => {
28420
+ const cmd$p = "/script/bundle-website.sh -w " + website;
28421
+ return exec2($$package ? "./node_modules/@explorable-viz/fluid" + cmd$p + " -r true" : "." + cmd$p)(copyOptions)((v) => {
28422
+ if (v.error.tag === "Just") {
28423
+ return log(showErrorImpl(v.error._1));
28424
+ }
28425
+ if (v.error.tag === "Nothing") {
28426
+ const $0 = toString2(monadEffect)(ASCII)(v.stdout);
28427
+ return () => {
28428
+ const $1 = $0();
28429
+ return log($1)();
28430
+ };
28431
+ }
28432
+ fail();
28433
+ });
28434
+ };
28417
28435
  var dispatchCommand = (v) => {
28418
28436
  if (v.tag === "Evaluate") {
28419
28437
  return _bind(evaluate(v._1))((v1) => _liftEffect(log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v1)).lines))));
@@ -28459,24 +28477,10 @@ var parsePair = /* @__PURE__ */ between3("(")(")")((s) => {
28459
28477
  }
28460
28478
  return $Either("Left", "Expected a pair but got " + s);
28461
28479
  });
28462
- var parseDataset$p = (s) => {
28463
- const $0 = parsePair(s);
28464
- return (() => {
28465
- if ($0.tag === "Left") {
28466
- const $1 = $0._1;
28467
- return (v) => $Either("Left", $1);
28468
- }
28469
- if ($0.tag === "Right") {
28470
- const $1 = $0._1;
28471
- return (f) => f($1);
28472
- }
28473
- fail();
28474
- })()((dataset) => $Either("Right", dataset));
28475
- };
28476
28480
  var parseDatasets = /* @__PURE__ */ $Parser(
28477
28481
  "BindP",
28478
- /* @__PURE__ */ manyM(/* @__PURE__ */ option(/* @__PURE__ */ eitherReader(parseDataset$p))(/* @__PURE__ */ (() => {
28479
- const $0 = help("A comma separated list of datasets");
28482
+ /* @__PURE__ */ manyM(/* @__PURE__ */ option(/* @__PURE__ */ eitherReader(parsePair))(/* @__PURE__ */ (() => {
28483
+ const $0 = help("Comma-separated list of datasets");
28480
28484
  const $1 = $0._2._1.tag === "Nothing" ? Nothing : $0._2._1;
28481
28485
  const $2 = $0._2._2.tag === "Nothing" ? Nothing : $0._2._2;
28482
28486
  return $Mod(
@@ -43673,17 +43673,18 @@ var parseProgram = (loadFile2) => (folder) => (file) => (dictMonadAff) => (dictM
43673
43673
  })());
43674
43674
  var module_2 = (dictMonadAff) => {
43675
43675
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
43676
- const $0 = Monad0.Bind1();
43676
+ const Bind1 = Monad0.Bind1();
43677
+ const Applicative0 = Monad0.Applicative0();
43677
43678
  return (dictMonadError) => {
43678
43679
  const parse1 = parse(dictMonadError);
43679
43680
  const desugarModuleFwd = moduleFwd(dictMonadError)(boundedLattice2);
43680
- return (loadFile2) => (file) => (v) => {
43681
- const $1 = v.mods;
43682
- return $0.bind(loadFile2("fluid")(file)(dictMonadAff)(dictMonadError))((src) => $0.bind($0.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Monad0.Applicative0().pure({
43681
+ return (loadFile2) => (folder) => (file) => (v) => {
43682
+ const $0 = v.mods;
43683
+ return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
43683
43684
  primitives: v.primitives,
43684
- mods: $List("Cons", mod, $1),
43685
+ mods: $List("Cons", mod, $0),
43685
43686
  datasets: v.datasets
43686
- })));
43687
+ }))));
43687
43688
  };
43688
43689
  };
43689
43690
  };
@@ -43717,7 +43718,7 @@ var prepConfig = (dictMonadAff) => {
43717
43718
  return (dictMonadError) => {
43718
43719
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
43719
43720
  const initialConfig1 = initialConfig(dictMonadError)(fVExpr);
43720
- return (loadFile2) => (file) => (progCxt) => $0.bind(parseProgram(loadFile2)("fluid/example")(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
43721
+ return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPath)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
43721
43722
  s,
43722
43723
  e,
43723
43724
  gconfig
@@ -43729,10 +43730,10 @@ var datasetAs = (dictMonadAff) => {
43729
43730
  const $0 = Monad0.Bind1();
43730
43731
  return (dictMonadError) => {
43731
43732
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
43732
- return (loadFile2) => (v) => (v1) => {
43733
+ return (loadFile2) => (folder) => (v) => (v1) => {
43733
43734
  const $1 = v1.datasets;
43734
43735
  const $2 = v._1;
43735
- return $0.bind($0.bind(parseProgram(loadFile2)("fluid")(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
43736
+ return $0.bind($0.bind(parseProgram(loadFile2)(folder)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
43736
43737
  primitives: v1.primitives,
43737
43738
  mods: v1.mods,
43738
43739
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -43749,12 +43750,12 @@ var loadProgCxt = (dictMonadAff) => {
43749
43750
  return (dictMonadError) => {
43750
43751
  const module_22 = module_1(dictMonadError);
43751
43752
  const datasetAs2 = datasetAs1(dictMonadError);
43752
- return (loadFile2) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
43753
+ return (v) => (mods) => (datasets) => $0.bind($0.bind(Monad0.Applicative0().pure({
43753
43754
  primitives,
43754
43755
  mods: Nil,
43755
43756
  datasets: Nil
43756
- }))(concatM1(arrayMap(module_22(loadFile2))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
43757
- const $1 = datasetAs2(loadFile2);
43757
+ }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPath))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
43758
+ const $1 = datasetAs2(v.loadFile)(v.fluidSrcPath);
43758
43759
  return (x2) => $1($Tuple(x2._1, x2._2));
43759
43760
  })())(datasets)));
43760
43761
  };
@@ -43765,9 +43766,10 @@ var loadFile = (v) => (v1) => (dictMonadAff) => {
43765
43766
  const MonadEffect0 = dictMonadAff.MonadEffect0();
43766
43767
  const Monad0 = MonadEffect0.Monad0();
43767
43768
  const Bind1 = Monad0.Bind1();
43769
+ const Applicative0 = Monad0.Applicative0();
43768
43770
  return (dictMonadError) => Bind1.bind(dictMonadAff.liftAff(request(driver)({
43769
43771
  method: $Either("Left", GET),
43770
- url: "/" + v + "/" + v1 + ".fld",
43772
+ url: v + "/" + v1 + ".fld",
43771
43773
  headers: [],
43772
43774
  content: Nothing,
43773
43775
  username: Nothing,
@@ -43781,12 +43783,27 @@ var loadFile = (v) => (v1) => (dictMonadAff) => {
43781
43783
  return Bind1.bind(MonadEffect0.liftEffect(log2("Failed with " + printError($0))))(() => dictMonadError.MonadThrow0().throwError(error(printError($0))));
43782
43784
  }
43783
43785
  if (result.tag === "Right") {
43784
- return Monad0.Applicative0().pure(result._1.body);
43786
+ const $0 = result._1;
43787
+ return Bind1.bind(Applicative0.pure())(() => Applicative0.pure($0.body));
43785
43788
  }
43786
43789
  fail();
43787
43790
  });
43788
43791
  };
43789
43792
  var loadFile$p = (folder) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().Apply0().Functor0().map((v) => $Tuple(file, v))(loadFile(folder)(file)(dictMonadAff)(dictMonadError));
43793
+ var loadProgCxt2 = (dictMonadAff) => {
43794
+ const loadProgCxt1 = loadProgCxt(dictMonadAff);
43795
+ return (dictMonadError) => {
43796
+ const loadProgCxt22 = loadProgCxt1(dictMonadError);
43797
+ return (fluidSrcPath) => loadProgCxt22({ loadFile, fluidSrcPath });
43798
+ };
43799
+ };
43800
+ var prepConfig2 = (dictMonadAff) => {
43801
+ const prepConfig1 = prepConfig(dictMonadAff);
43802
+ return (dictMonadError) => {
43803
+ const prepConfig22 = prepConfig1(dictMonadError);
43804
+ return (fluidSrcPath) => prepConfig22({ loadFile, fluidSrcPath });
43805
+ };
43806
+ };
43790
43807
 
43791
43808
  // output-es/App.Fig/index.js
43792
43809
  var highlightableSelState2 = /* @__PURE__ */ highlightableSelState(highlightableBoolean)(joinSemilatticeBoolean);
@@ -43972,67 +43989,68 @@ var lift3 = /* @__PURE__ */ lift(applyVal)(applyEnv);
43972
43989
  var loadFig = (v) => (dictMonadAff) => {
43973
43990
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
43974
43991
  const $0 = Monad0.Bind1();
43975
- const loadProgCxt1 = loadProgCxt(dictMonadAff);
43976
- const prepConfig1 = prepConfig(dictMonadAff);
43992
+ const loadProgCxt3 = loadProgCxt2(dictMonadAff);
43993
+ const prepConfig3 = prepConfig2(dictMonadAff);
43977
43994
  return (dictMonadError) => {
43978
- const prepConfig1$1 = prepConfig1(dictMonadError)(loadFile);
43995
+ const prepConfig1 = prepConfig3(dictMonadError);
43979
43996
  const graphEval2 = graphEval(dictMonadError);
43980
43997
  const $1 = v.file;
43981
- const $2 = v.inputs;
43982
- return $0.bind(loadProgCxt1(dictMonadError)(loadFile)(v.imports)(v.datasets))((progCxt) => $0.bind(prepConfig1$1($1)(progCxt))((v1) => {
43983
- const $3 = v1.s;
43998
+ const $2 = v.fluidSrcPath;
43999
+ const $3 = v.inputs;
44000
+ return $0.bind(loadProgCxt3(dictMonadError)($2)(v.imports)(v.datasets))((progCxt) => $0.bind(prepConfig1($2)($1)(progCxt))((v1) => {
44001
+ const $4 = v1.s;
43984
44002
  return $0.bind(graphEval2(v1.gconfig)(v1.e))((v2) => {
43985
44003
  const v3 = functorEnvExpr.map((v$1) => {
43986
44004
  })(v2["in\u03B1"]);
43987
44005
  const \u03B30 = _fmapObject(v2["in\u03B1"]._1, functorVal.map((v$1) => false));
43988
44006
  const v0 = $Val(false, functorBaseVal.map((v$1) => false)(v2["out\u03B1"]._2));
43989
- const $4 = unrestrictGC(boundedMeetSemilatticeBoo)(v3._1)(fromFoldable28($2));
43990
- const $5 = unprojExpr(boundedMeetSemilatticeBoo)($EnvExpr(v3._1, v3._2));
43991
- const focus = { fwd: (x2) => $5.fwd($4.fwd(x2)), bwd: (x2) => $4.bwd($5.bwd(x2)) };
43992
- const $6 = graphGC1(v2);
43993
- const gc = { fwd: (x2) => $6.fwd(focus.fwd(x2)), bwd: (x2) => focus.bwd($6.bwd(x2)) };
43994
- const $7 = gc.fwd(\u03B30);
43995
- const vInert = $Val(selState($7._1), functorBaseVal.map(selState)($7._2));
44007
+ const $5 = unrestrictGC(boundedMeetSemilatticeBoo)(v3._1)(fromFoldable28($3));
44008
+ const $6 = unprojExpr(boundedMeetSemilatticeBoo)($EnvExpr(v3._1, v3._2));
44009
+ const focus = { fwd: (x2) => $6.fwd($5.fwd(x2)), bwd: (x2) => $5.bwd($6.bwd(x2)) };
44010
+ const $7 = graphGC1(v2);
44011
+ const gc = { fwd: (x2) => $7.fwd(focus.fwd(x2)), bwd: (x2) => focus.bwd($7.bwd(x2)) };
44012
+ const $8 = gc.fwd(\u03B30);
44013
+ const vInert = $Val(selState($8._1), functorBaseVal.map(selState)($8._2));
43996
44014
  const \u03B3Inert = _fmapObject(
43997
44015
  _fmapObject(gc.bwd($Val(true, functorBaseVal.map((v$1) => true)(v2["out\u03B1"]._2))), functorVal.map(boolNot)),
43998
44016
  functorVal.map(selState)
43999
44017
  );
44000
- const $8 = graphGC22({
44018
+ const $9 = graphGC22({
44001
44019
  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 }),
44002
44020
  graph_fwd: v2.graph_fwd,
44003
44021
  graph_bwd: v2.graph_bwd,
44004
44022
  "in\u03B1": v2["out\u03B1"],
44005
44023
  "out\u03B1": v2["in\u03B1"]
44006
44024
  });
44007
- const $9 = dual(focus);
44008
- const gc_dual = { fwd: (x2) => $9.fwd($8.fwd(x2)), bwd: (x2) => $8.bwd($9.bwd(x2)) };
44025
+ const $10 = dual(focus);
44026
+ const gc_dual = { fwd: (x2) => $10.fwd($9.fwd(x2)), bwd: (x2) => $9.bwd($10.bwd(x2)) };
44009
44027
  return Monad0.Applicative0().pure({
44010
44028
  spec: v,
44011
- s: $3,
44029
+ s: $4,
44012
44030
  "\u03B3": intersectionWith_Object(apply)(_fmapObject(
44013
44031
  intersectionWith_Object(apply)(_fmapObject(\u03B3Inert, applyVal.apply))(\u03B30),
44014
44032
  applyVal.apply
44015
44033
  ))(\u03B30),
44016
44034
  v: applyVal.apply(applyVal.apply(vInert)(v0))(v0),
44017
44035
  linkedOutputs: (() => {
44018
- const $10 = lift3(vInert)(\u03B3Inert)(gc_dual);
44019
- const $11 = lift1(\u03B3Inert)(vInert)(gc);
44036
+ const $11 = lift3(vInert)(\u03B3Inert)(gc_dual);
44037
+ const $12 = lift1(\u03B3Inert)(vInert)(gc);
44020
44038
  return {
44021
- fwd: (x2) => $11.fwd(meet1.fwd($Tuple($10.fwd(x2._1), categoryGaloisConnection.identity.fwd(x2._2)))),
44039
+ fwd: (x2) => $12.fwd(meet1.fwd($Tuple($11.fwd(x2._1), categoryGaloisConnection.identity.fwd(x2._2)))),
44022
44040
  bwd: (x2) => {
44023
- const $12 = meet1.bwd($11.bwd(x2));
44024
- return $Tuple($10.bwd($12._1), categoryGaloisConnection.identity.bwd($12._2));
44041
+ const $13 = meet1.bwd($12.bwd(x2));
44042
+ return $Tuple($11.bwd($13._1), categoryGaloisConnection.identity.bwd($13._2));
44025
44043
  }
44026
44044
  };
44027
44045
  })(),
44028
44046
  linkedInputs: (() => {
44029
- const $10 = lift1(\u03B3Inert)(vInert)(gc);
44030
- const $11 = lift3(vInert)(\u03B3Inert)(gc_dual);
44047
+ const $11 = lift1(\u03B3Inert)(vInert)(gc);
44048
+ const $12 = lift3(vInert)(\u03B3Inert)(gc_dual);
44031
44049
  return {
44032
- fwd: (x2) => $11.fwd(meet.fwd($Tuple($10.fwd(x2._1), categoryGaloisConnection.identity.fwd(x2._2)))),
44050
+ fwd: (x2) => $12.fwd(meet.fwd($Tuple($11.fwd(x2._1), categoryGaloisConnection.identity.fwd(x2._2)))),
44033
44051
  bwd: (x2) => {
44034
- const $12 = meet.bwd($11.bwd(x2));
44035
- return $Tuple($10.bwd($12._1), categoryGaloisConnection.identity.bwd($12._2));
44052
+ const $13 = meet.bwd($12.bwd(x2));
44053
+ return $Tuple($11.bwd($13._1), categoryGaloisConnection.identity.bwd($13._2));
44036
44054
  }
44037
44055
  };
44038
44056
  })(),
@@ -44250,7 +44268,26 @@ var gDecodeJsonCons = (dictDecodeJsonField) => (dictGDecodeJson) => (dictIsSymbo
44250
44268
  var monadAffAff = { liftAff: (x2) => x2, MonadEffect0: () => monadEffectAff };
44251
44269
 
44252
44270
  // output-es/App.LoadFigure/index.js
44253
- var gDecodeJsonCons2 = /* @__PURE__ */ gDecodeJsonCons(/* @__PURE__ */ (() => {
44271
+ var gDecodeJsonCons2 = /* @__PURE__ */ gDecodeJsonCons({
44272
+ decodeJsonField: (j) => {
44273
+ if (j.tag === "Just") {
44274
+ return $Maybe(
44275
+ "Just",
44276
+ _caseJson(
44277
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44278
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44279
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44280
+ Right,
44281
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44282
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44283
+ j._1
44284
+ )
44285
+ );
44286
+ }
44287
+ return Nothing;
44288
+ }
44289
+ });
44290
+ var gDecodeJsonCons1 = /* @__PURE__ */ gDecodeJsonCons(/* @__PURE__ */ (() => {
44254
44291
  const $0 = decodeArray(caseJsonString($Either(
44255
44292
  "Left",
44256
44293
  $JsonDecodeError("TypeMismatch", "String")
@@ -44264,7 +44301,7 @@ var gDecodeJsonCons2 = /* @__PURE__ */ gDecodeJsonCons(/* @__PURE__ */ (() => {
44264
44301
  }
44265
44302
  };
44266
44303
  })());
44267
- var jsonToSpec = /* @__PURE__ */ (() => decodeRecord(gDecodeJsonCons((() => {
44304
+ var decodeJson = /* @__PURE__ */ (() => decodeRecord(gDecodeJsonCons((() => {
44268
44305
  const $0 = decodeArray(decodeTuple(caseJsonString($Either(
44269
44306
  "Left",
44270
44307
  $JsonDecodeError("TypeMismatch", "String")
@@ -44277,40 +44314,28 @@ var jsonToSpec = /* @__PURE__ */ (() => decodeRecord(gDecodeJsonCons((() => {
44277
44314
  return Nothing;
44278
44315
  }
44279
44316
  };
44280
- })())(gDecodeJsonCons({
44281
- decodeJsonField: (j) => {
44282
- if (j.tag === "Just") {
44283
- return $Maybe(
44284
- "Just",
44285
- _caseJson(
44286
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44287
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44288
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44289
- Right,
44290
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44291
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44292
- j._1
44293
- )
44294
- );
44295
- }
44296
- return Nothing;
44297
- }
44298
- })(gDecodeJsonCons2(gDecodeJsonCons2(gDecodeJsonNil)({ reflectSymbol: () => "inputs" })()())({ reflectSymbol: () => "imports" })()())({
44299
- reflectSymbol: () => "file"
44300
- })()())({ reflectSymbol: () => "datasets" })()())().decodeJson)();
44301
- var figSpecFromJson = (spec) => ({ datasets: spec.datasets, imports: spec.imports, file: spec.file, inputs: spec.inputs });
44317
+ })())(gDecodeJsonCons2(gDecodeJsonCons2(gDecodeJsonCons1(gDecodeJsonCons1(gDecodeJsonNil)({ reflectSymbol: () => "inputs" })()())({
44318
+ reflectSymbol: () => "imports"
44319
+ })()())({ reflectSymbol: () => "fluidSrcPath" })()())({ reflectSymbol: () => "file" })()())({ reflectSymbol: () => "datasets" })()())().decodeJson)();
44320
+ var figSpecFromJson = (spec) => ({ fluidSrcPath: spec.fluidSrcPath, datasets: spec.datasets, imports: spec.imports, file: spec.file, inputs: spec.inputs });
44302
44321
  var loadFigure = (fileName) => runAffs_((v) => drawFig(v._1)(v._2))([
44303
44322
  _bind($$get(driver)($ResponseFormat("Json", identity))(fileName))((result) => {
44304
44323
  if (result.tag === "Left") {
44305
44324
  return throwException(error("Json fetching failed with " + printError(result._1)))();
44306
44325
  }
44307
44326
  if (result.tag === "Right") {
44308
- const v = jsonToSpec(result._1.body);
44327
+ const v = decodeJson(result._1.body);
44309
44328
  if (v.tag === "Left") {
44310
44329
  return throwException(error("JSON decoding failed with " + showJsonDecodeError.show(v._1)))();
44311
44330
  }
44312
44331
  if (v.tag === "Right") {
44313
- return _map((v1) => $Tuple("fig", v1))(loadFig({ datasets: v._1.datasets, imports: v._1.imports, file: v._1.file, inputs: v._1.inputs })(monadAffAff)(monadErrorAff));
44332
+ return _map((v1) => $Tuple("fig", v1))(loadFig({
44333
+ fluidSrcPath: v._1.fluidSrcPath,
44334
+ datasets: v._1.datasets,
44335
+ imports: v._1.imports,
44336
+ file: v._1.file,
44337
+ inputs: v._1.inputs
44338
+ })(monadAffAff)(monadErrorAff));
44314
44339
  }
44315
44340
  }
44316
44341
  fail();
@@ -44318,9 +44343,10 @@ var loadFigure = (fileName) => runAffs_((v) => drawFig(v._1)(v._2))([
44318
44343
  ]);
44319
44344
  var drawCode2 = (folder) => (file) => runAffs_(drawFile)([loadFile$p(folder)(file)(monadAffAff)(monadErrorAff)]);
44320
44345
  export {
44346
+ decodeJson,
44321
44347
  drawCode2 as drawCode,
44322
44348
  figSpecFromJson,
44323
44349
  gDecodeJsonCons2 as gDecodeJsonCons,
44324
- jsonToSpec,
44350
+ gDecodeJsonCons1,
44325
44351
  loadFigure
44326
44352
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.59",
3
+ "version": "0.7.61",
4
4
  "description": "Fluid is an experimental programming language which integrates a bidirectional dynamic analysis to connect outputs to data sources in a fine-grained way. Fluid is implemented in PureScript and runs in the browser.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -25,23 +25,22 @@
25
25
  "script/util/lisp-case.sh"
26
26
  ],
27
27
  "scripts": {
28
- "tidy": "./script/tidy.sh",
28
+ "benchmark": "./script/benchmark.sh",
29
29
  "build": "./script/build.sh",
30
30
  "build-test": "./script/build-test.sh",
31
31
  "bundle-fluid": "./script/bundle-fluid.sh",
32
32
  "bundle-page": "./script/bundle-page.sh",
33
33
  "bundle-website": "./script/bundle-website.sh",
34
34
  "bundle-website-all": "./script/bundle-website-all.sh",
35
+ "npm-publish": "./script/npm-publish.sh",
35
36
  "serve": "./script/serve.sh",
36
37
  "test": "./script/test.sh",
38
+ "test-all": "./script/test-all.sh",
37
39
  "test-browser": "./script/test.sh --browsers=Chrome --singleRun=false",
38
40
  "test-page": "./script/test-page.sh",
39
41
  "test-website": "./script/test-website.sh",
40
42
  "test-website-all": "./script/test-website-all.sh",
41
- "test-all": "./script/test-all.sh",
42
- "npm-publish": "./script/npm-publish.sh",
43
- "fluid": "./script/fluid.sh",
44
- "benchmark": "./script/benchmark.sh"
43
+ "tidy": "./script/tidy.sh"
45
44
  },
46
45
  "dependencies": {
47
46
  "@codemirror/commands": "6.2.2",
@@ -50,7 +50,6 @@ echo "Processing shared js files:"
50
50
  cp -r "${PREFIX:+$PREFIX/}dist/fluid/shared" dist/$WEBSITE_LISP_CASE
51
51
  cp -r fluid dist/$WEBSITE_LISP_CASE
52
52
 
53
-
54
53
  if [[ -e "website/$SRC_PATH/test.mjs" ]]; then
55
54
  cp website/$SRC_PATH/test.mjs dist/SRC_PATH_LISP_CASE/test.mjs
56
55
  fi
@@ -1,13 +0,0 @@
1
- # https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
@@ -1,30 +0,0 @@
1
- {
2
- "env": { "browser": true },
3
- "extends": "eslint:recommended",
4
- "parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
5
- "rules": {
6
- "block-scoped-var": "error",
7
- "consistent-return": "error",
8
- "eqeqeq": "error",
9
- "guard-for-in": "error",
10
- "no-bitwise": "error",
11
- "no-caller": "error",
12
- "no-constant-condition": ["error", { "checkLoops": false }],
13
- "no-extra-parens": "off",
14
- "no-extend-native": "error",
15
- "no-loop-func": "error",
16
- "no-new": "error",
17
- "no-param-reassign": "error",
18
- "no-return-assign": "error",
19
- "no-sequences": "error",
20
- "no-unused-expressions": "error",
21
- "no-use-before-define": "error",
22
- "no-undef": "error",
23
- "no-eq-null": "error",
24
- "radix": ["error", "always"],
25
- "indent": ["error", 2, { "SwitchCase": 0 }],
26
- "quotes": ["error", "double"],
27
- "semi": ["error", "always"],
28
- "strict": ["error", "global"]
29
- }
30
- }
@@ -1,13 +0,0 @@
1
- .*
2
- !.gitignore
3
- !.github
4
- !.editorconfig
5
- !.eslintrc.json
6
-
7
- output
8
- generated-docs
9
- bower_components
10
-
11
- node_modules
12
- package-lock.json
13
- *.lock
@@ -1,13 +0,0 @@
1
- # https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
@@ -1,9 +0,0 @@
1
- .*
2
- !.gitignore
3
- !.github
4
- !.editorconfig
5
- !.tidyrc.json
6
-
7
- output
8
- generated-docs
9
- bower_components
@@ -1,10 +0,0 @@
1
- {
2
- "importSort": "source",
3
- "importWrap": "source",
4
- "indent": 2,
5
- "operatorsFile": null,
6
- "ribbon": 1,
7
- "typeArrowPlacement": "first",
8
- "unicode": "never",
9
- "width": null
10
- }