@@ -1,4 +1,31 @@
2+ // output/Control.Semigroupoid/index.js
3+ var semigroupoidFn = {
4+ compose: function(f) {
13+ // output/Control.Category/index.js
14+ var identity = function(dict) {
15+ return dict.identity;
18+ identity: function(x) {
21+ Semigroupoid0: function() {
22+ return semigroupoidFn;
26+ // output/Data.Boolean/index.js
27+ var otherwise = true;
2 // output/Data.Function/index.js
29 // output/Data.Function/index.js
3 var flip = function(f) {
30 var flip = function(f) {
4 return function(b) {
31 return function(b) {
@@ -145,17 +172,101 @@
147 // output/Data.Bounded/foreign.js
174 // output/Data.Bounded/foreign.js
175+ var topInt = 2147483647;
176+ var bottomInt = -2147483648;
148 var topChar = String.fromCharCode(65535);
177 var topChar = String.fromCharCode(65535);
149 var bottomChar = String.fromCharCode(0);
178 var bottomChar = String.fromCharCode(0);
150 var topNumber = Number.POSITIVE_INFINITY;
179 var topNumber = Number.POSITIVE_INFINITY;
151 var bottomNumber = Number.NEGATIVE_INFINITY;
180 var bottomNumber = Number.NEGATIVE_INFINITY;
182+ // output/Data.Ord/foreign.js
183+ var unsafeCompareImpl = function(lt) {
184+ return function(eq2) {
185+ return function(gt) {
186+ return function(x) {
187+ return function(y) {
188+ return x < y ? lt : x === y ? eq2 : gt;
194+ var ordIntImpl = unsafeCompareImpl;
196+ // output/Data.Eq/foreign.js
197+ var refEq = function(r1) {
198+ return function(r2) {
202+ var eqIntImpl = refEq;
204+ // output/Data.Eq/index.js
209+ // output/Data.Ordering/index.js
210+ var LT = /* @__PURE__ */ function() {
214+ LT2.value = new LT2();
217+ var GT = /* @__PURE__ */ function() {
221+ GT2.value = new GT2();
224+ var EQ = /* @__PURE__ */ function() {
228+ EQ2.value = new EQ2();
232+ // output/Data.Ord/index.js
233+ var ordInt = /* @__PURE__ */ function() {
235+ compare: ordIntImpl(LT.value)(EQ.value)(GT.value),
242+ // output/Data.Bounded/index.js
243+ var top = function(dict) {
253+ var bottom = function(dict) {
153 // output/Data.Show/foreign.js
257 // output/Data.Show/foreign.js
154 var showIntImpl = function(n) {
258 var showIntImpl = function(n) {
155 return n.toString();
259 return n.toString();
261+ var showNumberImpl = function(n) {
262+ var str = n.toString();
263+ return isNaN(str + ".0") ? str : str + ".0";
158 // output/Data.Show/index.js
266 // output/Data.Show/index.js
268+ show: showNumberImpl
159 var showInt = {
270 var showInt = {
160 show: showIntImpl
271 show: showIntImpl
@@ -164,6 +275,7 @@
166 // output/Data.Maybe/index.js
277 // output/Data.Maybe/index.js
278+ var identity2 = /* @__PURE__ */ identity(categoryFn);
167 var Nothing = /* @__PURE__ */ function() {
279 var Nothing = /* @__PURE__ */ function() {
168 function Nothing2() {
280 function Nothing2() {
@@ -181,6 +293,24 @@
182 return Just2;
294 return Just2;
296+ var maybe = function(v) {
297+ return function(v1) {
298+ return function(v2) {
299+ if (v2 instanceof Nothing) {
303+ if (v2 instanceof Just) {
304+ return v1(v2.value0);
307+ throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
311+ var fromMaybe = function(a) {
312+ return maybe(a)(identity2);
185 // output/Data.Monoid/index.js
315 // output/Data.Monoid/index.js
186 var monoidArray = {
316 var monoidArray = {
@@ -1202,9 +1332,9 @@
1203 function replace(projector) {
1333 function replace(projector) {
1204 return function(el) {
1334 return function(el) {
1205− return function(render) {
1335+ return function(render3) {
1206 return function() {
1336 return function() {
1207− projector.replace(el, render);
1337+ projector.replace(el, render3);
@@ -1214,6 +1344,51 @@
1214 var string = unsafeCoerce2;
1344 var string = unsafeCoerce2;
1215 var h2 = _h;
1345 var h2 = _h;
1347+ // output/Data.Int/foreign.js
1348+ var fromNumberImpl = function(just) {
1349+ return function(nothing) {
1350+ return function(n) {
1351+ return (n | 0) === n ? just(n) : nothing;
1355+ var toNumber = function(n) {
1359+ // output/Data.Number/foreign.js
1360+ var isFiniteImpl = isFinite;
1361+ var round = Math.round;
1363+ // output/Data.Int/index.js
1364+ var top2 = /* @__PURE__ */ top(boundedInt);
1365+ var bottom2 = /* @__PURE__ */ bottom(boundedInt);
1366+ var fromNumber = /* @__PURE__ */ function() {
1367+ return fromNumberImpl(Just.create)(Nothing.value);
1369+ var unsafeClamp = function(x) {
1370+ if (!isFiniteImpl(x)) {
1374+ if (x >= toNumber(top2)) {
1378+ if (x <= toNumber(bottom2)) {
1383+ return fromMaybe(0)(fromNumber(x));
1386+ throw new Error("Failed pattern match at Data.Int (line 72, column 1 - line 72, column 29): " + [x.constructor.name]);
1388+ var round2 = function($37) {
1389+ return unsafeClamp(round($37));
1217 // output/Foreign.Object/foreign.js
1392 // output/Foreign.Object/foreign.js
1218 function _copyST(m) {
1393 function _copyST(m) {
1219 return function() {
1394 return function() {
@@ -1321,8 +1496,28 @@
1499+ // output/Record.Unsafe.Union/foreign.js
1500+ function unsafeUnionFn(r1, r2) {
1502+ for (var k1 in r2) {
1503+ if ({}.hasOwnProperty.call(r2, k1)) {
1507+ for (var k2 in r1) {
1508+ if ({}.hasOwnProperty.call(r1, k2)) {
1515+ // output/Record.Unsafe.Union/index.js
1516+ var unsafeUnion = /* @__PURE__ */ runFn2(unsafeUnionFn);
1324 // output/Plum.View/index.js
1518 // output/Plum.View/index.js
1325 var show2 = /* @__PURE__ */ show(showInt);
1519 var show2 = /* @__PURE__ */ show(showInt);
1520+ var show1 = /* @__PURE__ */ show(showNumber);
1326 var append1 = /* @__PURE__ */ append(semigroupArray);
1521 var append1 = /* @__PURE__ */ append(semigroupArray);
1327 var mempty2 = /* @__PURE__ */ mempty(monoidArray);
1522 var mempty2 = /* @__PURE__ */ mempty(monoidArray);
1328 var map2 = /* @__PURE__ */ map(functorArray);
1523 var map2 = /* @__PURE__ */ map(functorArray);
@@ -1350,6 +1545,32 @@
1350 Fit2.value = new Fit2();
1545 Fit2.value = new Fit2();
1351 return Fit2;
1546 return Fit2;
1548+ var Max2 = /* @__PURE__ */ function() {
1549+ function Max3(value0, value1) {
1550+ this.value0 = value0;
1551+ this.value1 = value1;
1554+ Max3.create = function(value0) {
1555+ return function(value1) {
1556+ return new Max3(value0, value1);
1561+ var Min2 = /* @__PURE__ */ function() {
1562+ function Min3(value0, value1) {
1563+ this.value0 = value0;
1564+ this.value1 = value1;
1567+ Min3.create = function(value0) {
1568+ return function(value1) {
1569+ return new Min3(value0, value1);
1353 var X = /* @__PURE__ */ function() {
1574 var X = /* @__PURE__ */ function() {
1354 function X2() {
1575 function X2() {
@@ -1476,6 +1697,70 @@
1476 Wrapped2.value = new Wrapped2();
1697 Wrapped2.value = new Wrapped2();
1477 return Wrapped2;
1698 return Wrapped2;
1700+ var BackgroundColor = /* @__PURE__ */ function() {
1701+ function BackgroundColor2(value0) {
1702+ this.value0 = value0;
1705+ BackgroundColor2.create = function(value0) {
1706+ return new BackgroundColor2(value0);
1708+ return BackgroundColor2;
1710+ var Padding = /* @__PURE__ */ function() {
1711+ function Padding2(value0) {
1712+ this.value0 = value0;
1715+ Padding2.create = function(value0) {
1716+ return new Padding2(value0);
1720+ var Spread = /* @__PURE__ */ function() {
1721+ function Spread2() {
1724+ Spread2.value = new Spread2();
1727+ var Opacity = /* @__PURE__ */ function() {
1728+ function Opacity2(value0) {
1729+ this.value0 = value0;
1732+ Opacity2.create = function(value0) {
1733+ return new Opacity2(value0);
1737+ var Pointer = /* @__PURE__ */ function() {
1738+ function Pointer2() {
1741+ Pointer2.value = new Pointer2();
1744+ var Move = /* @__PURE__ */ function() {
1745+ function Move2(value0) {
1746+ this.value0 = value0;
1749+ Move2.create = function(value0) {
1750+ return new Move2(value0);
1754+ var Clip = /* @__PURE__ */ function() {
1755+ function Clip2(value0) {
1756+ this.value0 = value0;
1759+ Clip2.create = function(value0) {
1760+ return new Clip2(value0);
1479 var Column = /* @__PURE__ */ function() {
1764 var Column = /* @__PURE__ */ function() {
1480 function Column2(value0) {
1765 function Column2(value0) {
1481 this.value0 = value0;
1766 this.value0 = value0;
@@ -1526,6 +1811,38 @@
1527 return Text2;
1812 return Text2;
1814+ var Link = /* @__PURE__ */ function() {
1815+ function Link2(value0, value1, value22) {
1816+ this.value0 = value0;
1817+ this.value1 = value1;
1818+ this.value2 = value22;
1821+ Link2.create = function(value0) {
1822+ return function(value1) {
1823+ return function(value22) {
1824+ return new Link2(value0, value1, value22);
1830+ var Download = /* @__PURE__ */ function() {
1831+ function Download2(value0, value1, value22) {
1832+ this.value0 = value0;
1833+ this.value1 = value1;
1834+ this.value2 = value22;
1837+ Download2.create = function(value0) {
1838+ return function(value1) {
1839+ return function(value22) {
1840+ return new Download2(value0, value1, value22);
1529 var semigroupSkin = {
1846 var semigroupSkin = {
1530 append: function(v) {
1847 append: function(v) {
1531 return function(v1) {
1848 return function(v1) {
@@ -1543,6 +1860,11 @@
1863+ var renderableColor = {
1864+ render: function(v) {
1865+ return "rgba(" + (show2(v.r) + ("," + (show2(v.g) + ("," + (show2(v.b) + ("," + (show1(v.a) + ")")))))));
1546 var monoidSkin = {
1868 var monoidSkin = {
1547 mempty: empty2,
1869 mempty: empty2,
1548 Semigroup0: function() {
1870 Semigroup0: function() {
@@ -1576,21 +1898,48 @@
1576 return singleton2(key)(val);
1898 return singleton2(key)(val);
1579− var length2 = function(v) {
1901+ var rgb = function(r) {
1902+ return function(g) {
1903+ return function(b) {
1905+ r: round2(r * 255),
1906+ g: round2(g * 255),
1907+ b: round2(b * 255),
1913+ var render = function(dict) {
1914+ return dict.render;
1916+ var render1 = /* @__PURE__ */ render(renderableColor);
1917+ var renderableLength = {
1918+ render: function(v) {
1580− if (v instanceof Px) {
1919+ if (v instanceof Px) {
1581− return show2(v.value0) + "px";
1920+ return show2(v.value0) + "px";
1584− if (v instanceof Fit) {
1923+ if (v instanceof Fit) {
1585− return "fit-content";
1924+ return "fit-content";
1588− if (v instanceof Fill) {
1927+ if (v instanceof Fill) {
1589− return "100%";
1928+ return "100%";
1931+ if (v instanceof Max2) {
1932+ return "max(" + (show2(v.value0) + ("px," + (render(renderableLength)(v.value1) + ")")));
1935+ if (v instanceof Min2) {
1936+ return "min(" + (show2(v.value0) + ("px," + (render(renderableLength)(v.value1) + ")")));
1939+ throw new Error("Failed pattern match at Plum.View (line 131, column 12 - line 136, column 62): " + [v.constructor.name]);
1592− throw new Error("Failed pattern match at Plum.View (line 99, column 10 - line 102, column 17): " + [v.constructor.name]);
1942+ var render2 = /* @__PURE__ */ render(renderableLength);
1594 var skin = function(ctx) {
1943 var skin = function(ctx) {
1595 return function(v) {
1944 return function(v) {
1596 if (v instanceof Spacing) {
1945 if (v instanceof Spacing) {
@@ -1620,7 +1969,7 @@
1620 return "align-items";
1969 return "align-items";
1623− throw new Error("Failed pattern match at Plum.View (line 70, column 9 - line 72, column 29): " + [v.value0.constructor.name]);
1972+ throw new Error("Failed pattern match at Plum.View (line 88, column 9 - line 90, column 29): " + [v.value0.constructor.name]);
1624 }())(function() {
1973 }())(function() {
1625 if (v.value1 instanceof Start) {
1974 if (v.value1 instanceof Start) {
1626 return "start";
1975 return "start";
@@ -1634,7 +1983,7 @@
1634 return "end";
1983 return "end";
1637− throw new Error("Failed pattern match at Plum.View (line 74, column 9 - line 77, column 23): " + [v.value1.constructor.name]);
1986+ throw new Error("Failed pattern match at Plum.View (line 92, column 9 - line 95, column 23): " + [v.value1.constructor.name]);
@@ -1657,7 +2006,7 @@
1657 return "justify-content";
2006 return "justify-content";
1660− throw new Error("Failed pattern match at Plum.View (line 81, column 9 - line 85, column 38): " + [v1.constructor.name]);
2009+ throw new Error("Failed pattern match at Plum.View (line 99, column 9 - line 103, column 38): " + [v1.constructor.name]);
1661 }())(function() {
2010 }())(function() {
1662 if (v.value1 instanceof Start) {
2011 if (v.value1 instanceof Start) {
1663 return "flex-start";
2012 return "flex-start";
@@ -1671,19 +2020,19 @@
1671 return "flex-end";
2020 return "flex-end";
1674− throw new Error("Failed pattern match at Plum.View (line 87, column 9 - line 90, column 28): " + [v.value1.constructor.name]);
2023+ throw new Error("Failed pattern match at Plum.View (line 105, column 9 - line 108, column 28): " + [v.value1.constructor.name]);
1678− throw new Error("Failed pattern match at Plum.View (line 66, column 26 - line 91, column 8): " + [ctx.constructor.name]);
2027+ throw new Error("Failed pattern match at Plum.View (line 84, column 26 - line 109, column 8): " + [ctx.constructor.name]);
1681 if (v instanceof Width) {
2030 if (v instanceof Width) {
1682− return sk("width")(length2(v.value0));
2031+ return sk("width")(render2(v.value0));
1685 if (v instanceof Height) {
2034 if (v instanceof Height) {
1686− return sk("height")(length2(v.value0));
2035+ return sk("height")(render2(v.value0));
1689 if (v instanceof Wrapped) {
2038 if (v instanceof Wrapped) {
@@ -1694,7 +2043,54 @@
1694 return mempty1;
2043 return mempty1;
2046+ if (v instanceof BackgroundColor) {
2047+ return sk("background-color")(render1(v.value0));
2050+ if (v instanceof Padding) {
2051+ return sk("padding")(show2(v.value0.top) + ("px " + (show2(v.value0.right) + ("px " + (show2(v.value0.bottom) + ("px " + (show2(v.value0.left) + "px")))))));
2054+ if (v instanceof Spread) {
2055+ if (ctx instanceof Flexbox) {
2056+ return sk("justify-content")("space-between");
2062+ if (v instanceof Opacity) {
2063+ return sk("opacity")(show1(v.value0));
2066+ if (v instanceof Pointer) {
2067+ return sk("cursor")("pointer");
2070+ if (v instanceof Move) {
2071+ return sk("transform")("translate(" + (show2(v.value0.x) + ("px, " + (show2(v.value0.y) + ")"))));
2074+ if (v instanceof Clip && v.value0 instanceof X) {
2075+ return sk("overflow-x")("hidden");
2078+ if (v instanceof Clip && v.value0 instanceof Y) {
2079+ return sk("overflow-y")("hidden");
1697− throw new Error("Failed pattern match at Plum.View (line 63, column 12 - line 96, column 16): " + [v.constructor.name]);
2082+ throw new Error("Failed pattern match at Plum.View (line 81, column 12 - line 125, column 37): " + [v.constructor.name]);
2085+ var hWith = function(el) {
2086+ return function(props) {
2087+ return function(v) {
2088+ return function(children) {
2089+ return h2(el)(unsafeUnion(props)({
1700 var h3 = function(el) {
2096 var h3 = function(el) {
@@ -1729,7 +2125,7 @@
1729 return widthFill;
2125 return widthFill;
1732− throw new Error("Failed pattern match at Plum.View (line 128, column 16 - line 132, column 35): " + [ctx.constructor.name]);
2128+ throw new Error("Failed pattern match at Plum.View (line 181, column 16 - line 185, column 35): " + [ctx.constructor.name]);
1733 }())(function() {
2129 }())(function() {
1734 if (ctx instanceof Grid) {
2130 if (ctx instanceof Grid) {
1735 return alignCenter;
2131 return alignCenter;
@@ -1747,7 +2143,7 @@
1747 return alignCenter;
2143 return alignCenter;
1750− throw new Error("Failed pattern match at Plum.View (line 133, column 16 - line 137, column 37): " + [ctx.constructor.name]);
2146+ throw new Error("Failed pattern match at Plum.View (line 186, column 16 - line 190, column 37): " + [ctx.constructor.name]);
1751 }()))))(v.extraSkin);
2147 }()))))(v.extraSkin);
1753 if (v1.bones instanceof Text) {
2149 if (v1.bones instanceof Text) {
@@ -1772,7 +2168,28 @@
1772 return h3("div")(append2(skn(new Flexbox(Y.value)))(append2(sk("display")("flex"))(sk("flex-direction")("column"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
2168 return h3("div")(append2(skn(new Flexbox(Y.value)))(append2(sk("display")("flex"))(sk("flex-direction")("column"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
2171+ if (v1.bones instanceof Link) {
2172+ return hWith("a")({
2173+ href: v1.bones.value0,
2174+ rel: "noopener noreferrer",
2175+ target: function() {
2176+ if (v1.bones.value1.newTab) {
2182+ })(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value2)]);
2185+ if (v1.bones instanceof Download) {
2186+ return hWith("a")({
2187+ href: v1.bones.value0,
2188+ download: fromMaybe("")(v1.bones.value1.filename)
2189+ })(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value2)]);
1775− throw new Error("Failed pattern match at Plum.View (line 140, column 5 - line 148, column 46): " + [v1.bones.constructor.name]);
2192+ throw new Error("Failed pattern match at Plum.View (line 193, column 5 - line 215, column 39): " + [v1.bones.constructor.name]);
@@ -1855,7 +2272,7 @@
1855 height: "100%",
2272 height: "100%",
1856 width: "100%"
2273 width: "100%"
1858− })([el, h2("style")({})([string(outerStyle)])]);
2275+ })([h2("style")({})([string(outerStyle)]), el]);
@@ -1876,7 +2293,9 @@
1876 text: "Test"
2293 text: "Test"
1878 view: function(model) {
2295 view: function(model) {
2296+ return view([])([])(new Column([view([])([])(new Link("https://iko.soy", {
1879− return view([])([Wrapped.value])(new Column(map4($$const(view([])([])(new Text("hello"))))(range2(1)(100))));
2298+ }, view([])([])(new Text("my website")))), view([])([])(new Row(map4($$const(view([])([new BackgroundColor(rgb(1)(0)(0))])(new Text("hello"))))(range2(1)(100))))]));
1881 update: function(msg) {
2300 update: function(msg) {
1882 return function(model) {
2301 return function(model) {