@explorable-viz/fluid 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1574,19 +1574,6 @@ var stripPrefix = (v) => (str) => {
1574
1574
  return Nothing;
1575
1575
  };
1576
1576
  var indexOf = /* @__PURE__ */ _indexOf(Just)(Nothing);
1577
- var contains = (pat) => {
1578
- const $0 = indexOf(pat);
1579
- return (x) => {
1580
- const $1 = $0(x);
1581
- if ($1.tag === "Nothing") {
1582
- return false;
1583
- }
1584
- if ($1.tag === "Just") {
1585
- return true;
1586
- }
1587
- fail();
1588
- };
1589
- };
1590
1577
  var charAt2 = /* @__PURE__ */ _charAt(Just)(Nothing);
1591
1578
 
1592
1579
  // output-es/Data.String.Common/foreign.js
@@ -16785,13 +16772,67 @@ var semigroupColumns = { append: (v) => (v1) => beside(v)(v1) };
16785
16772
  var monoidColumns = { mempty: empty2, Semigroup0: () => semigroupColumns };
16786
16773
 
16787
16774
  // output-es/Pretty/index.js
16788
- var $ExprType = (tag) => tag;
16789
16775
  var hcat = /* @__PURE__ */ (() => foldableList.foldMap(monoidColumns)(unsafeCoerce))();
16790
16776
  var hcat1 = /* @__PURE__ */ (() => foldableArray.foldMap(monoidColumns)(unsafeCoerce))();
16791
16777
  var toUnfoldable8 = /* @__PURE__ */ toUnfoldable4(unfoldableList);
16792
16778
  var toUnfoldable13 = /* @__PURE__ */ toAscUnfoldable(unfoldableList);
16793
- var Simple = /* @__PURE__ */ $ExprType("Simple");
16794
- var Expression = /* @__PURE__ */ $ExprType("Expression");
16779
+ var isSimpleVal = {
16780
+ isSimple: (v) => {
16781
+ if (v._3.tag === "Constr") {
16782
+ return v._3._2.tag !== "Cons";
16783
+ }
16784
+ if (v._3.tag === "Fun" && v._3._1.tag === "PartialConstr") {
16785
+ return v._3._1._2.tag !== "Cons";
16786
+ }
16787
+ return true;
16788
+ }
16789
+ };
16790
+ var isSimpleExpr = {
16791
+ isSimple: (v) => {
16792
+ if (v.tag === "Var") {
16793
+ return true;
16794
+ }
16795
+ if (v.tag === "Op") {
16796
+ return true;
16797
+ }
16798
+ if (v.tag === "Int") {
16799
+ return true;
16800
+ }
16801
+ if (v.tag === "Float") {
16802
+ return true;
16803
+ }
16804
+ if (v.tag === "Str") {
16805
+ return true;
16806
+ }
16807
+ if (v.tag === "Constr") {
16808
+ return v._4.tag === "Nil";
16809
+ }
16810
+ return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject";
16811
+ }
16812
+ };
16813
+ var isSimpleExpr1 = {
16814
+ isSimple: (v) => {
16815
+ if (v.tag === "Var") {
16816
+ return true;
16817
+ }
16818
+ if (v.tag === "Op") {
16819
+ return true;
16820
+ }
16821
+ if (v.tag === "Int") {
16822
+ return true;
16823
+ }
16824
+ if (v.tag === "Float") {
16825
+ return true;
16826
+ }
16827
+ if (v.tag === "Str") {
16828
+ return true;
16829
+ }
16830
+ if (v.tag === "Constr") {
16831
+ return v._4.tag === "Nil";
16832
+ }
16833
+ return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject" || v.tag === "ListEmpty" || v.tag === "ListNonEmpty" || v.tag === "ListEnum" || v.tag === "ListComp";
16834
+ }
16835
+ };
16795
16836
  var vert = (dictFoldable) => {
16796
16837
  const fromFoldable26 = dictFoldable.foldr(Cons)(Nil);
16797
16838
  return (delim) => {
@@ -16904,75 +16945,6 @@ var getPrec = (x) => {
16904
16945
  }
16905
16946
  fail();
16906
16947
  };
16907
- var exprType = (v) => {
16908
- if (v.tag === "Var") {
16909
- return Simple;
16910
- }
16911
- if (v.tag === "Op") {
16912
- return Simple;
16913
- }
16914
- if (v.tag === "Int") {
16915
- return Simple;
16916
- }
16917
- if (v.tag === "Float") {
16918
- return Simple;
16919
- }
16920
- if (v.tag === "Str") {
16921
- return Simple;
16922
- }
16923
- if (v.tag === "Constr") {
16924
- if (v._4.tag === "Nil") {
16925
- return Simple;
16926
- }
16927
- return Expression;
16928
- }
16929
- if (v.tag === "Dictionary") {
16930
- return Simple;
16931
- }
16932
- if (v.tag === "Matrix") {
16933
- return Simple;
16934
- }
16935
- if (v.tag === "Lambda") {
16936
- return Simple;
16937
- }
16938
- if (v.tag === "Project") {
16939
- return Simple;
16940
- }
16941
- if (v.tag === "DProject") {
16942
- return Simple;
16943
- }
16944
- if (v.tag === "App") {
16945
- return Expression;
16946
- }
16947
- if (v.tag === "BinaryApp") {
16948
- return Expression;
16949
- }
16950
- if (v.tag === "MatchAs") {
16951
- return Simple;
16952
- }
16953
- if (v.tag === "IfElse") {
16954
- return Simple;
16955
- }
16956
- if (v.tag === "ListEmpty") {
16957
- return Simple;
16958
- }
16959
- if (v.tag === "ListNonEmpty") {
16960
- return Simple;
16961
- }
16962
- if (v.tag === "ListEnum") {
16963
- return Simple;
16964
- }
16965
- if (v.tag === "ListComp") {
16966
- return Simple;
16967
- }
16968
- if (v.tag === "Let") {
16969
- return Expression;
16970
- }
16971
- if (v.tag === "LetRec") {
16972
- return Expression;
16973
- }
16974
- fail();
16975
- };
16976
16948
  var comma = /* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ,"));
16977
16949
  var hcomma = (dictFoldable) => {
16978
16950
  const $0 = dictFoldable.foldr(Cons)(Nil);
@@ -16989,30 +16961,29 @@ var between2 = (l) => (r) => (doc) => beside(beside(l)(doc))(r);
16989
16961
  var brackets = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
16990
16962
  var curlyBraces = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" {")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" }")));
16991
16963
  var keyBracks = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
16992
- var parens = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
16993
- var prettyParensOpt = (dictPretty) => (x) => {
16994
- const doc = dictPretty.pretty(x);
16995
- if (contains(" ")(intercalate4("\n")(doc.lines))) {
16996
- return parens(doc);
16964
+ var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
16965
+ var prettySimple = (dictIsSimple) => (dictPretty) => (s) => {
16966
+ if (dictIsSimple.isSimple(s)) {
16967
+ return dictPretty.pretty(s);
16997
16968
  }
16998
- return doc;
16969
+ return parentheses(dictPretty.pretty(s));
16999
16970
  };
17000
- var prettyConstr = (dictPretty) => (v) => (v1) => {
16971
+ var prettyConstr = (dictIsSimple) => (dictPretty) => (v) => (v1) => {
17001
16972
  const $0 = (c, xs) => hcat($List(
17002
16973
  "Cons",
17003
16974
  checkOneLine(split("\n")(" " + showCtr(c))),
17004
- listMap(prettyParensOpt(dictPretty))(xs)
16975
+ listMap(prettySimple(dictIsSimple)(dictPretty))(xs)
17005
16976
  ));
17006
16977
  if (v1.tag === "Cons") {
17007
16978
  if (v1._2.tag === "Cons") {
17008
16979
  if (v === "Pair") {
17009
- return assertWith("")(v1._2._2.tag === "Nil")(parens(hcomma2([dictPretty.pretty(v1._1), dictPretty.pretty(v1._2._1)])));
16980
+ return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcomma2([dictPretty.pretty(v1._1), dictPretty.pretty(v1._2._1)])));
17010
16981
  }
17011
16982
  if (v === "Nil") {
17012
16983
  return assertWith("")(v1.tag === "Nil")(nil2);
17013
16984
  }
17014
16985
  if (v === ":") {
17015
- return assertWith("")(v1._2._2.tag === "Nil")(parens(hcat1([
16986
+ return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcat1([
17016
16987
  dictPretty.pretty(v1._1),
17017
16988
  checkOneLine(split("\n")(" :")),
17018
16989
  dictPretty.pretty(v1._2._1)
@@ -17024,7 +16995,7 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
17024
16995
  return assertWith("")(v1.tag === "Nil")(nil2);
17025
16996
  }
17026
16997
  if (v1._2.tag === "Nil") {
17027
- return beside(checkOneLine(split("\n")(" " + showCtr(v))))(dictPretty.pretty(v1._1));
16998
+ return beside(checkOneLine(split("\n")(" " + showCtr(v))))(prettySimple(dictIsSimple)(dictPretty)(v1._1));
17028
16999
  }
17029
17000
  return $0(v, v1);
17030
17001
  }
@@ -17033,7 +17004,6 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
17033
17004
  }
17034
17005
  return $0(v, v1);
17035
17006
  };
17036
- var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
17037
17007
  var prettyPattern = {
17038
17008
  pretty: (v) => {
17039
17009
  if (v.tag === "PVar") {
@@ -17138,7 +17108,7 @@ var prettyExpr = (dictHighlightable) => ({
17138
17108
  return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyRecordOrDict(prettyExpr(dictHighlightable))(checkOneLine(split("\n")(" :")))(keyBracks)(curlyBraces)(prettyExpr(dictHighlightable).pretty)(listMap(toTuple)(v._3))));
17139
17109
  }
17140
17110
  if (v.tag === "Constr") {
17141
- return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(prettyExpr(dictHighlightable))(v._3)(v._4)));
17111
+ return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(isSimpleExpr)(prettyExpr(dictHighlightable))(v._3)(v._4)));
17142
17112
  }
17143
17113
  if (v.tag === "Matrix") {
17144
17114
  return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyMatrix(dictHighlightable)(v._3)(v._4._1)(v._4._2)(v._5)));
@@ -17147,7 +17117,7 @@ var prettyExpr = (dictHighlightable) => ({
17147
17117
  return hcat1([dictHighlightable.highlightIf(v._1)(checkOneLine(split("\n")(" fun"))), prettyElim(dictHighlightable).pretty(v._2)]);
17148
17118
  }
17149
17119
  if (v.tag === "Op") {
17150
- return parens(checkOneLine(split("\n")(" " + v._1)));
17120
+ return parentheses(checkOneLine(split("\n")(" " + v._1)));
17151
17121
  }
17152
17122
  if (v.tag === "Let") {
17153
17123
  return atop(hcat1([
@@ -17248,7 +17218,7 @@ var prettyFun = (dictHighlightable) => ({
17248
17218
  return checkOneLine(split("\n")(" " + v._1._1));
17249
17219
  }
17250
17220
  if (v.tag === "PartialConstr") {
17251
- return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
17221
+ return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
17252
17222
  }
17253
17223
  fail();
17254
17224
  }
@@ -17285,7 +17255,7 @@ var prettyBaseVal = (dictHighlightable) => ({
17285
17255
  ))(toUnfoldable13(v._1)));
17286
17256
  }
17287
17257
  if (v.tag === "Constr") {
17288
- return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
17258
+ return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
17289
17259
  }
17290
17260
  if (v.tag === "Matrix") {
17291
17261
  return vert1(comma)(arrayMap((() => {
@@ -17387,7 +17357,7 @@ var prettyExpr1 = (dictAnn) => {
17387
17357
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(checkOneLine(split("\n")(' "' + v._3 + '"'))));
17388
17358
  }
17389
17359
  if (v.tag === "Constr") {
17390
- return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(prettyExpr1(dictAnn))(v._3)(v._4)));
17360
+ return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)(v._4)));
17391
17361
  }
17392
17362
  if (v.tag === "Dictionary") {
17393
17363
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(curlyBraces(prettyDictEntries(dictAnn)(atop)(v._3))));
@@ -17396,13 +17366,13 @@ var prettyExpr1 = (dictAnn) => {
17396
17366
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(arrayBrackets(beside(beside(beside(beside(prettyExpr1(dictAnn).pretty(v._3))(checkOneLine(split("\n")(" |"))))(parentheses(beside(beside(checkOneLine(split("\n")(" " + v._4._1)))(checkOneLine(split("\n")(" ,"))))(checkOneLine(split("\n")(" " + v._4._2))))))(checkOneLine(split("\n")(" in"))))(prettyExpr1(dictAnn).pretty(v._5)))));
17397
17367
  }
17398
17368
  if (v.tag === "Lambda") {
17399
- return parentheses(beside(checkOneLine(split("\n")(" fun")))(prettyClauses(dictAnn).pretty(v._1)));
17369
+ return beside(checkOneLine(split("\n")(" fun")))(prettyClauses(dictAnn).pretty(v._1));
17400
17370
  }
17401
17371
  if (v.tag === "Project") {
17402
- return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
17372
+ return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
17403
17373
  }
17404
17374
  if (v.tag === "DProject") {
17405
- return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(dictAnn)(v._3)))(checkOneLine(split("\n")(" ]")));
17375
+ return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)))(checkOneLine(split("\n")(" ]")));
17406
17376
  }
17407
17377
  if (v.tag === "App") {
17408
17378
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettyAppChain(dictAnn)($Expr2("App", v._1, v._2, v._3)));
@@ -17464,16 +17434,6 @@ var prettyBranch = (dictAnn) => ({
17464
17434
  v._2._2
17465
17435
  )))
17466
17436
  });
17467
- var prettySimple = (dictAnn) => (s) => {
17468
- const v = exprType(s);
17469
- if (v === "Simple") {
17470
- return prettyExpr1(dictAnn).pretty(s);
17471
- }
17472
- if (v === "Expression") {
17473
- return parentheses(prettyExpr1(dictAnn).pretty(s));
17474
- }
17475
- fail();
17476
- };
17477
17437
  var prettyDictEntries = (dictAnn) => (v) => (v1) => {
17478
17438
  if (v1.tag === "Nil") {
17479
17439
  return empty2;
@@ -17502,9 +17462,9 @@ var prettyBinApp = (dictAnn) => (v) => (v1) => {
17502
17462
  };
17503
17463
  var prettyAppChain = (dictAnn) => (v) => {
17504
17464
  if (v.tag === "App") {
17505
- return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(dictAnn)(v._3));
17465
+ return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3));
17506
17466
  }
17507
- return prettySimple(dictAnn)(v);
17467
+ return prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v);
17508
17468
  };
17509
17469
 
17510
17470
  // output-es/Val/index.js
@@ -3219,16 +3219,6 @@ var _toChar = function(just) {
3219
3219
  var length2 = function(s) {
3220
3220
  return s.length;
3221
3221
  };
3222
- var _indexOf = function(just) {
3223
- return function(nothing) {
3224
- return function(x2) {
3225
- return function(s) {
3226
- var i = s.indexOf(x2);
3227
- return i === -1 ? nothing : just(i);
3228
- };
3229
- };
3230
- };
3231
- };
3232
3222
  var take = function(n) {
3233
3223
  return function(s) {
3234
3224
  return s.substr(0, n);
@@ -3260,20 +3250,6 @@ var stripPrefix = (v) => (str) => {
3260
3250
  }
3261
3251
  return Nothing;
3262
3252
  };
3263
- var indexOf = /* @__PURE__ */ _indexOf(Just)(Nothing);
3264
- var contains = (pat) => {
3265
- const $0 = indexOf(pat);
3266
- return (x2) => {
3267
- const $1 = $0(x2);
3268
- if ($1.tag === "Nothing") {
3269
- return false;
3270
- }
3271
- if ($1.tag === "Just") {
3272
- return true;
3273
- }
3274
- fail();
3275
- };
3276
- };
3277
3253
  var charAt2 = /* @__PURE__ */ _charAt(Just)(Nothing);
3278
3254
 
3279
3255
  // output-es/Foreign/foreign.js
@@ -10244,7 +10220,7 @@ function getSelection(root2) {
10244
10220
  }
10245
10221
  return target.getSelection();
10246
10222
  }
10247
- function contains2(dom, node) {
10223
+ function contains(dom, node) {
10248
10224
  return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false;
10249
10225
  }
10250
10226
  function deepActiveElement(doc2) {
@@ -10257,7 +10233,7 @@ function hasSelection(dom, selection2) {
10257
10233
  if (!selection2.anchorNode)
10258
10234
  return false;
10259
10235
  try {
10260
- return contains2(dom, selection2.anchorNode);
10236
+ return contains(dom, selection2.anchorNode);
10261
10237
  } catch (_) {
10262
10238
  return false;
10263
10239
  }
@@ -11156,7 +11132,7 @@ function scanCompositionTree(pos, side, view2, text2, enterView, fromText) {
11156
11132
  let desc = ContentView.get(child);
11157
11133
  if (!desc)
11158
11134
  return fromText(pos, side);
11159
- let hasComp = contains2(child, text2);
11135
+ let hasComp = contains(child, text2);
11160
11136
  let len = desc.length + (hasComp ? text2.nodeValue.length : 0);
11161
11137
  if (pos < len || pos == len && desc.getSide() <= 0)
11162
11138
  return hasComp ? scanCompositionTree(pos, side, desc, text2, enterView, fromText) : enterView(desc, pos, side);
@@ -11173,8 +11149,8 @@ function posFromDOMInCompositionTree(node, offset, view2, text2) {
11173
11149
  if (view2 instanceof MarkView) {
11174
11150
  let pos = 0;
11175
11151
  for (let child of view2.children) {
11176
- let hasComp = contains2(child.dom, text2);
11177
- if (contains2(child.dom, node))
11152
+ let hasComp = contains(child.dom, text2);
11153
+ if (contains(child.dom, node))
11178
11154
  return pos + (hasComp ? posFromDOMInCompositionTree(node, offset, child, text2) : child.localPosFromDOM(node, offset));
11179
11155
  pos += hasComp ? text2.nodeValue.length : child.length;
11180
11156
  }
@@ -15299,8 +15275,8 @@ var DOMChange = class {
15299
15275
  this.newSel = selectionFromPoints(selPoints, this.bounds.from);
15300
15276
  } else {
15301
15277
  let domSel = view2.observer.selectionRange;
15302
- let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains2(view2.contentDOM, domSel.focusNode) ? view2.state.selection.main.head : view2.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
15303
- let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains2(view2.contentDOM, domSel.anchorNode) ? view2.state.selection.main.anchor : view2.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
15278
+ let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains(view2.contentDOM, domSel.focusNode) ? view2.state.selection.main.head : view2.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
15279
+ let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains(view2.contentDOM, domSel.anchorNode) ? view2.state.selection.main.anchor : view2.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
15304
15280
  this.newSel = EditorSelection.single(anchor, head);
15305
15281
  }
15306
15282
  }
@@ -34559,13 +34535,67 @@ var semigroupColumns = { append: (v) => (v1) => beside(v)(v1) };
34559
34535
  var monoidColumns = { mempty: empty3, Semigroup0: () => semigroupColumns };
34560
34536
 
34561
34537
  // output-es/Pretty/index.js
34562
- var $ExprType = (tag) => tag;
34563
34538
  var hcat = /* @__PURE__ */ (() => foldableList.foldMap(monoidColumns)(unsafeCoerce))();
34564
34539
  var hcat1 = /* @__PURE__ */ (() => foldableArray.foldMap(monoidColumns)(unsafeCoerce))();
34565
34540
  var toUnfoldable8 = /* @__PURE__ */ toUnfoldable4(unfoldableList);
34566
34541
  var toUnfoldable13 = /* @__PURE__ */ toAscUnfoldable(unfoldableList);
34567
- var Simple = /* @__PURE__ */ $ExprType("Simple");
34568
- var Expression = /* @__PURE__ */ $ExprType("Expression");
34542
+ var isSimpleVal = {
34543
+ isSimple: (v) => {
34544
+ if (v._3.tag === "Constr") {
34545
+ return v._3._2.tag !== "Cons";
34546
+ }
34547
+ if (v._3.tag === "Fun" && v._3._1.tag === "PartialConstr") {
34548
+ return v._3._1._2.tag !== "Cons";
34549
+ }
34550
+ return true;
34551
+ }
34552
+ };
34553
+ var isSimpleExpr = {
34554
+ isSimple: (v) => {
34555
+ if (v.tag === "Var") {
34556
+ return true;
34557
+ }
34558
+ if (v.tag === "Op") {
34559
+ return true;
34560
+ }
34561
+ if (v.tag === "Int") {
34562
+ return true;
34563
+ }
34564
+ if (v.tag === "Float") {
34565
+ return true;
34566
+ }
34567
+ if (v.tag === "Str") {
34568
+ return true;
34569
+ }
34570
+ if (v.tag === "Constr") {
34571
+ return v._4.tag === "Nil";
34572
+ }
34573
+ return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject";
34574
+ }
34575
+ };
34576
+ var isSimpleExpr1 = {
34577
+ isSimple: (v) => {
34578
+ if (v.tag === "Var") {
34579
+ return true;
34580
+ }
34581
+ if (v.tag === "Op") {
34582
+ return true;
34583
+ }
34584
+ if (v.tag === "Int") {
34585
+ return true;
34586
+ }
34587
+ if (v.tag === "Float") {
34588
+ return true;
34589
+ }
34590
+ if (v.tag === "Str") {
34591
+ return true;
34592
+ }
34593
+ if (v.tag === "Constr") {
34594
+ return v._4.tag === "Nil";
34595
+ }
34596
+ return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject" || v.tag === "ListEmpty" || v.tag === "ListNonEmpty" || v.tag === "ListEnum" || v.tag === "ListComp";
34597
+ }
34598
+ };
34569
34599
  var vert = (dictFoldable) => {
34570
34600
  const fromFoldable27 = dictFoldable.foldr(Cons)(Nil);
34571
34601
  return (delim) => {
@@ -34678,75 +34708,6 @@ var getPrec = (x2) => {
34678
34708
  }
34679
34709
  fail();
34680
34710
  };
34681
- var exprType = (v) => {
34682
- if (v.tag === "Var") {
34683
- return Simple;
34684
- }
34685
- if (v.tag === "Op") {
34686
- return Simple;
34687
- }
34688
- if (v.tag === "Int") {
34689
- return Simple;
34690
- }
34691
- if (v.tag === "Float") {
34692
- return Simple;
34693
- }
34694
- if (v.tag === "Str") {
34695
- return Simple;
34696
- }
34697
- if (v.tag === "Constr") {
34698
- if (v._4.tag === "Nil") {
34699
- return Simple;
34700
- }
34701
- return Expression;
34702
- }
34703
- if (v.tag === "Dictionary") {
34704
- return Simple;
34705
- }
34706
- if (v.tag === "Matrix") {
34707
- return Simple;
34708
- }
34709
- if (v.tag === "Lambda") {
34710
- return Simple;
34711
- }
34712
- if (v.tag === "Project") {
34713
- return Simple;
34714
- }
34715
- if (v.tag === "DProject") {
34716
- return Simple;
34717
- }
34718
- if (v.tag === "App") {
34719
- return Expression;
34720
- }
34721
- if (v.tag === "BinaryApp") {
34722
- return Expression;
34723
- }
34724
- if (v.tag === "MatchAs") {
34725
- return Simple;
34726
- }
34727
- if (v.tag === "IfElse") {
34728
- return Simple;
34729
- }
34730
- if (v.tag === "ListEmpty") {
34731
- return Simple;
34732
- }
34733
- if (v.tag === "ListNonEmpty") {
34734
- return Simple;
34735
- }
34736
- if (v.tag === "ListEnum") {
34737
- return Simple;
34738
- }
34739
- if (v.tag === "ListComp") {
34740
- return Simple;
34741
- }
34742
- if (v.tag === "Let") {
34743
- return Expression;
34744
- }
34745
- if (v.tag === "LetRec") {
34746
- return Expression;
34747
- }
34748
- fail();
34749
- };
34750
34711
  var comma = /* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ,"));
34751
34712
  var hcomma = (dictFoldable) => {
34752
34713
  const $0 = dictFoldable.foldr(Cons)(Nil);
@@ -34763,30 +34724,29 @@ var between2 = (l) => (r) => (doc2) => beside(beside(l)(doc2))(r);
34763
34724
  var brackets = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
34764
34725
  var curlyBraces = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" {")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" }")));
34765
34726
  var keyBracks = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
34766
- var parens = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
34767
- var prettyParensOpt = (dictPretty) => (x2) => {
34768
- const doc2 = dictPretty.pretty(x2);
34769
- if (contains(" ")(intercalate4("\n")(doc2.lines))) {
34770
- return parens(doc2);
34727
+ var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
34728
+ var prettySimple = (dictIsSimple) => (dictPretty) => (s) => {
34729
+ if (dictIsSimple.isSimple(s)) {
34730
+ return dictPretty.pretty(s);
34771
34731
  }
34772
- return doc2;
34732
+ return parentheses(dictPretty.pretty(s));
34773
34733
  };
34774
- var prettyConstr = (dictPretty) => (v) => (v1) => {
34734
+ var prettyConstr = (dictIsSimple) => (dictPretty) => (v) => (v1) => {
34775
34735
  const $0 = (c, xs) => hcat($List(
34776
34736
  "Cons",
34777
34737
  checkOneLine(split("\n")(" " + showCtr(c))),
34778
- listMap(prettyParensOpt(dictPretty))(xs)
34738
+ listMap(prettySimple(dictIsSimple)(dictPretty))(xs)
34779
34739
  ));
34780
34740
  if (v1.tag === "Cons") {
34781
34741
  if (v1._2.tag === "Cons") {
34782
34742
  if (v === "Pair") {
34783
- return assertWith("")(v1._2._2.tag === "Nil")(parens(hcomma2([dictPretty.pretty(v1._1), dictPretty.pretty(v1._2._1)])));
34743
+ return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcomma2([dictPretty.pretty(v1._1), dictPretty.pretty(v1._2._1)])));
34784
34744
  }
34785
34745
  if (v === "Nil") {
34786
34746
  return assertWith("")(v1.tag === "Nil")(nil2);
34787
34747
  }
34788
34748
  if (v === ":") {
34789
- return assertWith("")(v1._2._2.tag === "Nil")(parens(hcat1([
34749
+ return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcat1([
34790
34750
  dictPretty.pretty(v1._1),
34791
34751
  checkOneLine(split("\n")(" :")),
34792
34752
  dictPretty.pretty(v1._2._1)
@@ -34798,7 +34758,7 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
34798
34758
  return assertWith("")(v1.tag === "Nil")(nil2);
34799
34759
  }
34800
34760
  if (v1._2.tag === "Nil") {
34801
- return beside(checkOneLine(split("\n")(" " + showCtr(v))))(dictPretty.pretty(v1._1));
34761
+ return beside(checkOneLine(split("\n")(" " + showCtr(v))))(prettySimple(dictIsSimple)(dictPretty)(v1._1));
34802
34762
  }
34803
34763
  return $0(v, v1);
34804
34764
  }
@@ -34807,7 +34767,6 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
34807
34767
  }
34808
34768
  return $0(v, v1);
34809
34769
  };
34810
- var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
34811
34770
  var prettyPattern = {
34812
34771
  pretty: (v) => {
34813
34772
  if (v.tag === "PVar") {
@@ -34912,7 +34871,7 @@ var prettyExpr = (dictHighlightable) => ({
34912
34871
  return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyRecordOrDict(prettyExpr(dictHighlightable))(checkOneLine(split("\n")(" :")))(keyBracks)(curlyBraces)(prettyExpr(dictHighlightable).pretty)(listMap(toTuple)(v._3))));
34913
34872
  }
34914
34873
  if (v.tag === "Constr") {
34915
- return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(prettyExpr(dictHighlightable))(v._3)(v._4)));
34874
+ return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(isSimpleExpr)(prettyExpr(dictHighlightable))(v._3)(v._4)));
34916
34875
  }
34917
34876
  if (v.tag === "Matrix") {
34918
34877
  return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyMatrix(dictHighlightable)(v._3)(v._4._1)(v._4._2)(v._5)));
@@ -34921,7 +34880,7 @@ var prettyExpr = (dictHighlightable) => ({
34921
34880
  return hcat1([dictHighlightable.highlightIf(v._1)(checkOneLine(split("\n")(" fun"))), prettyElim(dictHighlightable).pretty(v._2)]);
34922
34881
  }
34923
34882
  if (v.tag === "Op") {
34924
- return parens(checkOneLine(split("\n")(" " + v._1)));
34883
+ return parentheses(checkOneLine(split("\n")(" " + v._1)));
34925
34884
  }
34926
34885
  if (v.tag === "Let") {
34927
34886
  return atop(hcat1([
@@ -35022,7 +34981,7 @@ var prettyFun = (dictHighlightable) => ({
35022
34981
  return checkOneLine(split("\n")(" " + v._1._1));
35023
34982
  }
35024
34983
  if (v.tag === "PartialConstr") {
35025
- return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
34984
+ return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
35026
34985
  }
35027
34986
  fail();
35028
34987
  }
@@ -35059,7 +35018,7 @@ var prettyBaseVal = (dictHighlightable) => ({
35059
35018
  ))(toUnfoldable13(v._1)));
35060
35019
  }
35061
35020
  if (v.tag === "Constr") {
35062
- return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
35021
+ return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
35063
35022
  }
35064
35023
  if (v.tag === "Matrix") {
35065
35024
  return vert1(comma)(arrayMap((() => {
@@ -35161,7 +35120,7 @@ var prettyExpr1 = (dictAnn) => {
35161
35120
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(checkOneLine(split("\n")(' "' + v._3 + '"'))));
35162
35121
  }
35163
35122
  if (v.tag === "Constr") {
35164
- return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(prettyExpr1(dictAnn))(v._3)(v._4)));
35123
+ return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)(v._4)));
35165
35124
  }
35166
35125
  if (v.tag === "Dictionary") {
35167
35126
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(curlyBraces(prettyDictEntries(dictAnn)(atop)(v._3))));
@@ -35170,13 +35129,13 @@ var prettyExpr1 = (dictAnn) => {
35170
35129
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(arrayBrackets(beside(beside(beside(beside(prettyExpr1(dictAnn).pretty(v._3))(checkOneLine(split("\n")(" |"))))(parentheses(beside(beside(checkOneLine(split("\n")(" " + v._4._1)))(checkOneLine(split("\n")(" ,"))))(checkOneLine(split("\n")(" " + v._4._2))))))(checkOneLine(split("\n")(" in"))))(prettyExpr1(dictAnn).pretty(v._5)))));
35171
35130
  }
35172
35131
  if (v.tag === "Lambda") {
35173
- return parentheses(beside(checkOneLine(split("\n")(" fun")))(prettyClauses(dictAnn).pretty(v._1)));
35132
+ return beside(checkOneLine(split("\n")(" fun")))(prettyClauses(dictAnn).pretty(v._1));
35174
35133
  }
35175
35134
  if (v.tag === "Project") {
35176
- return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
35135
+ return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
35177
35136
  }
35178
35137
  if (v.tag === "DProject") {
35179
- return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(dictAnn)(v._3)))(checkOneLine(split("\n")(" ]")));
35138
+ return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)))(checkOneLine(split("\n")(" ]")));
35180
35139
  }
35181
35140
  if (v.tag === "App") {
35182
35141
  return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettyAppChain(dictAnn)($Expr2("App", v._1, v._2, v._3)));
@@ -35238,16 +35197,6 @@ var prettyBranch = (dictAnn) => ({
35238
35197
  v._2._2
35239
35198
  )))
35240
35199
  });
35241
- var prettySimple = (dictAnn) => (s) => {
35242
- const v = exprType(s);
35243
- if (v === "Simple") {
35244
- return prettyExpr1(dictAnn).pretty(s);
35245
- }
35246
- if (v === "Expression") {
35247
- return parentheses(prettyExpr1(dictAnn).pretty(s));
35248
- }
35249
- fail();
35250
- };
35251
35200
  var prettyDictEntries = (dictAnn) => (v) => (v1) => {
35252
35201
  if (v1.tag === "Nil") {
35253
35202
  return empty3;
@@ -35276,9 +35225,9 @@ var prettyBinApp = (dictAnn) => (v) => (v1) => {
35276
35225
  };
35277
35226
  var prettyAppChain = (dictAnn) => (v) => {
35278
35227
  if (v.tag === "App") {
35279
- return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(dictAnn)(v._3));
35228
+ return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3));
35280
35229
  }
35281
- return prettySimple(dictAnn)(v);
35230
+ return prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v);
35282
35231
  };
35283
35232
 
35284
35233
  // output-es/Val/index.js
@@ -39498,7 +39447,7 @@ var view = () => (v) => (v1) => (v2) => {
39498
39447
  }
39499
39448
  if (v1._3._1 === "Paragraph") {
39500
39449
  const vws = arrayMap(view()(v))(reflectValSelStates\u{1D54A}Array.from()(v1._3._2._1));
39501
- return pack5($Paragraph(false, arrayApply(vws)(arrayMap((v$1) => Nothing)(vws))));
39450
+ return pack5($Paragraph(false, zipWith(apply)(vws)(arrayMap((v$1) => Nothing)(vws))));
39502
39451
  }
39503
39452
  if (v1._3._1 === "Nil" || v1._3._1 === ":") {
39504
39453
  const records = arrayMap(dict(identity30))(reflectValSelStates\u{1D54A}Array.from()(v1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
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": {