14152 lines
572 KiB
JavaScript
14152 lines
572 KiB
JavaScript
// Generated by purs bundle 0.12.2
|
|
var PS = {};
|
|
(function(exports) {
|
|
/* global exports */
|
|
/* global XMLHttpRequest */
|
|
/* global module */
|
|
/* global process */
|
|
"use strict";
|
|
|
|
exports._ajax = function () {
|
|
var platformSpecific = { };
|
|
if (typeof module !== "undefined" && module.require && !(typeof process !== "undefined" && process.versions["electron"])) {
|
|
// We are on node.js
|
|
platformSpecific.newXHR = function () {
|
|
var XHR = module.require("xhr2");
|
|
return new XHR();
|
|
};
|
|
|
|
platformSpecific.fixupUrl = function (url) {
|
|
var urllib = module.require("url");
|
|
var u = urllib.parse(url);
|
|
u.protocol = u.protocol || "http:";
|
|
u.hostname = u.hostname || "localhost";
|
|
return urllib.format(u);
|
|
};
|
|
|
|
platformSpecific.getResponse = function (xhr) {
|
|
return xhr.response;
|
|
};
|
|
} else {
|
|
// We are in the browser
|
|
platformSpecific.newXHR = function () {
|
|
return new XMLHttpRequest();
|
|
};
|
|
|
|
platformSpecific.fixupUrl = function (url) {
|
|
return url || "/";
|
|
};
|
|
|
|
platformSpecific.getResponse = function (xhr) {
|
|
return xhr.response;
|
|
};
|
|
}
|
|
|
|
return function (mkHeader, options) {
|
|
return function (errback, callback) {
|
|
var xhr = platformSpecific.newXHR();
|
|
var fixedUrl = platformSpecific.fixupUrl(options.url);
|
|
xhr.open(options.method || "GET", fixedUrl, true, options.username, options.password);
|
|
if (options.headers) {
|
|
try {
|
|
for (var i = 0, header; (header = options.headers[i]) != null; i++) {
|
|
xhr.setRequestHeader(header.field, header.value);
|
|
}
|
|
} catch (e) {
|
|
errback(e);
|
|
}
|
|
}
|
|
xhr.onerror = function () {
|
|
errback(new Error("AJAX request failed: " + options.method + " " + options.url));
|
|
};
|
|
xhr.onload = function () {
|
|
callback({
|
|
status: xhr.status,
|
|
statusText: xhr.statusText,
|
|
headers: xhr.getAllResponseHeaders().split("\r\n")
|
|
.filter(function (header) {
|
|
return header.length > 0;
|
|
})
|
|
.map(function (header) {
|
|
var i = header.indexOf(":");
|
|
return mkHeader(header.substring(0, i))(header.substring(i + 2));
|
|
}),
|
|
body: platformSpecific.getResponse(xhr)
|
|
});
|
|
};
|
|
xhr.responseType = options.responseType;
|
|
xhr.withCredentials = options.withCredentials;
|
|
xhr.send(options.content);
|
|
|
|
return function (error, cancelErrback, cancelCallback) {
|
|
try {
|
|
xhr.abort();
|
|
} catch (e) {
|
|
return cancelErrback(e);
|
|
}
|
|
return cancelCallback();
|
|
};
|
|
};
|
|
};
|
|
}();
|
|
})(PS["Affjax"] = PS["Affjax"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
function id(x) {
|
|
return x;
|
|
}
|
|
exports.fromObject = id;
|
|
|
|
exports.stringify = function (j) {
|
|
return JSON.stringify(j);
|
|
};
|
|
|
|
function isArray(a) {
|
|
return objToString.call(a) === "[object Array]";
|
|
}
|
|
})(PS["Data.Argonaut.Core"] = PS["Data.Argonaut.Core"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.refEq = function (r1) {
|
|
return function (r2) {
|
|
return r1 === r2;
|
|
};
|
|
};
|
|
})(PS["Data.Eq"] = PS["Data.Eq"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.boolConj = function (b1) {
|
|
return function (b2) {
|
|
return b1 && b2;
|
|
};
|
|
};
|
|
|
|
exports.boolDisj = function (b1) {
|
|
return function (b2) {
|
|
return b1 || b2;
|
|
};
|
|
};
|
|
|
|
exports.boolNot = function (b) {
|
|
return !b;
|
|
};
|
|
})(PS["Data.HeytingAlgebra"] = PS["Data.HeytingAlgebra"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Symbol"];
|
|
var SProxy = (function () {
|
|
function SProxy() {
|
|
|
|
};
|
|
SProxy.value = new SProxy();
|
|
return SProxy;
|
|
})();
|
|
var IsSymbol = function (reflectSymbol) {
|
|
this.reflectSymbol = reflectSymbol;
|
|
};
|
|
var reflectSymbol = function (dict) {
|
|
return dict.reflectSymbol;
|
|
};
|
|
exports["IsSymbol"] = IsSymbol;
|
|
exports["reflectSymbol"] = reflectSymbol;
|
|
exports["SProxy"] = SProxy;
|
|
})(PS["Data.Symbol"] = PS["Data.Symbol"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unit = {};
|
|
})(PS["Data.Unit"] = PS["Data.Unit"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.showIntImpl = function (n) {
|
|
return n.toString();
|
|
};
|
|
})(PS["Data.Show"] = PS["Data.Show"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafeGet = function (label) {
|
|
return function (rec) {
|
|
return rec[label];
|
|
};
|
|
};
|
|
})(PS["Record.Unsafe"] = PS["Record.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Record.Unsafe"];
|
|
exports["unsafeGet"] = $foreign.unsafeGet;
|
|
})(PS["Record.Unsafe"] = PS["Record.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Show"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Show = function (show) {
|
|
this.show = show;
|
|
};
|
|
var showInt = new Show($foreign.showIntImpl);
|
|
var show = function (dict) {
|
|
return dict.show;
|
|
};
|
|
exports["Show"] = Show;
|
|
exports["show"] = show;
|
|
exports["showInt"] = showInt;
|
|
})(PS["Data.Show"] = PS["Data.Show"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Unit"];
|
|
var Data_Show = PS["Data.Show"];
|
|
exports["unit"] = $foreign.unit;
|
|
})(PS["Data.Unit"] = PS["Data.Unit"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.HeytingAlgebra"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_Row = PS["Type.Data.Row"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var HeytingAlgebra = function (conj, disj, ff, implies, not, tt) {
|
|
this.conj = conj;
|
|
this.disj = disj;
|
|
this.ff = ff;
|
|
this.implies = implies;
|
|
this.not = not;
|
|
this.tt = tt;
|
|
};
|
|
var tt = function (dict) {
|
|
return dict.tt;
|
|
};
|
|
var not = function (dict) {
|
|
return dict.not;
|
|
};
|
|
var implies = function (dict) {
|
|
return dict.implies;
|
|
};
|
|
var ff = function (dict) {
|
|
return dict.ff;
|
|
};
|
|
var disj = function (dict) {
|
|
return dict.disj;
|
|
};
|
|
var heytingAlgebraBoolean = new HeytingAlgebra($foreign.boolConj, $foreign.boolDisj, false, function (a) {
|
|
return function (b) {
|
|
return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a))(b);
|
|
};
|
|
}, $foreign.boolNot, true);
|
|
var conj = function (dict) {
|
|
return dict.conj;
|
|
};
|
|
var heytingAlgebraFunction = function (dictHeytingAlgebra) {
|
|
return new HeytingAlgebra(function (f) {
|
|
return function (g) {
|
|
return function (a) {
|
|
return conj(dictHeytingAlgebra)(f(a))(g(a));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (g) {
|
|
return function (a) {
|
|
return disj(dictHeytingAlgebra)(f(a))(g(a));
|
|
};
|
|
};
|
|
}, function (v) {
|
|
return ff(dictHeytingAlgebra);
|
|
}, function (f) {
|
|
return function (g) {
|
|
return function (a) {
|
|
return implies(dictHeytingAlgebra)(f(a))(g(a));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (a) {
|
|
return not(dictHeytingAlgebra)(f(a));
|
|
};
|
|
}, function (v) {
|
|
return tt(dictHeytingAlgebra);
|
|
});
|
|
};
|
|
exports["HeytingAlgebra"] = HeytingAlgebra;
|
|
exports["tt"] = tt;
|
|
exports["ff"] = ff;
|
|
exports["implies"] = implies;
|
|
exports["conj"] = conj;
|
|
exports["disj"] = disj;
|
|
exports["not"] = not;
|
|
exports["heytingAlgebraBoolean"] = heytingAlgebraBoolean;
|
|
exports["heytingAlgebraFunction"] = heytingAlgebraFunction;
|
|
})(PS["Data.HeytingAlgebra"] = PS["Data.HeytingAlgebra"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Show = PS["Data.Show"];
|
|
var absurd = function (a) {
|
|
var spin = function ($copy_v) {
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
$copy_v = v;
|
|
return;
|
|
};
|
|
while (!false) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
return spin(a);
|
|
};
|
|
exports["absurd"] = absurd;
|
|
})(PS["Data.Void"] = PS["Data.Void"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Eq"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Data_Void = PS["Data.Void"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Eq = function (eq) {
|
|
this.eq = eq;
|
|
};
|
|
var eqVoid = new Eq(function (v) {
|
|
return function (v1) {
|
|
return true;
|
|
};
|
|
});
|
|
var eqUnit = new Eq(function (v) {
|
|
return function (v1) {
|
|
return true;
|
|
};
|
|
});
|
|
var eqString = new Eq($foreign.refEq);
|
|
var eqInt = new Eq($foreign.refEq);
|
|
var eqChar = new Eq($foreign.refEq);
|
|
var eq = function (dict) {
|
|
return dict.eq;
|
|
};
|
|
exports["Eq"] = Eq;
|
|
exports["eq"] = eq;
|
|
exports["eqInt"] = eqInt;
|
|
exports["eqChar"] = eqChar;
|
|
exports["eqString"] = eqString;
|
|
exports["eqUnit"] = eqUnit;
|
|
exports["eqVoid"] = eqVoid;
|
|
})(PS["Data.Eq"] = PS["Data.Eq"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Semigroupoid = function (compose) {
|
|
this.compose = compose;
|
|
};
|
|
var semigroupoidFn = new Semigroupoid(function (f) {
|
|
return function (g) {
|
|
return function (x) {
|
|
return f(g(x));
|
|
};
|
|
};
|
|
});
|
|
var compose = function (dict) {
|
|
return dict.compose;
|
|
};
|
|
exports["compose"] = compose;
|
|
exports["Semigroupoid"] = Semigroupoid;
|
|
exports["semigroupoidFn"] = semigroupoidFn;
|
|
})(PS["Control.Semigroupoid"] = PS["Control.Semigroupoid"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Category = function (Semigroupoid0, identity) {
|
|
this.Semigroupoid0 = Semigroupoid0;
|
|
this.identity = identity;
|
|
};
|
|
var identity = function (dict) {
|
|
return dict.identity;
|
|
};
|
|
var categoryFn = new Category(function () {
|
|
return Control_Semigroupoid.semigroupoidFn;
|
|
}, function (x) {
|
|
return x;
|
|
});
|
|
exports["Category"] = Category;
|
|
exports["identity"] = identity;
|
|
exports["categoryFn"] = categoryFn;
|
|
})(PS["Control.Category"] = PS["Control.Category"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var otherwise = true;
|
|
exports["otherwise"] = otherwise;
|
|
})(PS["Data.Boolean"] = PS["Data.Boolean"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafeCompareImpl = function (lt) {
|
|
return function (eq) {
|
|
return function (gt) {
|
|
return function (x) {
|
|
return function (y) {
|
|
return x < y ? lt : x === y ? eq : gt;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Data.Ord.Unsafe"] = PS["Data.Ord.Unsafe"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.concatString = function (s1) {
|
|
return function (s2) {
|
|
return s1 + s2;
|
|
};
|
|
};
|
|
|
|
exports.concatArray = function (xs) {
|
|
return function (ys) {
|
|
if (xs.length === 0) return ys;
|
|
if (ys.length === 0) return xs;
|
|
return xs.concat(ys);
|
|
};
|
|
};
|
|
})(PS["Data.Semigroup"] = PS["Data.Semigroup"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Semigroup"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Data_Void = PS["Data.Void"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Semigroup = function (append) {
|
|
this.append = append;
|
|
};
|
|
var semigroupString = new Semigroup($foreign.concatString);
|
|
var semigroupArray = new Semigroup($foreign.concatArray);
|
|
var append = function (dict) {
|
|
return dict.append;
|
|
};
|
|
var semigroupFn = function (dictSemigroup) {
|
|
return new Semigroup(function (f) {
|
|
return function (g) {
|
|
return function (x) {
|
|
return append(dictSemigroup)(f(x))(g(x));
|
|
};
|
|
};
|
|
});
|
|
};
|
|
exports["Semigroup"] = Semigroup;
|
|
exports["append"] = append;
|
|
exports["semigroupString"] = semigroupString;
|
|
exports["semigroupFn"] = semigroupFn;
|
|
exports["semigroupArray"] = semigroupArray;
|
|
})(PS["Data.Semigroup"] = PS["Data.Semigroup"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var LT = (function () {
|
|
function LT() {
|
|
|
|
};
|
|
LT.value = new LT();
|
|
return LT;
|
|
})();
|
|
var GT = (function () {
|
|
function GT() {
|
|
|
|
};
|
|
GT.value = new GT();
|
|
return GT;
|
|
})();
|
|
var EQ = (function () {
|
|
function EQ() {
|
|
|
|
};
|
|
EQ.value = new EQ();
|
|
return EQ;
|
|
})();
|
|
exports["LT"] = LT;
|
|
exports["GT"] = GT;
|
|
exports["EQ"] = EQ;
|
|
})(PS["Data.Ordering"] = PS["Data.Ordering"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Ord.Unsafe"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var unsafeCompare = $foreign.unsafeCompareImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value);
|
|
exports["unsafeCompare"] = unsafeCompare;
|
|
})(PS["Data.Ord.Unsafe"] = PS["Data.Ord.Unsafe"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.intSub = function (x) {
|
|
return function (y) {
|
|
/* jshint bitwise: false */
|
|
return x - y | 0;
|
|
};
|
|
};
|
|
})(PS["Data.Ring"] = PS["Data.Ring"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.intAdd = function (x) {
|
|
return function (y) {
|
|
/* jshint bitwise: false */
|
|
return x + y | 0;
|
|
};
|
|
};
|
|
|
|
exports.intMul = function (x) {
|
|
return function (y) {
|
|
/* jshint bitwise: false */
|
|
return x * y | 0;
|
|
};
|
|
};
|
|
})(PS["Data.Semiring"] = PS["Data.Semiring"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Semiring"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_Row = PS["Type.Data.Row"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Semiring = function (add, mul, one, zero) {
|
|
this.add = add;
|
|
this.mul = mul;
|
|
this.one = one;
|
|
this.zero = zero;
|
|
};
|
|
var zero = function (dict) {
|
|
return dict.zero;
|
|
};
|
|
var semiringInt = new Semiring($foreign.intAdd, $foreign.intMul, 1, 0);
|
|
var one = function (dict) {
|
|
return dict.one;
|
|
};
|
|
var mul = function (dict) {
|
|
return dict.mul;
|
|
};
|
|
var add = function (dict) {
|
|
return dict.add;
|
|
};
|
|
exports["Semiring"] = Semiring;
|
|
exports["add"] = add;
|
|
exports["zero"] = zero;
|
|
exports["mul"] = mul;
|
|
exports["one"] = one;
|
|
exports["semiringInt"] = semiringInt;
|
|
})(PS["Data.Semiring"] = PS["Data.Semiring"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Ring = function (Semiring0, sub) {
|
|
this.Semiring0 = Semiring0;
|
|
this.sub = sub;
|
|
};
|
|
var sub = function (dict) {
|
|
return dict.sub;
|
|
};
|
|
var ringInt = new Ring(function () {
|
|
return Data_Semiring.semiringInt;
|
|
}, $foreign.intSub);
|
|
exports["Ring"] = Ring;
|
|
exports["sub"] = sub;
|
|
exports["ringInt"] = ringInt;
|
|
})(PS["Data.Ring"] = PS["Data.Ring"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Ord"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Ord_Unsafe = PS["Data.Ord.Unsafe"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Data_Void = PS["Data.Void"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Ord = function (Eq0, compare) {
|
|
this.Eq0 = Eq0;
|
|
this.compare = compare;
|
|
};
|
|
var ordVoid = new Ord(function () {
|
|
return Data_Eq.eqVoid;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
return Data_Ordering.EQ.value;
|
|
};
|
|
});
|
|
var ordUnit = new Ord(function () {
|
|
return Data_Eq.eqUnit;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
return Data_Ordering.EQ.value;
|
|
};
|
|
});
|
|
var ordString = new Ord(function () {
|
|
return Data_Eq.eqString;
|
|
}, Data_Ord_Unsafe.unsafeCompare);
|
|
var ordInt = new Ord(function () {
|
|
return Data_Eq.eqInt;
|
|
}, Data_Ord_Unsafe.unsafeCompare);
|
|
var ordChar = new Ord(function () {
|
|
return Data_Eq.eqChar;
|
|
}, Data_Ord_Unsafe.unsafeCompare);
|
|
var compare = function (dict) {
|
|
return dict.compare;
|
|
};
|
|
exports["Ord"] = Ord;
|
|
exports["compare"] = compare;
|
|
exports["ordInt"] = ordInt;
|
|
exports["ordString"] = ordString;
|
|
exports["ordChar"] = ordChar;
|
|
exports["ordUnit"] = ordUnit;
|
|
exports["ordVoid"] = ordVoid;
|
|
})(PS["Data.Ord"] = PS["Data.Ord"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var on = function (f) {
|
|
return function (g) {
|
|
return function (x) {
|
|
return function (y) {
|
|
return f(g(x))(g(y));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var flip = function (f) {
|
|
return function (b) {
|
|
return function (a) {
|
|
return f(a)(b);
|
|
};
|
|
};
|
|
};
|
|
var $$const = function (a) {
|
|
return function (v) {
|
|
return a;
|
|
};
|
|
};
|
|
exports["flip"] = flip;
|
|
exports["const"] = $$const;
|
|
exports["on"] = on;
|
|
})(PS["Data.Function"] = PS["Data.Function"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.runFn4 = function (fn) {
|
|
return function (a) {
|
|
return function (b) {
|
|
return function (c) {
|
|
return function (d) {
|
|
return fn(a, b, c, d);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Data.Function.Uncurried"] = PS["Data.Function.Uncurried"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Function.Uncurried"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
exports["runFn4"] = $foreign.runFn4;
|
|
})(PS["Data.Function.Uncurried"] = PS["Data.Function.Uncurried"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.arrayMap = function (f) {
|
|
return function (arr) {
|
|
var l = arr.length;
|
|
var result = new Array(l);
|
|
for (var i = 0; i < l; i++) {
|
|
result[i] = f(arr[i]);
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
})(PS["Data.Functor"] = PS["Data.Functor"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Functor"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Functor = function (map) {
|
|
this.map = map;
|
|
};
|
|
var map = function (dict) {
|
|
return dict.map;
|
|
};
|
|
var $$void = function (dictFunctor) {
|
|
return map(dictFunctor)(Data_Function["const"](Data_Unit.unit));
|
|
};
|
|
var voidLeft = function (dictFunctor) {
|
|
return function (f) {
|
|
return function (x) {
|
|
return map(dictFunctor)(Data_Function["const"](x))(f);
|
|
};
|
|
};
|
|
};
|
|
var functorFn = new Functor(Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn));
|
|
var functorArray = new Functor($foreign.arrayMap);
|
|
exports["Functor"] = Functor;
|
|
exports["map"] = map;
|
|
exports["void"] = $$void;
|
|
exports["voidLeft"] = voidLeft;
|
|
exports["functorFn"] = functorFn;
|
|
exports["functorArray"] = functorArray;
|
|
})(PS["Data.Functor"] = PS["Data.Functor"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Alt = function (Functor0, alt) {
|
|
this.Functor0 = Functor0;
|
|
this.alt = alt;
|
|
};
|
|
var alt = function (dict) {
|
|
return dict.alt;
|
|
};
|
|
exports["Alt"] = Alt;
|
|
exports["alt"] = alt;
|
|
})(PS["Control.Alt"] = PS["Control.Alt"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.arrayApply = function (fs) {
|
|
return function (xs) {
|
|
var l = fs.length;
|
|
var k = xs.length;
|
|
var result = new Array(l*k);
|
|
var n = 0;
|
|
for (var i = 0; i < l; i++) {
|
|
var f = fs[i];
|
|
for (var j = 0; j < k; j++) {
|
|
result[n++] = f(xs[j]);
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
})(PS["Control.Apply"] = PS["Control.Apply"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Apply = function (Functor0, apply) {
|
|
this.Functor0 = Functor0;
|
|
this.apply = apply;
|
|
};
|
|
var applyArray = new Apply(function () {
|
|
return Data_Functor.functorArray;
|
|
}, $foreign.arrayApply);
|
|
var apply = function (dict) {
|
|
return dict.apply;
|
|
};
|
|
var applySecond = function (dictApply) {
|
|
return function (a) {
|
|
return function (b) {
|
|
return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(Data_Function["const"](Control_Category.identity(Control_Category.categoryFn)))(a))(b);
|
|
};
|
|
};
|
|
};
|
|
var lift2 = function (dictApply) {
|
|
return function (f) {
|
|
return function (a) {
|
|
return function (b) {
|
|
return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(f)(a))(b);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["Apply"] = Apply;
|
|
exports["apply"] = apply;
|
|
exports["applySecond"] = applySecond;
|
|
exports["lift2"] = lift2;
|
|
exports["applyArray"] = applyArray;
|
|
})(PS["Control.Apply"] = PS["Control.Apply"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Applicative = function (Apply0, pure) {
|
|
this.Apply0 = Apply0;
|
|
this.pure = pure;
|
|
};
|
|
var pure = function (dict) {
|
|
return dict.pure;
|
|
};
|
|
var when = function (dictApplicative) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
if (v) {
|
|
return v1;
|
|
};
|
|
if (!v) {
|
|
return pure(dictApplicative)(Data_Unit.unit);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative (line 57, column 1 - line 57, column 63): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
var liftA1 = function (dictApplicative) {
|
|
return function (f) {
|
|
return function (a) {
|
|
return Control_Apply.apply(dictApplicative.Apply0())(pure(dictApplicative)(f))(a);
|
|
};
|
|
};
|
|
};
|
|
exports["Applicative"] = Applicative;
|
|
exports["pure"] = pure;
|
|
exports["liftA1"] = liftA1;
|
|
exports["when"] = when;
|
|
})(PS["Control.Applicative"] = PS["Control.Applicative"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.arrayBind = function (arr) {
|
|
return function (f) {
|
|
var result = [];
|
|
for (var i = 0, l = arr.length; i < l; i++) {
|
|
Array.prototype.push.apply(result, f(arr[i]));
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
})(PS["Control.Bind"] = PS["Control.Bind"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Control.Bind"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Bind = function (Apply0, bind) {
|
|
this.Apply0 = Apply0;
|
|
this.bind = bind;
|
|
};
|
|
var Discard = function (discard) {
|
|
this.discard = discard;
|
|
};
|
|
var discard = function (dict) {
|
|
return dict.discard;
|
|
};
|
|
var bindArray = new Bind(function () {
|
|
return Control_Apply.applyArray;
|
|
}, $foreign.arrayBind);
|
|
var bind = function (dict) {
|
|
return dict.bind;
|
|
};
|
|
var bindFlipped = function (dictBind) {
|
|
return Data_Function.flip(bind(dictBind));
|
|
};
|
|
var composeKleisliFlipped = function (dictBind) {
|
|
return function (f) {
|
|
return function (g) {
|
|
return function (a) {
|
|
return bindFlipped(dictBind)(f)(g(a));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var composeKleisli = function (dictBind) {
|
|
return function (f) {
|
|
return function (g) {
|
|
return function (a) {
|
|
return bind(dictBind)(f(a))(g);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var discardUnit = new Discard(function (dictBind) {
|
|
return bind(dictBind);
|
|
});
|
|
var join = function (dictBind) {
|
|
return function (m) {
|
|
return bind(dictBind)(m)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
};
|
|
exports["Bind"] = Bind;
|
|
exports["bind"] = bind;
|
|
exports["bindFlipped"] = bindFlipped;
|
|
exports["Discard"] = Discard;
|
|
exports["discard"] = discard;
|
|
exports["join"] = join;
|
|
exports["composeKleisli"] = composeKleisli;
|
|
exports["composeKleisliFlipped"] = composeKleisliFlipped;
|
|
exports["bindArray"] = bindArray;
|
|
exports["discardUnit"] = discardUnit;
|
|
})(PS["Control.Bind"] = PS["Control.Bind"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Monad = function (Applicative0, Bind1) {
|
|
this.Applicative0 = Applicative0;
|
|
this.Bind1 = Bind1;
|
|
};
|
|
var ap = function (dictMonad) {
|
|
return function (f) {
|
|
return function (a) {
|
|
return Control_Bind.bind(dictMonad.Bind1())(f)(function (v) {
|
|
return Control_Bind.bind(dictMonad.Bind1())(a)(function (v1) {
|
|
return Control_Applicative.pure(dictMonad.Applicative0())(v(v1));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
exports["Monad"] = Monad;
|
|
exports["ap"] = ap;
|
|
})(PS["Control.Monad"] = PS["Control.Monad"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Plus = function (Alt0, empty) {
|
|
this.Alt0 = Alt0;
|
|
this.empty = empty;
|
|
};
|
|
var empty = function (dict) {
|
|
return dict.empty;
|
|
};
|
|
exports["Plus"] = Plus;
|
|
exports["empty"] = empty;
|
|
})(PS["Control.Plus"] = PS["Control.Plus"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.topInt = 2147483647;
|
|
exports.bottomInt = -2147483648;
|
|
|
|
exports.topChar = String.fromCharCode(65535);
|
|
exports.bottomChar = String.fromCharCode(0);
|
|
})(PS["Data.Bounded"] = PS["Data.Bounded"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Bounded"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Bounded = function (Ord0, bottom, top) {
|
|
this.Ord0 = Ord0;
|
|
this.bottom = bottom;
|
|
this.top = top;
|
|
};
|
|
var top = function (dict) {
|
|
return dict.top;
|
|
};
|
|
var boundedInt = new Bounded(function () {
|
|
return Data_Ord.ordInt;
|
|
}, $foreign.bottomInt, $foreign.topInt);
|
|
var boundedChar = new Bounded(function () {
|
|
return Data_Ord.ordChar;
|
|
}, $foreign.bottomChar, $foreign.topChar);
|
|
var bottom = function (dict) {
|
|
return dict.bottom;
|
|
};
|
|
exports["Bounded"] = Bounded;
|
|
exports["bottom"] = bottom;
|
|
exports["top"] = top;
|
|
exports["boundedInt"] = boundedInt;
|
|
exports["boundedChar"] = boundedChar;
|
|
})(PS["Data.Bounded"] = PS["Data.Bounded"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.intDegree = function (x) {
|
|
return Math.min(Math.abs(x), 2147483647);
|
|
};
|
|
|
|
// See the Euclidean definition in
|
|
// https://en.m.wikipedia.org/wiki/Modulo_operation.
|
|
exports.intDiv = function (x) {
|
|
return function (y) {
|
|
if (y === 0) return 0;
|
|
return y > 0 ? Math.floor(x / y) : -Math.floor(x / -y);
|
|
};
|
|
};
|
|
|
|
exports.intMod = function (x) {
|
|
return function (y) {
|
|
if (y === 0) return 0;
|
|
var yy = Math.abs(y);
|
|
return ((x % yy) + yy) % yy;
|
|
};
|
|
};
|
|
})(PS["Data.EuclideanRing"] = PS["Data.EuclideanRing"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var CommutativeRing = function (Ring0) {
|
|
this.Ring0 = Ring0;
|
|
};
|
|
var commutativeRingInt = new CommutativeRing(function () {
|
|
return Data_Ring.ringInt;
|
|
});
|
|
exports["CommutativeRing"] = CommutativeRing;
|
|
exports["commutativeRingInt"] = commutativeRingInt;
|
|
})(PS["Data.CommutativeRing"] = PS["Data.CommutativeRing"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.EuclideanRing"];
|
|
var Data_BooleanAlgebra = PS["Data.BooleanAlgebra"];
|
|
var Data_CommutativeRing = PS["Data.CommutativeRing"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var EuclideanRing = function (CommutativeRing0, degree, div, mod) {
|
|
this.CommutativeRing0 = CommutativeRing0;
|
|
this.degree = degree;
|
|
this.div = div;
|
|
this.mod = mod;
|
|
};
|
|
var mod = function (dict) {
|
|
return dict.mod;
|
|
};
|
|
var euclideanRingInt = new EuclideanRing(function () {
|
|
return Data_CommutativeRing.commutativeRingInt;
|
|
}, $foreign.intDegree, $foreign.intDiv, $foreign.intMod);
|
|
var div = function (dict) {
|
|
return dict.div;
|
|
};
|
|
var degree = function (dict) {
|
|
return dict.degree;
|
|
};
|
|
exports["EuclideanRing"] = EuclideanRing;
|
|
exports["degree"] = degree;
|
|
exports["div"] = div;
|
|
exports["mod"] = mod;
|
|
exports["euclideanRingInt"] = euclideanRingInt;
|
|
})(PS["Data.EuclideanRing"] = PS["Data.EuclideanRing"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_EuclideanRing = PS["Data.EuclideanRing"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Type_Data_RowList = PS["Type.Data.RowList"];
|
|
var Monoid = function (Semigroup0, mempty) {
|
|
this.Semigroup0 = Semigroup0;
|
|
this.mempty = mempty;
|
|
};
|
|
var monoidString = new Monoid(function () {
|
|
return Data_Semigroup.semigroupString;
|
|
}, "");
|
|
var monoidArray = new Monoid(function () {
|
|
return Data_Semigroup.semigroupArray;
|
|
}, [ ]);
|
|
var mempty = function (dict) {
|
|
return dict.mempty;
|
|
};
|
|
var monoidFn = function (dictMonoid) {
|
|
return new Monoid(function () {
|
|
return Data_Semigroup.semigroupFn(dictMonoid.Semigroup0());
|
|
}, function (v) {
|
|
return mempty(dictMonoid);
|
|
});
|
|
};
|
|
var guard = function (dictMonoid) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
if (v) {
|
|
return v1;
|
|
};
|
|
if (!v) {
|
|
return mempty(dictMonoid);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Monoid (line 74, column 1 - line 74, column 49): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
exports["Monoid"] = Monoid;
|
|
exports["mempty"] = mempty;
|
|
exports["guard"] = guard;
|
|
exports["monoidFn"] = monoidFn;
|
|
exports["monoidString"] = monoidString;
|
|
exports["monoidArray"] = monoidArray;
|
|
})(PS["Data.Monoid"] = PS["Data.Monoid"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Nothing = (function () {
|
|
function Nothing() {
|
|
|
|
};
|
|
Nothing.value = new Nothing();
|
|
return Nothing;
|
|
})();
|
|
var Just = (function () {
|
|
function Just(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Just.create = function (value0) {
|
|
return new Just(value0);
|
|
};
|
|
return Just;
|
|
})();
|
|
var maybe = function (v) {
|
|
return function (v1) {
|
|
return function (v2) {
|
|
if (v2 instanceof Nothing) {
|
|
return v;
|
|
};
|
|
if (v2 instanceof Just) {
|
|
return v1(v2.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): " + [ v.constructor.name, v1.constructor.name, v2.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
var isNothing = maybe(true)(Data_Function["const"](false));
|
|
var isJust = maybe(false)(Data_Function["const"](true));
|
|
var functorMaybe = new Data_Functor.Functor(function (v) {
|
|
return function (v1) {
|
|
if (v1 instanceof Just) {
|
|
return new Just(v(v1.value0));
|
|
};
|
|
return Nothing.value;
|
|
};
|
|
});
|
|
var fromMaybe = function (a) {
|
|
return maybe(a)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
var fromJust = function (dictPartial) {
|
|
return function (v) {
|
|
if (v instanceof Just) {
|
|
return v.value0;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
var applyMaybe = new Control_Apply.Apply(function () {
|
|
return functorMaybe;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
if (v instanceof Just) {
|
|
return Data_Functor.map(functorMaybe)(v.value0)(v1);
|
|
};
|
|
if (v instanceof Nothing) {
|
|
return Nothing.value;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 67, column 35): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
});
|
|
var bindMaybe = new Control_Bind.Bind(function () {
|
|
return applyMaybe;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
if (v instanceof Just) {
|
|
return v1(v.value0);
|
|
};
|
|
if (v instanceof Nothing) {
|
|
return Nothing.value;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 125, column 33): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
});
|
|
exports["Nothing"] = Nothing;
|
|
exports["Just"] = Just;
|
|
exports["maybe"] = maybe;
|
|
exports["fromMaybe"] = fromMaybe;
|
|
exports["isJust"] = isJust;
|
|
exports["isNothing"] = isNothing;
|
|
exports["fromJust"] = fromJust;
|
|
exports["functorMaybe"] = functorMaybe;
|
|
exports["applyMaybe"] = applyMaybe;
|
|
exports["bindMaybe"] = bindMaybe;
|
|
})(PS["Data.Maybe"] = PS["Data.Maybe"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.empty = {};
|
|
|
|
exports._lookup = function (no, yes, k, m) {
|
|
return k in m ? yes(m[k]) : no;
|
|
};
|
|
|
|
function toArrayWithKey(f) {
|
|
return function (m) {
|
|
var r = [];
|
|
for (var k in m) {
|
|
if (hasOwnProperty.call(m, k)) {
|
|
r.push(f(k)(m[k]));
|
|
}
|
|
}
|
|
return r;
|
|
};
|
|
}
|
|
})(PS["Foreign.Object"] = PS["Foreign.Object"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Array size ------------------------------------------------------------------
|
|
//------------------------------------------------------------------------------
|
|
|
|
exports.length = function (xs) {
|
|
return xs.length;
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Extending arrays ------------------------------------------------------------
|
|
//------------------------------------------------------------------------------
|
|
|
|
exports.cons = function (e) {
|
|
return function (l) {
|
|
return [e].concat(l);
|
|
};
|
|
};
|
|
|
|
exports.snoc = function (l) {
|
|
return function (e) {
|
|
var l1 = l.slice();
|
|
l1.push(e);
|
|
return l1;
|
|
};
|
|
};
|
|
|
|
exports.concat = function (xss) {
|
|
if (xss.length <= 10000) {
|
|
// This method is faster, but it crashes on big arrays.
|
|
// So we use it when can and fallback to simple variant otherwise.
|
|
return Array.prototype.concat.apply([], xss);
|
|
}
|
|
|
|
var result = [];
|
|
for (var i = 0, l = xss.length; i < l; i++) {
|
|
var xs = xss[i];
|
|
for (var j = 0, m = xs.length; j < m; j++) {
|
|
result.push(xs[j]);
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
|
|
exports.filter = function (f) {
|
|
return function (xs) {
|
|
return xs.filter(f);
|
|
};
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Subarrays -------------------------------------------------------------------
|
|
//------------------------------------------------------------------------------
|
|
|
|
exports.slice = function (s) {
|
|
return function (e) {
|
|
return function (l) {
|
|
return l.slice(s, e);
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.drop = function (n) {
|
|
return function (l) {
|
|
return n < 1 ? l : l.slice(n);
|
|
};
|
|
};
|
|
})(PS["Data.Array"] = PS["Data.Array"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Bifunctor = function (bimap) {
|
|
this.bimap = bimap;
|
|
};
|
|
var bimap = function (dict) {
|
|
return dict.bimap;
|
|
};
|
|
var rmap = function (dictBifunctor) {
|
|
return bimap(dictBifunctor)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
exports["bimap"] = bimap;
|
|
exports["Bifunctor"] = Bifunctor;
|
|
exports["rmap"] = rmap;
|
|
})(PS["Data.Bifunctor"] = PS["Data.Bifunctor"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.foldrArray = function (f) {
|
|
return function (init) {
|
|
return function (xs) {
|
|
var acc = init;
|
|
var len = xs.length;
|
|
for (var i = len - 1; i >= 0; i--) {
|
|
acc = f(xs[i])(acc);
|
|
}
|
|
return acc;
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.foldlArray = function (f) {
|
|
return function (init) {
|
|
return function (xs) {
|
|
var acc = init;
|
|
var len = xs.length;
|
|
for (var i = 0; i < len; i++) {
|
|
acc = f(acc)(xs[i]);
|
|
}
|
|
return acc;
|
|
};
|
|
};
|
|
};
|
|
})(PS["Data.Foldable"] = PS["Data.Foldable"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Prelude = PS["Prelude"];
|
|
var Disj = function (x) {
|
|
return x;
|
|
};
|
|
var semigroupDisj = function (dictHeytingAlgebra) {
|
|
return new Data_Semigroup.Semigroup(function (v) {
|
|
return function (v1) {
|
|
return Data_HeytingAlgebra.disj(dictHeytingAlgebra)(v)(v1);
|
|
};
|
|
});
|
|
};
|
|
var monoidDisj = function (dictHeytingAlgebra) {
|
|
return new Data_Monoid.Monoid(function () {
|
|
return semigroupDisj(dictHeytingAlgebra);
|
|
}, Data_HeytingAlgebra.ff(dictHeytingAlgebra));
|
|
};
|
|
exports["Disj"] = Disj;
|
|
exports["semigroupDisj"] = semigroupDisj;
|
|
exports["monoidDisj"] = monoidDisj;
|
|
})(PS["Data.Monoid.Disj"] = PS["Data.Monoid.Disj"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Monoid_Additive = PS["Data.Monoid.Additive"];
|
|
var Data_Monoid_Conj = PS["Data.Monoid.Conj"];
|
|
var Data_Monoid_Disj = PS["Data.Monoid.Disj"];
|
|
var Data_Monoid_Dual = PS["Data.Monoid.Dual"];
|
|
var Data_Monoid_Endo = PS["Data.Monoid.Endo"];
|
|
var Data_Monoid_Multiplicative = PS["Data.Monoid.Multiplicative"];
|
|
var Data_Semigroup_First = PS["Data.Semigroup.First"];
|
|
var Data_Semigroup_Last = PS["Data.Semigroup.Last"];
|
|
var Prelude = PS["Prelude"];
|
|
var Newtype = function (unwrap, wrap) {
|
|
this.unwrap = unwrap;
|
|
this.wrap = wrap;
|
|
};
|
|
var wrap = function (dict) {
|
|
return dict.wrap;
|
|
};
|
|
var unwrap = function (dict) {
|
|
return dict.unwrap;
|
|
};
|
|
var newtypeDisj = new Newtype(function (v) {
|
|
return v;
|
|
}, Data_Monoid_Disj.Disj);
|
|
var alaF = function (dictFunctor) {
|
|
return function (dictFunctor1) {
|
|
return function (dictNewtype) {
|
|
return function (dictNewtype1) {
|
|
return function (v) {
|
|
return function (f) {
|
|
return function ($80) {
|
|
return Data_Functor.map(dictFunctor1)(unwrap(dictNewtype1))(f(Data_Functor.map(dictFunctor)(wrap(dictNewtype))($80)));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["unwrap"] = unwrap;
|
|
exports["wrap"] = wrap;
|
|
exports["Newtype"] = Newtype;
|
|
exports["alaF"] = alaF;
|
|
exports["newtypeDisj"] = newtypeDisj;
|
|
})(PS["Data.Newtype"] = PS["Data.Newtype"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Foldable"];
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Maybe_First = PS["Data.Maybe.First"];
|
|
var Data_Maybe_Last = PS["Data.Maybe.Last"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Monoid_Additive = PS["Data.Monoid.Additive"];
|
|
var Data_Monoid_Conj = PS["Data.Monoid.Conj"];
|
|
var Data_Monoid_Disj = PS["Data.Monoid.Disj"];
|
|
var Data_Monoid_Dual = PS["Data.Monoid.Dual"];
|
|
var Data_Monoid_Endo = PS["Data.Monoid.Endo"];
|
|
var Data_Monoid_Multiplicative = PS["Data.Monoid.Multiplicative"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Foldable = function (foldMap, foldl, foldr) {
|
|
this.foldMap = foldMap;
|
|
this.foldl = foldl;
|
|
this.foldr = foldr;
|
|
};
|
|
var foldr = function (dict) {
|
|
return dict.foldr;
|
|
};
|
|
var traverse_ = function (dictApplicative) {
|
|
return function (dictFoldable) {
|
|
return function (f) {
|
|
return foldr(dictFoldable)(function ($195) {
|
|
return Control_Apply.applySecond(dictApplicative.Apply0())(f($195));
|
|
})(Control_Applicative.pure(dictApplicative)(Data_Unit.unit));
|
|
};
|
|
};
|
|
};
|
|
var for_ = function (dictApplicative) {
|
|
return function (dictFoldable) {
|
|
return Data_Function.flip(traverse_(dictApplicative)(dictFoldable));
|
|
};
|
|
};
|
|
var sequence_ = function (dictApplicative) {
|
|
return function (dictFoldable) {
|
|
return traverse_(dictApplicative)(dictFoldable)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
};
|
|
var foldl = function (dict) {
|
|
return dict.foldl;
|
|
};
|
|
var foldableMaybe = new Foldable(function (dictMonoid) {
|
|
return function (f) {
|
|
return function (v) {
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
return Data_Monoid.mempty(dictMonoid);
|
|
};
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return f(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 129, column 41): " + [ f.constructor.name, v.constructor.name ]);
|
|
};
|
|
};
|
|
}, function (v) {
|
|
return function (z) {
|
|
return function (v1) {
|
|
if (v1 instanceof Data_Maybe.Nothing) {
|
|
return z;
|
|
};
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
return v(z)(v1.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 129, column 41): " + [ v.constructor.name, z.constructor.name, v1.constructor.name ]);
|
|
};
|
|
};
|
|
}, function (v) {
|
|
return function (z) {
|
|
return function (v1) {
|
|
if (v1 instanceof Data_Maybe.Nothing) {
|
|
return z;
|
|
};
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
return v(v1.value0)(z);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 129, column 41): " + [ v.constructor.name, z.constructor.name, v1.constructor.name ]);
|
|
};
|
|
};
|
|
});
|
|
var foldMapDefaultR = function (dictFoldable) {
|
|
return function (dictMonoid) {
|
|
return function (f) {
|
|
return foldr(dictFoldable)(function (x) {
|
|
return function (acc) {
|
|
return Data_Semigroup.append(dictMonoid.Semigroup0())(f(x))(acc);
|
|
};
|
|
})(Data_Monoid.mempty(dictMonoid));
|
|
};
|
|
};
|
|
};
|
|
var foldableArray = new Foldable(function (dictMonoid) {
|
|
return foldMapDefaultR(foldableArray)(dictMonoid);
|
|
}, $foreign.foldlArray, $foreign.foldrArray);
|
|
var foldMap = function (dict) {
|
|
return dict.foldMap;
|
|
};
|
|
var find = function (dictFoldable) {
|
|
return function (p) {
|
|
var go = function (v) {
|
|
return function (v1) {
|
|
if (v instanceof Data_Maybe.Nothing && p(v1)) {
|
|
return new Data_Maybe.Just(v1);
|
|
};
|
|
return v;
|
|
};
|
|
};
|
|
return foldl(dictFoldable)(go)(Data_Maybe.Nothing.value);
|
|
};
|
|
};
|
|
var any = function (dictFoldable) {
|
|
return function (dictHeytingAlgebra) {
|
|
return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Newtype.newtypeDisj)(Data_Newtype.newtypeDisj)(Data_Monoid_Disj.Disj)(foldMap(dictFoldable)(Data_Monoid_Disj.monoidDisj(dictHeytingAlgebra)));
|
|
};
|
|
};
|
|
exports["Foldable"] = Foldable;
|
|
exports["foldr"] = foldr;
|
|
exports["foldl"] = foldl;
|
|
exports["foldMap"] = foldMap;
|
|
exports["foldMapDefaultR"] = foldMapDefaultR;
|
|
exports["traverse_"] = traverse_;
|
|
exports["for_"] = for_;
|
|
exports["sequence_"] = sequence_;
|
|
exports["any"] = any;
|
|
exports["find"] = find;
|
|
exports["foldableArray"] = foldableArray;
|
|
exports["foldableMaybe"] = foldableMaybe;
|
|
})(PS["Data.Foldable"] = PS["Data.Foldable"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifoldable = PS["Data.Bifoldable"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Bitraversable = PS["Data.Bitraversable"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Left = (function () {
|
|
function Left(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Left.create = function (value0) {
|
|
return new Left(value0);
|
|
};
|
|
return Left;
|
|
})();
|
|
var Right = (function () {
|
|
function Right(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Right.create = function (value0) {
|
|
return new Right(value0);
|
|
};
|
|
return Right;
|
|
})();
|
|
var functorEither = new Data_Functor.Functor(function (f) {
|
|
return function (m) {
|
|
if (m instanceof Left) {
|
|
return new Left(m.value0);
|
|
};
|
|
if (m instanceof Right) {
|
|
return new Right(f(m.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Either (line 38, column 8 - line 38, column 52): " + [ m.constructor.name ]);
|
|
};
|
|
});
|
|
var either = function (v) {
|
|
return function (v1) {
|
|
return function (v2) {
|
|
if (v2 instanceof Left) {
|
|
return v(v2.value0);
|
|
};
|
|
if (v2 instanceof Right) {
|
|
return v1(v2.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): " + [ v.constructor.name, v1.constructor.name, v2.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
var bifunctorEither = new Data_Bifunctor.Bifunctor(function (v) {
|
|
return function (v1) {
|
|
return function (v2) {
|
|
if (v2 instanceof Left) {
|
|
return new Left(v(v2.value0));
|
|
};
|
|
if (v2 instanceof Right) {
|
|
return new Right(v1(v2.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Either (line 46, column 1 - line 46, column 45): " + [ v.constructor.name, v1.constructor.name, v2.constructor.name ]);
|
|
};
|
|
};
|
|
});
|
|
var applyEither = new Control_Apply.Apply(function () {
|
|
return functorEither;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
if (v instanceof Left) {
|
|
return new Left(v.value0);
|
|
};
|
|
if (v instanceof Right) {
|
|
return Data_Functor.map(functorEither)(v.value0)(v1);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Either (line 82, column 1 - line 82, column 41): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
});
|
|
exports["Left"] = Left;
|
|
exports["Right"] = Right;
|
|
exports["either"] = either;
|
|
exports["functorEither"] = functorEither;
|
|
exports["bifunctorEither"] = bifunctorEither;
|
|
exports["applyEither"] = applyEither;
|
|
})(PS["Data.Either"] = PS["Data.Either"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Comonad = PS["Control.Comonad"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Lazy = PS["Control.Lazy"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Data_BooleanAlgebra = PS["Data.BooleanAlgebra"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_CommutativeRing = PS["Data.CommutativeRing"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_EuclideanRing = PS["Data.EuclideanRing"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Identity = function (x) {
|
|
return x;
|
|
};
|
|
var newtypeIdentity = new Data_Newtype.Newtype(function (n) {
|
|
return n;
|
|
}, Identity);
|
|
var functorIdentity = new Data_Functor.Functor(function (f) {
|
|
return function (m) {
|
|
return f(m);
|
|
};
|
|
});
|
|
var applyIdentity = new Control_Apply.Apply(function () {
|
|
return functorIdentity;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
return v(v1);
|
|
};
|
|
});
|
|
var bindIdentity = new Control_Bind.Bind(function () {
|
|
return applyIdentity;
|
|
}, function (v) {
|
|
return function (f) {
|
|
return f(v);
|
|
};
|
|
});
|
|
var applicativeIdentity = new Control_Applicative.Applicative(function () {
|
|
return applyIdentity;
|
|
}, Identity);
|
|
var monadIdentity = new Control_Monad.Monad(function () {
|
|
return applicativeIdentity;
|
|
}, function () {
|
|
return bindIdentity;
|
|
});
|
|
exports["Identity"] = Identity;
|
|
exports["newtypeIdentity"] = newtypeIdentity;
|
|
exports["functorIdentity"] = functorIdentity;
|
|
exports["applyIdentity"] = applyIdentity;
|
|
exports["applicativeIdentity"] = applicativeIdentity;
|
|
exports["bindIdentity"] = bindIdentity;
|
|
exports["monadIdentity"] = monadIdentity;
|
|
})(PS["Data.Identity"] = PS["Data.Identity"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.pureE = function (a) {
|
|
return function () {
|
|
return a;
|
|
};
|
|
};
|
|
|
|
exports.bindE = function (a) {
|
|
return function (f) {
|
|
return function () {
|
|
return f(a())();
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.foreachE = function (as) {
|
|
return function (f) {
|
|
return function () {
|
|
for (var i = 0, l = as.length; i < l; i++) {
|
|
f(as[i])();
|
|
}
|
|
};
|
|
};
|
|
};
|
|
})(PS["Effect"] = PS["Effect"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Prelude = PS["Prelude"];
|
|
var monadEffect = new Control_Monad.Monad(function () {
|
|
return applicativeEffect;
|
|
}, function () {
|
|
return bindEffect;
|
|
});
|
|
var bindEffect = new Control_Bind.Bind(function () {
|
|
return applyEffect;
|
|
}, $foreign.bindE);
|
|
var applyEffect = new Control_Apply.Apply(function () {
|
|
return functorEffect;
|
|
}, Control_Monad.ap(monadEffect));
|
|
var applicativeEffect = new Control_Applicative.Applicative(function () {
|
|
return applyEffect;
|
|
}, $foreign.pureE);
|
|
var functorEffect = new Data_Functor.Functor(Control_Applicative.liftA1(applicativeEffect));
|
|
exports["functorEffect"] = functorEffect;
|
|
exports["applyEffect"] = applyEffect;
|
|
exports["applicativeEffect"] = applicativeEffect;
|
|
exports["bindEffect"] = bindEffect;
|
|
exports["monadEffect"] = monadEffect;
|
|
exports["foreachE"] = $foreign.foreachE;
|
|
})(PS["Effect"] = PS["Effect"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.new = function (val) {
|
|
return function () {
|
|
return { value: val };
|
|
};
|
|
};
|
|
|
|
exports.read = function (ref) {
|
|
return function () {
|
|
return ref.value;
|
|
};
|
|
};
|
|
|
|
exports["modify'"] = function (f) {
|
|
return function (ref) {
|
|
return function () {
|
|
var t = f(ref.value);
|
|
ref.value = t.state;
|
|
return t.value;
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.write = function (val) {
|
|
return function (ref) {
|
|
return function () {
|
|
ref.value = val;
|
|
return {};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Effect.Ref"] = PS["Effect.Ref"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.Ref"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var modify = function (f) {
|
|
return $foreign["modify'"](function (s) {
|
|
var s$prime = f(s);
|
|
return {
|
|
state: s$prime,
|
|
value: s$prime
|
|
};
|
|
});
|
|
};
|
|
var modify_ = function (f) {
|
|
return function (s) {
|
|
return Data_Functor["void"](Effect.functorEffect)(modify(f)(s));
|
|
};
|
|
};
|
|
exports["modify"] = modify;
|
|
exports["modify_"] = modify_;
|
|
exports["new"] = $foreign["new"];
|
|
exports["read"] = $foreign.read;
|
|
exports["modify'"] = $foreign["modify'"];
|
|
exports["write"] = $foreign.write;
|
|
})(PS["Effect.Ref"] = PS["Effect.Ref"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
// module Partial.Unsafe
|
|
|
|
exports.unsafePartial = function (f) {
|
|
return f();
|
|
};
|
|
})(PS["Partial.Unsafe"] = PS["Partial.Unsafe"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
// module Partial
|
|
|
|
exports.crashWith = function () {
|
|
return function (msg) {
|
|
throw new Error(msg);
|
|
};
|
|
};
|
|
})(PS["Partial"] = PS["Partial"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Partial"];
|
|
exports["crashWith"] = $foreign.crashWith;
|
|
})(PS["Partial"] = PS["Partial"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Partial.Unsafe"];
|
|
var Partial = PS["Partial"];
|
|
var unsafeCrashWith = function (msg) {
|
|
return $foreign.unsafePartial(function (dictPartial) {
|
|
return Partial.crashWith(dictPartial)(msg);
|
|
});
|
|
};
|
|
exports["unsafeCrashWith"] = unsafeCrashWith;
|
|
})(PS["Partial.Unsafe"] = PS["Partial.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Loop = (function () {
|
|
function Loop(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Loop.create = function (value0) {
|
|
return new Loop(value0);
|
|
};
|
|
return Loop;
|
|
})();
|
|
var Done = (function () {
|
|
function Done(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Done.create = function (value0) {
|
|
return new Done(value0);
|
|
};
|
|
return Done;
|
|
})();
|
|
var MonadRec = function (Monad0, tailRecM) {
|
|
this.Monad0 = Monad0;
|
|
this.tailRecM = tailRecM;
|
|
};
|
|
var tailRecM = function (dict) {
|
|
return dict.tailRecM;
|
|
};
|
|
var monadRecEffect = new MonadRec(function () {
|
|
return Effect.monadEffect;
|
|
}, function (f) {
|
|
return function (a) {
|
|
var fromDone = function (v) {
|
|
if (v instanceof Done) {
|
|
return v.value0;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 111, column 30 - line 111, column 44): " + [ v.constructor.name ]);
|
|
};
|
|
return function __do() {
|
|
var v = Control_Bind.bindFlipped(Effect.bindEffect)(Effect_Ref["new"])(f(a))();
|
|
(function () {
|
|
while (!(function __do() {
|
|
var v1 = Effect_Ref.read(v)();
|
|
if (v1 instanceof Loop) {
|
|
var v2 = f(v1.value0)();
|
|
var v3 = Effect_Ref.write(v2)(v)();
|
|
return false;
|
|
};
|
|
if (v1 instanceof Done) {
|
|
return true;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 102, column 22 - line 107, column 28): " + [ v1.constructor.name ]);
|
|
})()) {
|
|
|
|
};
|
|
return {};
|
|
})();
|
|
return Data_Functor.map(Effect.functorEffect)(fromDone)(Effect_Ref.read(v))();
|
|
};
|
|
};
|
|
});
|
|
exports["Loop"] = Loop;
|
|
exports["Done"] = Done;
|
|
exports["MonadRec"] = MonadRec;
|
|
exports["tailRecM"] = tailRecM;
|
|
exports["monadRecEffect"] = monadRecEffect;
|
|
})(PS["Control.Monad.Rec.Class"] = PS["Control.Monad.Rec.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Biapplicative = PS["Control.Biapplicative"];
|
|
var Control_Biapply = PS["Control.Biapply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Comonad = PS["Control.Comonad"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Lazy = PS["Control.Lazy"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifoldable = PS["Data.Bifoldable"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Bitraversable = PS["Data.Bitraversable"];
|
|
var Data_BooleanAlgebra = PS["Data.BooleanAlgebra"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_CommutativeRing = PS["Data.CommutativeRing"];
|
|
var Data_Distributive = PS["Data.Distributive"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Maybe_First = PS["Data.Maybe.First"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Type_Equality = PS["Type.Equality"];
|
|
var Tuple = (function () {
|
|
function Tuple(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Tuple.create = function (value0) {
|
|
return function (value1) {
|
|
return new Tuple(value0, value1);
|
|
};
|
|
};
|
|
return Tuple;
|
|
})();
|
|
var snd = function (v) {
|
|
return v.value1;
|
|
};
|
|
var functorTuple = new Data_Functor.Functor(function (f) {
|
|
return function (m) {
|
|
return new Tuple(m.value0, f(m.value1));
|
|
};
|
|
});
|
|
var fst = function (v) {
|
|
return v.value0;
|
|
};
|
|
exports["Tuple"] = Tuple;
|
|
exports["fst"] = fst;
|
|
exports["snd"] = snd;
|
|
exports["functorTuple"] = functorTuple;
|
|
})(PS["Data.Tuple"] = PS["Data.Tuple"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unfoldrArrayImpl = function (isNothing) {
|
|
return function (fromJust) {
|
|
return function (fst) {
|
|
return function (snd) {
|
|
return function (f) {
|
|
return function (b) {
|
|
var result = [];
|
|
var value = b;
|
|
while (true) { // eslint-disable-line no-constant-condition
|
|
var maybe = f(value);
|
|
if (isNothing(maybe)) return result;
|
|
var tuple = fromJust(maybe);
|
|
result.push(fst(tuple));
|
|
value = snd(tuple);
|
|
}
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Data.Unfoldable"] = PS["Data.Unfoldable"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unfoldr1ArrayImpl = function (isNothing) {
|
|
return function (fromJust) {
|
|
return function (fst) {
|
|
return function (snd) {
|
|
return function (f) {
|
|
return function (b) {
|
|
var result = [];
|
|
var value = b;
|
|
while (true) { // eslint-disable-line no-constant-condition
|
|
var tuple = f(value);
|
|
result.push(fst(tuple));
|
|
var maybe = snd(tuple);
|
|
if (isNothing(maybe)) return result;
|
|
value = fromJust(maybe);
|
|
}
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Data.Unfoldable1"] = PS["Data.Unfoldable1"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Unfoldable1"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unfoldable1 = function (unfoldr1) {
|
|
this.unfoldr1 = unfoldr1;
|
|
};
|
|
var unfoldr1 = function (dict) {
|
|
return dict.unfoldr1;
|
|
};
|
|
var unfoldable1Array = new Unfoldable1($foreign.unfoldr1ArrayImpl(Data_Maybe.isNothing)(Data_Maybe.fromJust())(Data_Tuple.fst)(Data_Tuple.snd));
|
|
exports["Unfoldable1"] = Unfoldable1;
|
|
exports["unfoldr1"] = unfoldr1;
|
|
exports["unfoldable1Array"] = unfoldable1Array;
|
|
})(PS["Data.Unfoldable1"] = PS["Data.Unfoldable1"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Unfoldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unfoldable = function (Unfoldable10, unfoldr) {
|
|
this.Unfoldable10 = Unfoldable10;
|
|
this.unfoldr = unfoldr;
|
|
};
|
|
var unfoldr = function (dict) {
|
|
return dict.unfoldr;
|
|
};
|
|
var unfoldableArray = new Unfoldable(function () {
|
|
return Data_Unfoldable1.unfoldable1Array;
|
|
}, $foreign.unfoldrArrayImpl(Data_Maybe.isNothing)(Data_Maybe.fromJust())(Data_Tuple.fst)(Data_Tuple.snd));
|
|
exports["Unfoldable"] = Unfoldable;
|
|
exports["unfoldr"] = unfoldr;
|
|
exports["unfoldableArray"] = unfoldableArray;
|
|
})(PS["Data.Unfoldable"] = PS["Data.Unfoldable"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
// module Unsafe.Coerce
|
|
|
|
exports.unsafeCoerce = function (x) {
|
|
return x;
|
|
};
|
|
})(PS["Unsafe.Coerce"] = PS["Unsafe.Coerce"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Unsafe.Coerce"];
|
|
exports["unsafeCoerce"] = $foreign.unsafeCoerce;
|
|
})(PS["Unsafe.Coerce"] = PS["Unsafe.Coerce"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Array"];
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Lazy = PS["Control.Lazy"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_ST = PS["Control.Monad.ST"];
|
|
var Control_Monad_ST_Internal = PS["Control.Monad.ST.Internal"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Array_NonEmpty_Internal = PS["Data.Array.NonEmpty.Internal"];
|
|
var Data_Array_ST = PS["Data.Array.ST"];
|
|
var Data_Array_ST_Iterator = PS["Data.Array.ST.Iterator"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var singleton = function (a) {
|
|
return [ a ];
|
|
};
|
|
var concatMap = Data_Function.flip(Control_Bind.bind(Control_Bind.bindArray));
|
|
var mapMaybe = function (f) {
|
|
return concatMap(function ($114) {
|
|
return Data_Maybe.maybe([ ])(singleton)(f($114));
|
|
});
|
|
};
|
|
exports["singleton"] = singleton;
|
|
exports["concatMap"] = concatMap;
|
|
exports["mapMaybe"] = mapMaybe;
|
|
exports["length"] = $foreign.length;
|
|
exports["cons"] = $foreign.cons;
|
|
exports["snoc"] = $foreign.snoc;
|
|
exports["filter"] = $foreign.filter;
|
|
exports["drop"] = $foreign.drop;
|
|
})(PS["Data.Array"] = PS["Data.Array"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports["new"] = function () {
|
|
return {};
|
|
};
|
|
})(PS["Foreign.Object.ST"] = PS["Foreign.Object.ST"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Foreign.Object.ST"];
|
|
var Control_Monad_ST = PS["Control.Monad.ST"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
exports["new"] = $foreign["new"];
|
|
})(PS["Foreign.Object.ST"] = PS["Foreign.Object.ST"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Foreign.Object"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_ST = PS["Control.Monad.ST"];
|
|
var Control_Monad_ST_Internal = PS["Control.Monad.ST.Internal"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Foreign_Object_ST = PS["Foreign.Object.ST"];
|
|
var Prelude = PS["Prelude"];
|
|
var Type_Row_Homogeneous = PS["Type.Row.Homogeneous"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var lookup = Data_Function_Uncurried.runFn4($foreign["_lookup"])(Data_Maybe.Nothing.value)(Data_Maybe.Just.create);
|
|
exports["lookup"] = lookup;
|
|
exports["empty"] = $foreign.empty;
|
|
})(PS["Foreign.Object"] = PS["Foreign.Object"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Argonaut.Core"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Foreign_Object = PS["Foreign.Object"];
|
|
var Prelude = PS["Prelude"];
|
|
var jsonEmptyObject = $foreign.fromObject(Foreign_Object.empty);
|
|
exports["jsonEmptyObject"] = jsonEmptyObject;
|
|
exports["stringify"] = $foreign.stringify;
|
|
})(PS["Data.Argonaut.Core"] = PS["Data.Argonaut.Core"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.replace = function (s1) {
|
|
return function (s2) {
|
|
return function (s3) {
|
|
return s3.replace(s1, s2);
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.replaceAll = function (s1) {
|
|
return function (s2) {
|
|
return function (s3) {
|
|
return s3.replace(new RegExp(s1.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), "g"), s2); // eslint-disable-line no-useless-escape
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.split = function (sep) {
|
|
return function (s) {
|
|
return s.split(sep);
|
|
};
|
|
};
|
|
|
|
exports.joinWith = function (s) {
|
|
return function (xs) {
|
|
return xs.join(s);
|
|
};
|
|
};
|
|
})(PS["Data.String.Common"] = PS["Data.String.Common"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.String.Common"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Prelude = PS["Prelude"];
|
|
var $$null = function (s) {
|
|
return s === "";
|
|
};
|
|
exports["null"] = $$null;
|
|
exports["replaceAll"] = $foreign.replaceAll;
|
|
exports["split"] = $foreign.split;
|
|
exports["joinWith"] = $foreign.joinWith;
|
|
})(PS["Data.String.Common"] = PS["Data.String.Common"] || {});
|
|
(function(exports) {
|
|
/* globals exports, JSON */
|
|
"use strict";
|
|
|
|
exports.unsafeStringify = function (x) {
|
|
return JSON.stringify(x);
|
|
};
|
|
exports.unsafeDecodeURIComponent = decodeURIComponent;
|
|
exports.unsafeEncodeURIComponent = encodeURIComponent;
|
|
})(PS["Global.Unsafe"] = PS["Global.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Global.Unsafe"];
|
|
exports["unsafeStringify"] = $foreign.unsafeStringify;
|
|
exports["unsafeDecodeURIComponent"] = $foreign.unsafeDecodeURIComponent;
|
|
exports["unsafeEncodeURIComponent"] = $foreign.unsafeEncodeURIComponent;
|
|
})(PS["Global.Unsafe"] = PS["Global.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Global_Unsafe = PS["Global.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var toArray = function (v) {
|
|
return v;
|
|
};
|
|
var encode = (function () {
|
|
var encodePart = function (v) {
|
|
if (v.value1 instanceof Data_Maybe.Nothing) {
|
|
return Global_Unsafe.unsafeEncodeURIComponent(v.value0);
|
|
};
|
|
if (v.value1 instanceof Data_Maybe.Just) {
|
|
return Global_Unsafe.unsafeEncodeURIComponent(v.value0) + ("=" + Global_Unsafe.unsafeEncodeURIComponent(v.value1.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Data.FormURLEncoded (line 35, column 18 - line 37, column 89): " + [ v.constructor.name ]);
|
|
};
|
|
return function ($14) {
|
|
return Data_String_Common.joinWith("&")(Data_Functor.map(Data_Functor.functorArray)(encodePart)(toArray($14)));
|
|
};
|
|
})();
|
|
exports["toArray"] = toArray;
|
|
exports["encode"] = encode;
|
|
})(PS["Data.FormURLEncoded"] = PS["Data.FormURLEncoded"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Prelude = PS["Prelude"];
|
|
var MediaType = function (x) {
|
|
return x;
|
|
};
|
|
var newtypeMediaType = new Data_Newtype.Newtype(function (n) {
|
|
return n;
|
|
}, MediaType);
|
|
exports["MediaType"] = MediaType;
|
|
exports["newtypeMediaType"] = newtypeMediaType;
|
|
})(PS["Data.MediaType"] = PS["Data.MediaType"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var applicationJSON = "application/json";
|
|
var applicationFormURLEncoded = "application/x-www-form-urlencoded";
|
|
exports["applicationFormURLEncoded"] = applicationFormURLEncoded;
|
|
exports["applicationJSON"] = applicationJSON;
|
|
})(PS["Data.MediaType.Common"] = PS["Data.MediaType.Common"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Argonaut_Core = PS["Data.Argonaut.Core"];
|
|
var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"];
|
|
var Data_FormURLEncoded = PS["Data.FormURLEncoded"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var Data_MediaType_Common = PS["Data.MediaType.Common"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_File_Blob = PS["Web.File.Blob"];
|
|
var Web_XHR_FormData = PS["Web.XHR.FormData"];
|
|
var ArrayView = (function () {
|
|
function ArrayView(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
ArrayView.create = function (value0) {
|
|
return new ArrayView(value0);
|
|
};
|
|
return ArrayView;
|
|
})();
|
|
var Blob = (function () {
|
|
function Blob(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Blob.create = function (value0) {
|
|
return new Blob(value0);
|
|
};
|
|
return Blob;
|
|
})();
|
|
var Document = (function () {
|
|
function Document(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Document.create = function (value0) {
|
|
return new Document(value0);
|
|
};
|
|
return Document;
|
|
})();
|
|
var $$String = (function () {
|
|
function $$String(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
$$String.create = function (value0) {
|
|
return new $$String(value0);
|
|
};
|
|
return $$String;
|
|
})();
|
|
var FormData = (function () {
|
|
function FormData(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
FormData.create = function (value0) {
|
|
return new FormData(value0);
|
|
};
|
|
return FormData;
|
|
})();
|
|
var FormURLEncoded = (function () {
|
|
function FormURLEncoded(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
FormURLEncoded.create = function (value0) {
|
|
return new FormURLEncoded(value0);
|
|
};
|
|
return FormURLEncoded;
|
|
})();
|
|
var Json = (function () {
|
|
function Json(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Json.create = function (value0) {
|
|
return new Json(value0);
|
|
};
|
|
return Json;
|
|
})();
|
|
var toMediaType = function (v) {
|
|
if (v instanceof FormURLEncoded) {
|
|
return new Data_Maybe.Just(Data_MediaType_Common.applicationFormURLEncoded);
|
|
};
|
|
if (v instanceof Json) {
|
|
return new Data_Maybe.Just(Data_MediaType_Common.applicationJSON);
|
|
};
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
var string = $$String.create;
|
|
exports["ArrayView"] = ArrayView;
|
|
exports["Blob"] = Blob;
|
|
exports["Document"] = Document;
|
|
exports["String"] = $$String;
|
|
exports["FormData"] = FormData;
|
|
exports["FormURLEncoded"] = FormURLEncoded;
|
|
exports["Json"] = Json;
|
|
exports["string"] = string;
|
|
exports["toMediaType"] = toMediaType;
|
|
})(PS["Affjax.RequestBody"] = PS["Affjax.RequestBody"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Prelude = PS["Prelude"];
|
|
var Accept = (function () {
|
|
function Accept(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Accept.create = function (value0) {
|
|
return new Accept(value0);
|
|
};
|
|
return Accept;
|
|
})();
|
|
var ContentType = (function () {
|
|
function ContentType(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
ContentType.create = function (value0) {
|
|
return new ContentType(value0);
|
|
};
|
|
return ContentType;
|
|
})();
|
|
var RequestHeader = (function () {
|
|
function RequestHeader(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
RequestHeader.create = function (value0) {
|
|
return function (value1) {
|
|
return new RequestHeader(value0, value1);
|
|
};
|
|
};
|
|
return RequestHeader;
|
|
})();
|
|
var requestHeaderValue = function (v) {
|
|
if (v instanceof Accept) {
|
|
return Data_Newtype.unwrap(Data_MediaType.newtypeMediaType)(v.value0);
|
|
};
|
|
if (v instanceof ContentType) {
|
|
return Data_Newtype.unwrap(Data_MediaType.newtypeMediaType)(v.value0);
|
|
};
|
|
if (v instanceof RequestHeader) {
|
|
return v.value1;
|
|
};
|
|
throw new Error("Failed pattern match at Affjax.RequestHeader (line 29, column 1 - line 29, column 46): " + [ v.constructor.name ]);
|
|
};
|
|
var requestHeaderName = function (v) {
|
|
if (v instanceof Accept) {
|
|
return "Accept";
|
|
};
|
|
if (v instanceof ContentType) {
|
|
return "Content-Type";
|
|
};
|
|
if (v instanceof RequestHeader) {
|
|
return v.value0;
|
|
};
|
|
throw new Error("Failed pattern match at Affjax.RequestHeader (line 24, column 1 - line 24, column 45): " + [ v.constructor.name ]);
|
|
};
|
|
exports["Accept"] = Accept;
|
|
exports["ContentType"] = ContentType;
|
|
exports["RequestHeader"] = RequestHeader;
|
|
exports["requestHeaderName"] = requestHeaderName;
|
|
exports["requestHeaderValue"] = requestHeaderValue;
|
|
})(PS["Affjax.RequestHeader"] = PS["Affjax.RequestHeader"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafeToForeign = function (value) {
|
|
return value;
|
|
};
|
|
|
|
exports.unsafeFromForeign = function (value) {
|
|
return value;
|
|
};
|
|
|
|
exports.typeOf = function (value) {
|
|
return typeof value;
|
|
};
|
|
|
|
exports.tagOf = function (value) {
|
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
};
|
|
})(PS["Foreign"] = PS["Foreign"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var MonadThrow = function (Monad0, throwError) {
|
|
this.Monad0 = Monad0;
|
|
this.throwError = throwError;
|
|
};
|
|
var MonadError = function (MonadThrow0, catchError) {
|
|
this.MonadThrow0 = MonadThrow0;
|
|
this.catchError = catchError;
|
|
};
|
|
var throwError = function (dict) {
|
|
return dict.throwError;
|
|
};
|
|
var catchError = function (dict) {
|
|
return dict.catchError;
|
|
};
|
|
var $$try = function (dictMonadError) {
|
|
return function (a) {
|
|
return catchError(dictMonadError)(Data_Functor.map(((((dictMonadError.MonadThrow0()).Monad0()).Bind1()).Apply0()).Functor0())(Data_Either.Right.create)(a))(function ($21) {
|
|
return Control_Applicative.pure(((dictMonadError.MonadThrow0()).Monad0()).Applicative0())(Data_Either.Left.create($21));
|
|
});
|
|
};
|
|
};
|
|
exports["catchError"] = catchError;
|
|
exports["throwError"] = throwError;
|
|
exports["MonadThrow"] = MonadThrow;
|
|
exports["MonadError"] = MonadError;
|
|
exports["try"] = $$try;
|
|
})(PS["Control.Monad.Error.Class"] = PS["Control.Monad.Error.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var MonadState = function (Monad0, state) {
|
|
this.Monad0 = Monad0;
|
|
this.state = state;
|
|
};
|
|
var state = function (dict) {
|
|
return dict.state;
|
|
};
|
|
var modify_ = function (dictMonadState) {
|
|
return function (f) {
|
|
return state(dictMonadState)(function (s) {
|
|
return new Data_Tuple.Tuple(Data_Unit.unit, f(s));
|
|
});
|
|
};
|
|
};
|
|
var modify = function (dictMonadState) {
|
|
return function (f) {
|
|
return state(dictMonadState)(function (s) {
|
|
var s$prime = f(s);
|
|
return new Data_Tuple.Tuple(s$prime, s$prime);
|
|
});
|
|
};
|
|
};
|
|
var gets = function (dictMonadState) {
|
|
return function (f) {
|
|
return state(dictMonadState)(function (s) {
|
|
return new Data_Tuple.Tuple(f(s), s);
|
|
});
|
|
};
|
|
};
|
|
var get = function (dictMonadState) {
|
|
return state(dictMonadState)(function (s) {
|
|
return new Data_Tuple.Tuple(s, s);
|
|
});
|
|
};
|
|
exports["state"] = state;
|
|
exports["MonadState"] = MonadState;
|
|
exports["get"] = get;
|
|
exports["gets"] = gets;
|
|
exports["modify"] = modify;
|
|
exports["modify_"] = modify_;
|
|
})(PS["Control.Monad.State.Class"] = PS["Control.Monad.State.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Prelude = PS["Prelude"];
|
|
var MonadTrans = function (lift) {
|
|
this.lift = lift;
|
|
};
|
|
var lift = function (dict) {
|
|
return dict.lift;
|
|
};
|
|
exports["lift"] = lift;
|
|
exports["MonadTrans"] = MonadTrans;
|
|
})(PS["Control.Monad.Trans.Class"] = PS["Control.Monad.Trans.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Effect = PS["Effect"];
|
|
var MonadEffect = function (Monad0, liftEffect) {
|
|
this.Monad0 = Monad0;
|
|
this.liftEffect = liftEffect;
|
|
};
|
|
var liftEffect = function (dict) {
|
|
return dict.liftEffect;
|
|
};
|
|
exports["liftEffect"] = liftEffect;
|
|
exports["MonadEffect"] = MonadEffect;
|
|
})(PS["Effect.Class"] = PS["Effect.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Cont_Class = PS["Control.Monad.Cont.Class"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Reader_Class = PS["Control.Monad.Reader.Class"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Monad_Writer_Class = PS["Control.Monad.Writer.Class"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Prelude = PS["Prelude"];
|
|
var ExceptT = function (x) {
|
|
return x;
|
|
};
|
|
var runExceptT = function (v) {
|
|
return v;
|
|
};
|
|
var mapExceptT = function (f) {
|
|
return function (v) {
|
|
return f(v);
|
|
};
|
|
};
|
|
var functorExceptT = function (dictFunctor) {
|
|
return new Data_Functor.Functor(function (f) {
|
|
return mapExceptT(Data_Functor.map(dictFunctor)(Data_Functor.map(Data_Either.functorEither)(f)));
|
|
});
|
|
};
|
|
var monadExceptT = function (dictMonad) {
|
|
return new Control_Monad.Monad(function () {
|
|
return applicativeExceptT(dictMonad);
|
|
}, function () {
|
|
return bindExceptT(dictMonad);
|
|
});
|
|
};
|
|
var bindExceptT = function (dictMonad) {
|
|
return new Control_Bind.Bind(function () {
|
|
return applyExceptT(dictMonad);
|
|
}, function (v) {
|
|
return function (k) {
|
|
return Control_Bind.bind(dictMonad.Bind1())(v)(Data_Either.either(function ($97) {
|
|
return Control_Applicative.pure(dictMonad.Applicative0())(Data_Either.Left.create($97));
|
|
})(function (a) {
|
|
var v1 = k(a);
|
|
return v1;
|
|
}));
|
|
};
|
|
});
|
|
};
|
|
var applyExceptT = function (dictMonad) {
|
|
return new Control_Apply.Apply(function () {
|
|
return functorExceptT(((dictMonad.Bind1()).Apply0()).Functor0());
|
|
}, Control_Monad.ap(monadExceptT(dictMonad)));
|
|
};
|
|
var applicativeExceptT = function (dictMonad) {
|
|
return new Control_Applicative.Applicative(function () {
|
|
return applyExceptT(dictMonad);
|
|
}, function ($98) {
|
|
return ExceptT(Control_Applicative.pure(dictMonad.Applicative0())(Data_Either.Right.create($98)));
|
|
});
|
|
};
|
|
var monadThrowExceptT = function (dictMonad) {
|
|
return new Control_Monad_Error_Class.MonadThrow(function () {
|
|
return monadExceptT(dictMonad);
|
|
}, function ($102) {
|
|
return ExceptT(Control_Applicative.pure(dictMonad.Applicative0())(Data_Either.Left.create($102)));
|
|
});
|
|
};
|
|
exports["ExceptT"] = ExceptT;
|
|
exports["runExceptT"] = runExceptT;
|
|
exports["mapExceptT"] = mapExceptT;
|
|
exports["functorExceptT"] = functorExceptT;
|
|
exports["applyExceptT"] = applyExceptT;
|
|
exports["applicativeExceptT"] = applicativeExceptT;
|
|
exports["bindExceptT"] = bindExceptT;
|
|
exports["monadExceptT"] = monadExceptT;
|
|
exports["monadThrowExceptT"] = monadThrowExceptT;
|
|
})(PS["Control.Monad.Except.Trans"] = PS["Control.Monad.Except.Trans"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Prelude = PS["Prelude"];
|
|
var runExcept = function ($0) {
|
|
return Data_Newtype.unwrap(Data_Identity.newtypeIdentity)(Control_Monad_Except_Trans.runExceptT($0));
|
|
};
|
|
exports["runExcept"] = runExcept;
|
|
})(PS["Control.Monad.Except"] = PS["Control.Monad.Except"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Prelude = PS["Prelude"];
|
|
var NonEmpty = (function () {
|
|
function NonEmpty(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
NonEmpty.create = function (value0) {
|
|
return function (value1) {
|
|
return new NonEmpty(value0, value1);
|
|
};
|
|
};
|
|
return NonEmpty;
|
|
})();
|
|
var singleton = function (dictPlus) {
|
|
return function (a) {
|
|
return new NonEmpty(a, Control_Plus.empty(dictPlus));
|
|
};
|
|
};
|
|
exports["NonEmpty"] = NonEmpty;
|
|
exports["singleton"] = singleton;
|
|
})(PS["Data.NonEmpty"] = PS["Data.NonEmpty"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Comonad = PS["Control.Comonad"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_NonEmpty = PS["Data.NonEmpty"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Prelude = PS["Prelude"];
|
|
var Nil = (function () {
|
|
function Nil() {
|
|
|
|
};
|
|
Nil.value = new Nil();
|
|
return Nil;
|
|
})();
|
|
var Cons = (function () {
|
|
function Cons(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Cons.create = function (value0) {
|
|
return function (value1) {
|
|
return new Cons(value0, value1);
|
|
};
|
|
};
|
|
return Cons;
|
|
})();
|
|
var NonEmptyList = function (x) {
|
|
return x;
|
|
};
|
|
var foldableList = new Data_Foldable.Foldable(function (dictMonoid) {
|
|
return function (f) {
|
|
return Data_Foldable.foldl(foldableList)(function (acc) {
|
|
return function ($174) {
|
|
return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f($174));
|
|
};
|
|
})(Data_Monoid.mempty(dictMonoid));
|
|
};
|
|
}, function (f) {
|
|
var go = function ($copy_b) {
|
|
return function ($copy_v) {
|
|
var $tco_var_b = $copy_b;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(b, v) {
|
|
if (v instanceof Nil) {
|
|
$tco_done = true;
|
|
return b;
|
|
};
|
|
if (v instanceof Cons) {
|
|
$tco_var_b = f(b)(v.value0);
|
|
$copy_v = v.value1;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.List.Types (line 81, column 12 - line 83, column 30): " + [ v.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_b, $copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go;
|
|
}, function (f) {
|
|
return function (b) {
|
|
var rev = Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value);
|
|
return function ($175) {
|
|
return Data_Foldable.foldl(foldableList)(Data_Function.flip(f))(b)(rev($175));
|
|
};
|
|
};
|
|
});
|
|
var functorList = new Data_Functor.Functor(function (f) {
|
|
return Data_Foldable.foldr(foldableList)(function (x) {
|
|
return function (acc) {
|
|
return new Cons(f(x), acc);
|
|
};
|
|
})(Nil.value);
|
|
});
|
|
var semigroupList = new Data_Semigroup.Semigroup(function (xs) {
|
|
return function (ys) {
|
|
return Data_Foldable.foldr(foldableList)(Cons.create)(ys)(xs);
|
|
};
|
|
});
|
|
var applyList = new Control_Apply.Apply(function () {
|
|
return functorList;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
if (v instanceof Nil) {
|
|
return Nil.value;
|
|
};
|
|
if (v instanceof Cons) {
|
|
return Data_Semigroup.append(semigroupList)(Data_Functor.map(functorList)(v.value0)(v1))(Control_Apply.apply(applyList)(v.value1)(v1));
|
|
};
|
|
throw new Error("Failed pattern match at Data.List.Types (line 127, column 1 - line 127, column 33): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
});
|
|
var applicativeList = new Control_Applicative.Applicative(function () {
|
|
return applyList;
|
|
}, function (a) {
|
|
return new Cons(a, Nil.value);
|
|
});
|
|
var altList = new Control_Alt.Alt(function () {
|
|
return functorList;
|
|
}, Data_Semigroup.append(semigroupList));
|
|
var plusList = new Control_Plus.Plus(function () {
|
|
return altList;
|
|
}, Nil.value);
|
|
exports["Nil"] = Nil;
|
|
exports["Cons"] = Cons;
|
|
exports["NonEmptyList"] = NonEmptyList;
|
|
exports["semigroupList"] = semigroupList;
|
|
exports["functorList"] = functorList;
|
|
exports["foldableList"] = foldableList;
|
|
exports["applyList"] = applyList;
|
|
exports["applicativeList"] = applicativeList;
|
|
exports["altList"] = altList;
|
|
exports["plusList"] = plusList;
|
|
})(PS["Data.List.Types"] = PS["Data.List.Types"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Lazy = PS["Control.Lazy"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_NonEmpty = PS["Data.NonEmpty"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var reverse = (function () {
|
|
var go = function ($copy_acc) {
|
|
return function ($copy_v) {
|
|
var $tco_var_acc = $copy_acc;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(acc, v) {
|
|
if (v instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return acc;
|
|
};
|
|
if (v instanceof Data_List_Types.Cons) {
|
|
$tco_var_acc = new Data_List_Types.Cons(v.value0, acc);
|
|
$copy_v = v.value1;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.List (line 368, column 3 - line 368, column 19): " + [ acc.constructor.name, v.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_acc, $copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go(Data_List_Types.Nil.value);
|
|
})();
|
|
var $$null = function (v) {
|
|
if (v instanceof Data_List_Types.Nil) {
|
|
return true;
|
|
};
|
|
return false;
|
|
};
|
|
var fromFoldable = function (dictFoldable) {
|
|
return Data_Foldable.foldr(dictFoldable)(Data_List_Types.Cons.create)(Data_List_Types.Nil.value);
|
|
};
|
|
exports["fromFoldable"] = fromFoldable;
|
|
exports["null"] = $$null;
|
|
exports["reverse"] = reverse;
|
|
})(PS["Data.List"] = PS["Data.List"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_NonEmpty = PS["Data.NonEmpty"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var singleton = function ($165) {
|
|
return Data_List_Types.NonEmptyList(Data_NonEmpty.singleton(Data_List_Types.plusList)($165));
|
|
};
|
|
var head = function (v) {
|
|
return v.value0;
|
|
};
|
|
var cons = function (y) {
|
|
return function (v) {
|
|
return new Data_NonEmpty.NonEmpty(y, new Data_List_Types.Cons(v.value0, v.value1));
|
|
};
|
|
};
|
|
exports["singleton"] = singleton;
|
|
exports["cons"] = cons;
|
|
exports["head"] = head;
|
|
})(PS["Data.List.NonEmpty"] = PS["Data.List.NonEmpty"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.singleton = function (c) {
|
|
return c;
|
|
};
|
|
|
|
exports.length = function (s) {
|
|
return s.length;
|
|
};
|
|
|
|
exports.drop = function (n) {
|
|
return function (s) {
|
|
return s.substring(n);
|
|
};
|
|
};
|
|
})(PS["Data.String.CodeUnits"] = PS["Data.String.CodeUnits"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.charAt = function (i) {
|
|
return function (s) {
|
|
if (i >= 0 && i < s.length) return s.charAt(i);
|
|
throw new Error("Data.String.Unsafe.charAt: Invalid index.");
|
|
};
|
|
};
|
|
})(PS["Data.String.Unsafe"] = PS["Data.String.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.String.Unsafe"];
|
|
exports["charAt"] = $foreign.charAt;
|
|
})(PS["Data.String.Unsafe"] = PS["Data.String.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.String.CodeUnits"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_String_Unsafe = PS["Data.String.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
exports["singleton"] = $foreign.singleton;
|
|
exports["length"] = $foreign.length;
|
|
exports["drop"] = $foreign.drop;
|
|
})(PS["Data.String.CodeUnits"] = PS["Data.String.CodeUnits"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Foreign"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Except = PS["Control.Monad.Except"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Int = PS["Data.Int"];
|
|
var Data_List_NonEmpty = PS["Data.List.NonEmpty"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String_CodeUnits = PS["Data.String.CodeUnits"];
|
|
var Prelude = PS["Prelude"];
|
|
var ForeignError = (function () {
|
|
function ForeignError(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
ForeignError.create = function (value0) {
|
|
return new ForeignError(value0);
|
|
};
|
|
return ForeignError;
|
|
})();
|
|
var TypeMismatch = (function () {
|
|
function TypeMismatch(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
TypeMismatch.create = function (value0) {
|
|
return function (value1) {
|
|
return new TypeMismatch(value0, value1);
|
|
};
|
|
};
|
|
return TypeMismatch;
|
|
})();
|
|
var fail = function ($107) {
|
|
return Control_Monad_Error_Class.throwError(Control_Monad_Except_Trans.monadThrowExceptT(Data_Identity.monadIdentity))(Data_List_NonEmpty.singleton($107));
|
|
};
|
|
var unsafeReadTagged = function (tag) {
|
|
return function (value) {
|
|
if ($foreign.tagOf(value) === tag) {
|
|
return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))($foreign.unsafeFromForeign(value));
|
|
};
|
|
if (Data_Boolean.otherwise) {
|
|
return fail(new TypeMismatch(tag, $foreign.tagOf(value)));
|
|
};
|
|
throw new Error("Failed pattern match at Foreign (line 106, column 1 - line 106, column 55): " + [ tag.constructor.name, value.constructor.name ]);
|
|
};
|
|
};
|
|
var readBoolean = unsafeReadTagged("Boolean");
|
|
var readString = unsafeReadTagged("String");
|
|
exports["ForeignError"] = ForeignError;
|
|
exports["TypeMismatch"] = TypeMismatch;
|
|
exports["unsafeReadTagged"] = unsafeReadTagged;
|
|
exports["readString"] = readString;
|
|
exports["readBoolean"] = readBoolean;
|
|
exports["fail"] = fail;
|
|
exports["unsafeToForeign"] = $foreign.unsafeToForeign;
|
|
exports["typeOf"] = $foreign.typeOf;
|
|
})(PS["Foreign"] = PS["Foreign"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Argonaut_Core = PS["Data.Argonaut.Core"];
|
|
var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var Data_MediaType_Common = PS["Data.MediaType.Common"];
|
|
var Foreign = PS["Foreign"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_File_Blob = PS["Web.File.Blob"];
|
|
var ResponseFormatError = (function () {
|
|
function ResponseFormatError(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
ResponseFormatError.create = function (value0) {
|
|
return function (value1) {
|
|
return new ResponseFormatError(value0, value1);
|
|
};
|
|
};
|
|
return ResponseFormatError;
|
|
})();
|
|
var $$ArrayBuffer = (function () {
|
|
function $$ArrayBuffer(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
$$ArrayBuffer.create = function (value0) {
|
|
return new $$ArrayBuffer(value0);
|
|
};
|
|
return $$ArrayBuffer;
|
|
})();
|
|
var Blob = (function () {
|
|
function Blob(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Blob.create = function (value0) {
|
|
return new Blob(value0);
|
|
};
|
|
return Blob;
|
|
})();
|
|
var Document = (function () {
|
|
function Document(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Document.create = function (value0) {
|
|
return new Document(value0);
|
|
};
|
|
return Document;
|
|
})();
|
|
var Json = (function () {
|
|
function Json(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Json.create = function (value0) {
|
|
return new Json(value0);
|
|
};
|
|
return Json;
|
|
})();
|
|
var $$String = (function () {
|
|
function $$String(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
$$String.create = function (value0) {
|
|
return new $$String(value0);
|
|
};
|
|
return $$String;
|
|
})();
|
|
var Ignore = (function () {
|
|
function Ignore(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Ignore.create = function (value0) {
|
|
return new Ignore(value0);
|
|
};
|
|
return Ignore;
|
|
})();
|
|
var toResponseType = function (v) {
|
|
if (v instanceof $$ArrayBuffer) {
|
|
return "arraybuffer";
|
|
};
|
|
if (v instanceof Blob) {
|
|
return "blob";
|
|
};
|
|
if (v instanceof Document) {
|
|
return "document";
|
|
};
|
|
if (v instanceof Json) {
|
|
return "text";
|
|
};
|
|
if (v instanceof $$String) {
|
|
return "text";
|
|
};
|
|
if (v instanceof Ignore) {
|
|
return "";
|
|
};
|
|
throw new Error("Failed pattern match at Affjax.ResponseFormat (line 46, column 3 - line 54, column 1): " + [ v.constructor.name ]);
|
|
};
|
|
var toMediaType = function (v) {
|
|
if (v instanceof Json) {
|
|
return new Data_Maybe.Just(Data_MediaType_Common.applicationJSON);
|
|
};
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
var json = new Json(Control_Category.identity(Control_Category.categoryFn));
|
|
var ignore = new Ignore(Control_Category.identity(Control_Category.categoryFn));
|
|
exports["ArrayBuffer"] = $$ArrayBuffer;
|
|
exports["Blob"] = Blob;
|
|
exports["Document"] = Document;
|
|
exports["Json"] = Json;
|
|
exports["String"] = $$String;
|
|
exports["Ignore"] = Ignore;
|
|
exports["json"] = json;
|
|
exports["ignore"] = ignore;
|
|
exports["toResponseType"] = toResponseType;
|
|
exports["toMediaType"] = toMediaType;
|
|
exports["ResponseFormatError"] = ResponseFormatError;
|
|
})(PS["Affjax.ResponseFormat"] = PS["Affjax.ResponseFormat"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Prelude = PS["Prelude"];
|
|
var ResponseHeader = (function () {
|
|
function ResponseHeader(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
ResponseHeader.create = function (value0) {
|
|
return function (value1) {
|
|
return new ResponseHeader(value0, value1);
|
|
};
|
|
};
|
|
return ResponseHeader;
|
|
})();
|
|
var responseHeader = function (field) {
|
|
return function (value) {
|
|
return new ResponseHeader(field, value);
|
|
};
|
|
};
|
|
exports["responseHeader"] = responseHeader;
|
|
})(PS["Affjax.ResponseHeader"] = PS["Affjax.ResponseHeader"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Cont_Trans = PS["Control.Monad.Cont.Trans"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Monad_Maybe_Trans = PS["Control.Monad.Maybe.Trans"];
|
|
var Control_Monad_Reader_Trans = PS["Control.Monad.Reader.Trans"];
|
|
var Control_Monad_Writer_Trans = PS["Control.Monad.Writer.Trans"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Compose = PS["Data.Functor.Compose"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Prelude = PS["Prelude"];
|
|
var Parallel = function (Applicative1, Monad0, parallel, sequential) {
|
|
this.Applicative1 = Applicative1;
|
|
this.Monad0 = Monad0;
|
|
this.parallel = parallel;
|
|
this.sequential = sequential;
|
|
};
|
|
var sequential = function (dict) {
|
|
return dict.sequential;
|
|
};
|
|
var parallel = function (dict) {
|
|
return dict.parallel;
|
|
};
|
|
exports["parallel"] = parallel;
|
|
exports["sequential"] = sequential;
|
|
exports["Parallel"] = Parallel;
|
|
})(PS["Control.Parallel.Class"] = PS["Control.Parallel.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Parallel_Class = PS["Control.Parallel.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Prelude = PS["Prelude"];
|
|
var parTraverse_ = function (dictParallel) {
|
|
return function (dictFoldable) {
|
|
return function (f) {
|
|
return function ($17) {
|
|
return Control_Parallel_Class.sequential(dictParallel)(Data_Foldable.traverse_(dictParallel.Applicative1())(dictFoldable)(function ($18) {
|
|
return Control_Parallel_Class.parallel(dictParallel)(f($18));
|
|
})($17));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var parSequence_ = function (dictParallel) {
|
|
return function (dictFoldable) {
|
|
return parTraverse_(dictParallel)(dictFoldable)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
};
|
|
exports["parTraverse_"] = parTraverse_;
|
|
exports["parSequence_"] = parSequence_;
|
|
})(PS["Control.Parallel"] = PS["Control.Parallel"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports._jsonParser = function (fail, succ, s) {
|
|
try {
|
|
return succ(JSON.parse(s));
|
|
}
|
|
catch (e) {
|
|
return fail(e.message);
|
|
}
|
|
};
|
|
})(PS["Data.Argonaut.Parser"] = PS["Data.Argonaut.Parser"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Argonaut.Parser"];
|
|
var Data_Argonaut_Core = PS["Data.Argonaut.Core"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var jsonParser = function (j) {
|
|
return $foreign["_jsonParser"](Data_Either.Left.create, Data_Either.Right.create, j);
|
|
};
|
|
exports["jsonParser"] = jsonParser;
|
|
})(PS["Data.Argonaut.Parser"] = PS["Data.Argonaut.Parser"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Prelude = PS["Prelude"];
|
|
var OPTIONS = (function () {
|
|
function OPTIONS() {
|
|
|
|
};
|
|
OPTIONS.value = new OPTIONS();
|
|
return OPTIONS;
|
|
})();
|
|
var GET = (function () {
|
|
function GET() {
|
|
|
|
};
|
|
GET.value = new GET();
|
|
return GET;
|
|
})();
|
|
var HEAD = (function () {
|
|
function HEAD() {
|
|
|
|
};
|
|
HEAD.value = new HEAD();
|
|
return HEAD;
|
|
})();
|
|
var POST = (function () {
|
|
function POST() {
|
|
|
|
};
|
|
POST.value = new POST();
|
|
return POST;
|
|
})();
|
|
var PUT = (function () {
|
|
function PUT() {
|
|
|
|
};
|
|
PUT.value = new PUT();
|
|
return PUT;
|
|
})();
|
|
var DELETE = (function () {
|
|
function DELETE() {
|
|
|
|
};
|
|
DELETE.value = new DELETE();
|
|
return DELETE;
|
|
})();
|
|
var TRACE = (function () {
|
|
function TRACE() {
|
|
|
|
};
|
|
TRACE.value = new TRACE();
|
|
return TRACE;
|
|
})();
|
|
var CONNECT = (function () {
|
|
function CONNECT() {
|
|
|
|
};
|
|
CONNECT.value = new CONNECT();
|
|
return CONNECT;
|
|
})();
|
|
var PROPFIND = (function () {
|
|
function PROPFIND() {
|
|
|
|
};
|
|
PROPFIND.value = new PROPFIND();
|
|
return PROPFIND;
|
|
})();
|
|
var PROPPATCH = (function () {
|
|
function PROPPATCH() {
|
|
|
|
};
|
|
PROPPATCH.value = new PROPPATCH();
|
|
return PROPPATCH;
|
|
})();
|
|
var MKCOL = (function () {
|
|
function MKCOL() {
|
|
|
|
};
|
|
MKCOL.value = new MKCOL();
|
|
return MKCOL;
|
|
})();
|
|
var COPY = (function () {
|
|
function COPY() {
|
|
|
|
};
|
|
COPY.value = new COPY();
|
|
return COPY;
|
|
})();
|
|
var MOVE = (function () {
|
|
function MOVE() {
|
|
|
|
};
|
|
MOVE.value = new MOVE();
|
|
return MOVE;
|
|
})();
|
|
var LOCK = (function () {
|
|
function LOCK() {
|
|
|
|
};
|
|
LOCK.value = new LOCK();
|
|
return LOCK;
|
|
})();
|
|
var UNLOCK = (function () {
|
|
function UNLOCK() {
|
|
|
|
};
|
|
UNLOCK.value = new UNLOCK();
|
|
return UNLOCK;
|
|
})();
|
|
var PATCH = (function () {
|
|
function PATCH() {
|
|
|
|
};
|
|
PATCH.value = new PATCH();
|
|
return PATCH;
|
|
})();
|
|
var unCustomMethod = function (v) {
|
|
return v;
|
|
};
|
|
var showMethod = new Data_Show.Show(function (v) {
|
|
if (v instanceof OPTIONS) {
|
|
return "OPTIONS";
|
|
};
|
|
if (v instanceof GET) {
|
|
return "GET";
|
|
};
|
|
if (v instanceof HEAD) {
|
|
return "HEAD";
|
|
};
|
|
if (v instanceof POST) {
|
|
return "POST";
|
|
};
|
|
if (v instanceof PUT) {
|
|
return "PUT";
|
|
};
|
|
if (v instanceof DELETE) {
|
|
return "DELETE";
|
|
};
|
|
if (v instanceof TRACE) {
|
|
return "TRACE";
|
|
};
|
|
if (v instanceof CONNECT) {
|
|
return "CONNECT";
|
|
};
|
|
if (v instanceof PROPFIND) {
|
|
return "PROPFIND";
|
|
};
|
|
if (v instanceof PROPPATCH) {
|
|
return "PROPPATCH";
|
|
};
|
|
if (v instanceof MKCOL) {
|
|
return "MKCOL";
|
|
};
|
|
if (v instanceof COPY) {
|
|
return "COPY";
|
|
};
|
|
if (v instanceof MOVE) {
|
|
return "MOVE";
|
|
};
|
|
if (v instanceof LOCK) {
|
|
return "LOCK";
|
|
};
|
|
if (v instanceof UNLOCK) {
|
|
return "UNLOCK";
|
|
};
|
|
if (v instanceof PATCH) {
|
|
return "PATCH";
|
|
};
|
|
throw new Error("Failed pattern match at Data.HTTP.Method (line 40, column 1 - line 40, column 35): " + [ v.constructor.name ]);
|
|
});
|
|
var print = Data_Either.either(Data_Show.show(showMethod))(unCustomMethod);
|
|
exports["OPTIONS"] = OPTIONS;
|
|
exports["GET"] = GET;
|
|
exports["HEAD"] = HEAD;
|
|
exports["POST"] = POST;
|
|
exports["PUT"] = PUT;
|
|
exports["DELETE"] = DELETE;
|
|
exports["TRACE"] = TRACE;
|
|
exports["CONNECT"] = CONNECT;
|
|
exports["PROPFIND"] = PROPFIND;
|
|
exports["PROPPATCH"] = PROPPATCH;
|
|
exports["MKCOL"] = MKCOL;
|
|
exports["COPY"] = COPY;
|
|
exports["MOVE"] = MOVE;
|
|
exports["LOCK"] = LOCK;
|
|
exports["UNLOCK"] = UNLOCK;
|
|
exports["PATCH"] = PATCH;
|
|
exports["unCustomMethod"] = unCustomMethod;
|
|
exports["print"] = print;
|
|
exports["showMethod"] = showMethod;
|
|
})(PS["Data.HTTP.Method"] = PS["Data.HTTP.Method"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports["null"] = null;
|
|
|
|
exports.nullable = function (a, r, f) {
|
|
return a == null ? r : f(a);
|
|
};
|
|
|
|
exports.notNull = function (x) {
|
|
return x;
|
|
};
|
|
})(PS["Data.Nullable"] = PS["Data.Nullable"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Nullable"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Prelude = PS["Prelude"];
|
|
var toNullable = Data_Maybe.maybe($foreign["null"])($foreign.notNull);
|
|
var toMaybe = function (n) {
|
|
return $foreign.nullable(n, Data_Maybe.Nothing.value, Data_Maybe.Just.create);
|
|
};
|
|
exports["toMaybe"] = toMaybe;
|
|
exports["toNullable"] = toNullable;
|
|
})(PS["Data.Nullable"] = PS["Data.Nullable"] || {});
|
|
(function(exports) {
|
|
/* globals setImmediate, clearImmediate, setTimeout, clearTimeout */
|
|
/* jshint -W083, -W098, -W003 */
|
|
"use strict";
|
|
|
|
var Aff = function () {
|
|
// A unique value for empty.
|
|
var EMPTY = {};
|
|
|
|
/*
|
|
|
|
An awkward approximation. We elide evidence we would otherwise need in PS for
|
|
efficiency sake.
|
|
|
|
data Aff eff a
|
|
= Pure a
|
|
| Throw Error
|
|
| Catch (Aff eff a) (Error -> Aff eff a)
|
|
| Sync (Eff eff a)
|
|
| Async ((Either Error a -> Eff eff Unit) -> Eff eff (Canceler eff))
|
|
| forall b. Bind (Aff eff b) (b -> Aff eff a)
|
|
| forall b. Bracket (Aff eff b) (BracketConditions eff b) (b -> Aff eff a)
|
|
| forall b. Fork Boolean (Aff eff b) ?(Fiber eff b -> a)
|
|
| Sequential (ParAff aff a)
|
|
|
|
*/
|
|
var PURE = "Pure";
|
|
var THROW = "Throw";
|
|
var CATCH = "Catch";
|
|
var SYNC = "Sync";
|
|
var ASYNC = "Async";
|
|
var BIND = "Bind";
|
|
var BRACKET = "Bracket";
|
|
var FORK = "Fork";
|
|
var SEQ = "Sequential";
|
|
|
|
/*
|
|
|
|
data ParAff eff a
|
|
= forall b. Map (b -> a) (ParAff eff b)
|
|
| forall b. Apply (ParAff eff (b -> a)) (ParAff eff b)
|
|
| Alt (ParAff eff a) (ParAff eff a)
|
|
| ?Par (Aff eff a)
|
|
|
|
*/
|
|
var MAP = "Map";
|
|
var APPLY = "Apply";
|
|
var ALT = "Alt";
|
|
|
|
// Various constructors used in interpretation
|
|
var CONS = "Cons"; // Cons-list, for stacks
|
|
var RESUME = "Resume"; // Continue indiscriminately
|
|
var RELEASE = "Release"; // Continue with bracket finalizers
|
|
var FINALIZER = "Finalizer"; // A non-interruptible effect
|
|
var FINALIZED = "Finalized"; // Marker for finalization
|
|
var FORKED = "Forked"; // Reference to a forked fiber, with resumption stack
|
|
var FIBER = "Fiber"; // Actual fiber reference
|
|
var THUNK = "Thunk"; // Primed effect, ready to invoke
|
|
|
|
function Aff(tag, _1, _2, _3) {
|
|
this.tag = tag;
|
|
this._1 = _1;
|
|
this._2 = _2;
|
|
this._3 = _3;
|
|
}
|
|
|
|
function AffCtr(tag) {
|
|
var fn = function (_1, _2, _3) {
|
|
return new Aff(tag, _1, _2, _3);
|
|
};
|
|
fn.tag = tag;
|
|
return fn;
|
|
}
|
|
|
|
function nonCanceler(error) {
|
|
return new Aff(PURE, void 0);
|
|
}
|
|
|
|
function runEff(eff) {
|
|
try {
|
|
eff();
|
|
} catch (error) {
|
|
setTimeout(function () {
|
|
throw error;
|
|
}, 0);
|
|
}
|
|
}
|
|
|
|
function runSync(left, right, eff) {
|
|
try {
|
|
return right(eff());
|
|
} catch (error) {
|
|
return left(error);
|
|
}
|
|
}
|
|
|
|
function runAsync(left, eff, k) {
|
|
try {
|
|
return eff(k)();
|
|
} catch (error) {
|
|
k(left(error))();
|
|
return nonCanceler;
|
|
}
|
|
}
|
|
|
|
var Scheduler = function () {
|
|
var limit = 1024;
|
|
var size = 0;
|
|
var ix = 0;
|
|
var queue = new Array(limit);
|
|
var draining = false;
|
|
|
|
function drain() {
|
|
var thunk;
|
|
draining = true;
|
|
while (size !== 0) {
|
|
size--;
|
|
thunk = queue[ix];
|
|
queue[ix] = void 0;
|
|
ix = (ix + 1) % limit;
|
|
thunk();
|
|
}
|
|
draining = false;
|
|
}
|
|
|
|
return {
|
|
isDraining: function () {
|
|
return draining;
|
|
},
|
|
enqueue: function (cb) {
|
|
var i, tmp;
|
|
if (size === limit) {
|
|
tmp = draining;
|
|
drain();
|
|
draining = tmp;
|
|
}
|
|
|
|
queue[(ix + size) % limit] = cb;
|
|
size++;
|
|
|
|
if (!draining) {
|
|
drain();
|
|
}
|
|
}
|
|
};
|
|
}();
|
|
|
|
function Supervisor(util) {
|
|
var fibers = {};
|
|
var fiberId = 0;
|
|
var count = 0;
|
|
|
|
return {
|
|
register: function (fiber) {
|
|
var fid = fiberId++;
|
|
fiber.onComplete({
|
|
rethrow: true,
|
|
handler: function (result) {
|
|
return function () {
|
|
count--;
|
|
delete fibers[fid];
|
|
};
|
|
}
|
|
});
|
|
fibers[fid] = fiber;
|
|
count++;
|
|
},
|
|
isEmpty: function () {
|
|
return count === 0;
|
|
},
|
|
killAll: function (killError, cb) {
|
|
return function () {
|
|
var killCount = 0;
|
|
var kills = {};
|
|
|
|
function kill(fid) {
|
|
kills[fid] = fibers[fid].kill(killError, function (result) {
|
|
return function () {
|
|
delete kills[fid];
|
|
killCount--;
|
|
if (util.isLeft(result) && util.fromLeft(result)) {
|
|
setTimeout(function () {
|
|
throw util.fromLeft(result);
|
|
}, 0);
|
|
}
|
|
if (killCount === 0) {
|
|
cb();
|
|
}
|
|
};
|
|
})();
|
|
}
|
|
|
|
for (var k in fibers) {
|
|
if (fibers.hasOwnProperty(k)) {
|
|
killCount++;
|
|
kill(k);
|
|
}
|
|
}
|
|
|
|
fibers = {};
|
|
fiberId = 0;
|
|
count = 0;
|
|
|
|
return function (error) {
|
|
return new Aff(SYNC, function () {
|
|
for (var k in kills) {
|
|
if (kills.hasOwnProperty(k)) {
|
|
kills[k]();
|
|
}
|
|
}
|
|
});
|
|
};
|
|
};
|
|
}
|
|
};
|
|
}
|
|
|
|
// Fiber state machine
|
|
var SUSPENDED = 0; // Suspended, pending a join.
|
|
var CONTINUE = 1; // Interpret the next instruction.
|
|
var STEP_BIND = 2; // Apply the next bind.
|
|
var STEP_RESULT = 3; // Handle potential failure from a result.
|
|
var PENDING = 4; // An async effect is running.
|
|
var RETURN = 5; // The current stack has returned.
|
|
var COMPLETED = 6; // The entire fiber has completed.
|
|
|
|
function Fiber(util, supervisor, aff) {
|
|
// Monotonically increasing tick, increased on each asynchronous turn.
|
|
var runTick = 0;
|
|
|
|
// The current branch of the state machine.
|
|
var status = SUSPENDED;
|
|
|
|
// The current point of interest for the state machine branch.
|
|
var step = aff; // Successful step
|
|
var fail = null; // Failure step
|
|
var interrupt = null; // Asynchronous interrupt
|
|
|
|
// Stack of continuations for the current fiber.
|
|
var bhead = null;
|
|
var btail = null;
|
|
|
|
// Stack of attempts and finalizers for error recovery. Every `Cons` is also
|
|
// tagged with current `interrupt` state. We use this to track which items
|
|
// should be ignored or evaluated as a result of a kill.
|
|
var attempts = null;
|
|
|
|
// A special state is needed for Bracket, because it cannot be killed. When
|
|
// we enter a bracket acquisition or finalizer, we increment the counter,
|
|
// and then decrement once complete.
|
|
var bracketCount = 0;
|
|
|
|
// Each join gets a new id so they can be revoked.
|
|
var joinId = 0;
|
|
var joins = null;
|
|
var rethrow = true;
|
|
|
|
// Each invocation of `run` requires a tick. When an asynchronous effect is
|
|
// resolved, we must check that the local tick coincides with the fiber
|
|
// tick before resuming. This prevents multiple async continuations from
|
|
// accidentally resuming the same fiber. A common example may be invoking
|
|
// the provided callback in `makeAff` more than once, but it may also be an
|
|
// async effect resuming after the fiber was already cancelled.
|
|
function run(localRunTick) {
|
|
var tmp, result, attempt;
|
|
while (true) {
|
|
tmp = null;
|
|
result = null;
|
|
attempt = null;
|
|
|
|
switch (status) {
|
|
case STEP_BIND:
|
|
status = CONTINUE;
|
|
step = bhead(step);
|
|
if (btail === null) {
|
|
bhead = null;
|
|
} else {
|
|
bhead = btail._1;
|
|
btail = btail._2;
|
|
}
|
|
break;
|
|
|
|
case STEP_RESULT:
|
|
if (util.isLeft(step)) {
|
|
status = RETURN;
|
|
fail = step;
|
|
step = null;
|
|
} else if (bhead === null) {
|
|
status = RETURN;
|
|
} else {
|
|
status = STEP_BIND;
|
|
step = util.fromRight(step);
|
|
}
|
|
break;
|
|
|
|
case CONTINUE:
|
|
switch (step.tag) {
|
|
case BIND:
|
|
if (bhead) {
|
|
btail = new Aff(CONS, bhead, btail);
|
|
}
|
|
bhead = step._2;
|
|
status = CONTINUE;
|
|
step = step._1;
|
|
break;
|
|
|
|
case PURE:
|
|
if (bhead === null) {
|
|
status = RETURN;
|
|
step = util.right(step._1);
|
|
} else {
|
|
status = STEP_BIND;
|
|
step = step._1;
|
|
}
|
|
break;
|
|
|
|
case SYNC:
|
|
status = STEP_RESULT;
|
|
step = runSync(util.left, util.right, step._1);
|
|
break;
|
|
|
|
case ASYNC:
|
|
status = PENDING;
|
|
step = runAsync(util.left, step._1, function (result) {
|
|
return function () {
|
|
if (runTick !== localRunTick) {
|
|
return;
|
|
}
|
|
runTick++;
|
|
Scheduler.enqueue(function () {
|
|
// It's possible to interrupt the fiber between enqueuing and
|
|
// resuming, so we need to check that the runTick is still
|
|
// valid.
|
|
if (runTick !== localRunTick + 1) {
|
|
return;
|
|
}
|
|
status = STEP_RESULT;
|
|
step = result;
|
|
run(runTick);
|
|
});
|
|
};
|
|
});
|
|
return;
|
|
|
|
case THROW:
|
|
status = RETURN;
|
|
fail = util.left(step._1);
|
|
step = null;
|
|
break;
|
|
|
|
// Enqueue the Catch so that we can call the error handler later on
|
|
// in case of an exception.
|
|
case CATCH:
|
|
if (bhead === null) {
|
|
attempts = new Aff(CONS, step, attempts, interrupt);
|
|
} else {
|
|
attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);
|
|
}
|
|
bhead = null;
|
|
btail = null;
|
|
status = CONTINUE;
|
|
step = step._1;
|
|
break;
|
|
|
|
// Enqueue the Bracket so that we can call the appropriate handlers
|
|
// after resource acquisition.
|
|
case BRACKET:
|
|
bracketCount++;
|
|
if (bhead === null) {
|
|
attempts = new Aff(CONS, step, attempts, interrupt);
|
|
} else {
|
|
attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);
|
|
}
|
|
bhead = null;
|
|
btail = null;
|
|
status = CONTINUE;
|
|
step = step._1;
|
|
break;
|
|
|
|
case FORK:
|
|
status = STEP_RESULT;
|
|
tmp = Fiber(util, supervisor, step._2);
|
|
if (supervisor) {
|
|
supervisor.register(tmp);
|
|
}
|
|
if (step._1) {
|
|
tmp.run();
|
|
}
|
|
step = util.right(tmp);
|
|
break;
|
|
|
|
case SEQ:
|
|
status = CONTINUE;
|
|
step = sequential(util, supervisor, step._1);
|
|
break;
|
|
}
|
|
break;
|
|
|
|
case RETURN:
|
|
bhead = null;
|
|
btail = null;
|
|
// If the current stack has returned, and we have no other stacks to
|
|
// resume or finalizers to run, the fiber has halted and we can
|
|
// invoke all join callbacks. Otherwise we need to resume.
|
|
if (attempts === null) {
|
|
status = COMPLETED;
|
|
step = interrupt || fail || step;
|
|
} else {
|
|
// The interrupt status for the enqueued item.
|
|
tmp = attempts._3;
|
|
attempt = attempts._1;
|
|
attempts = attempts._2;
|
|
|
|
switch (attempt.tag) {
|
|
// We cannot recover from an interrupt. Otherwise we should
|
|
// continue stepping, or run the exception handler if an exception
|
|
// was raised.
|
|
case CATCH:
|
|
// We should compare the interrupt status as well because we
|
|
// only want it to apply if there has been an interrupt since
|
|
// enqueuing the catch.
|
|
if (interrupt && interrupt !== tmp) {
|
|
status = RETURN;
|
|
} else if (fail) {
|
|
status = CONTINUE;
|
|
step = attempt._2(util.fromLeft(fail));
|
|
fail = null;
|
|
}
|
|
break;
|
|
|
|
// We cannot resume from an interrupt or exception.
|
|
case RESUME:
|
|
// As with Catch, we only want to ignore in the case of an
|
|
// interrupt since enqueing the item.
|
|
if (interrupt && interrupt !== tmp || fail) {
|
|
status = RETURN;
|
|
} else {
|
|
bhead = attempt._1;
|
|
btail = attempt._2;
|
|
status = STEP_BIND;
|
|
step = util.fromRight(step);
|
|
}
|
|
break;
|
|
|
|
// If we have a bracket, we should enqueue the handlers,
|
|
// and continue with the success branch only if the fiber has
|
|
// not been interrupted. If the bracket acquisition failed, we
|
|
// should not run either.
|
|
case BRACKET:
|
|
bracketCount--;
|
|
if (fail === null) {
|
|
result = util.fromRight(step);
|
|
// We need to enqueue the Release with the same interrupt
|
|
// status as the Bracket that is initiating it.
|
|
attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);
|
|
// We should only coninue as long as the interrupt status has not changed or
|
|
// we are currently within a non-interruptable finalizer.
|
|
if (interrupt === tmp || bracketCount > 0) {
|
|
status = CONTINUE;
|
|
step = attempt._3(result);
|
|
}
|
|
}
|
|
break;
|
|
|
|
// Enqueue the appropriate handler. We increase the bracket count
|
|
// because it should not be cancelled.
|
|
case RELEASE:
|
|
bracketCount++;
|
|
attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);
|
|
status = CONTINUE;
|
|
// It has only been killed if the interrupt status has changed
|
|
// since we enqueued the item.
|
|
if (interrupt && interrupt !== tmp) {
|
|
step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);
|
|
} else if (fail) {
|
|
step = attempt._1.failed(util.fromLeft(fail))(attempt._2);
|
|
} else {
|
|
step = attempt._1.completed(util.fromRight(step))(attempt._2);
|
|
}
|
|
fail = null;
|
|
break;
|
|
|
|
case FINALIZER:
|
|
bracketCount++;
|
|
attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);
|
|
status = CONTINUE;
|
|
step = attempt._1;
|
|
break;
|
|
|
|
case FINALIZED:
|
|
bracketCount--;
|
|
status = RETURN;
|
|
step = attempt._1;
|
|
fail = attempt._2;
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
|
|
case COMPLETED:
|
|
for (var k in joins) {
|
|
if (joins.hasOwnProperty(k)) {
|
|
rethrow = rethrow && joins[k].rethrow;
|
|
runEff(joins[k].handler(step));
|
|
}
|
|
}
|
|
joins = null;
|
|
// If we have an interrupt and a fail, then the thread threw while
|
|
// running finalizers. This should always rethrow in a fresh stack.
|
|
if (interrupt && fail) {
|
|
setTimeout(function () {
|
|
throw util.fromLeft(fail);
|
|
}, 0);
|
|
// If we have an unhandled exception, and no other fiber has joined
|
|
// then we need to throw the exception in a fresh stack.
|
|
} else if (util.isLeft(step) && rethrow) {
|
|
setTimeout(function () {
|
|
// Guard on reathrow because a completely synchronous fiber can
|
|
// still have an observer which was added after-the-fact.
|
|
if (rethrow) {
|
|
throw util.fromLeft(step);
|
|
}
|
|
}, 0);
|
|
}
|
|
return;
|
|
case SUSPENDED:
|
|
status = CONTINUE;
|
|
break;
|
|
case PENDING: return;
|
|
}
|
|
}
|
|
}
|
|
|
|
function onComplete(join) {
|
|
return function () {
|
|
if (status === COMPLETED) {
|
|
rethrow = rethrow && join.rethrow;
|
|
join.handler(step)();
|
|
return function () {};
|
|
}
|
|
|
|
var jid = joinId++;
|
|
joins = joins || {};
|
|
joins[jid] = join;
|
|
|
|
return function() {
|
|
if (joins !== null) {
|
|
delete joins[jid];
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
function kill(error, cb) {
|
|
return function () {
|
|
if (status === COMPLETED) {
|
|
cb(util.right(void 0))();
|
|
return function () {};
|
|
}
|
|
|
|
var canceler = onComplete({
|
|
rethrow: false,
|
|
handler: function (/* unused */) {
|
|
return cb(util.right(void 0));
|
|
}
|
|
})();
|
|
|
|
switch (status) {
|
|
case SUSPENDED:
|
|
interrupt = util.left(error);
|
|
status = COMPLETED;
|
|
step = interrupt;
|
|
run(runTick);
|
|
break;
|
|
case PENDING:
|
|
if (interrupt === null) {
|
|
interrupt = util.left(error);
|
|
}
|
|
if (bracketCount === 0) {
|
|
if (status === PENDING) {
|
|
attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);
|
|
}
|
|
status = RETURN;
|
|
step = null;
|
|
fail = null;
|
|
run(++runTick);
|
|
}
|
|
break;
|
|
default:
|
|
if (interrupt === null) {
|
|
interrupt = util.left(error);
|
|
}
|
|
if (bracketCount === 0) {
|
|
status = RETURN;
|
|
step = null;
|
|
fail = null;
|
|
}
|
|
}
|
|
|
|
return canceler;
|
|
};
|
|
}
|
|
|
|
function join(cb) {
|
|
return function () {
|
|
var canceler = onComplete({
|
|
rethrow: false,
|
|
handler: cb
|
|
})();
|
|
if (status === SUSPENDED) {
|
|
run(runTick);
|
|
}
|
|
return canceler;
|
|
};
|
|
}
|
|
|
|
return {
|
|
kill: kill,
|
|
join: join,
|
|
onComplete: onComplete,
|
|
isSuspended: function () {
|
|
return status === SUSPENDED;
|
|
},
|
|
run: function () {
|
|
if (status === SUSPENDED) {
|
|
if (!Scheduler.isDraining()) {
|
|
Scheduler.enqueue(function () {
|
|
run(runTick);
|
|
});
|
|
} else {
|
|
run(runTick);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
function runPar(util, supervisor, par, cb) {
|
|
// Table of all forked fibers.
|
|
var fiberId = 0;
|
|
var fibers = {};
|
|
|
|
// Table of currently running cancelers, as a product of `Alt` behavior.
|
|
var killId = 0;
|
|
var kills = {};
|
|
|
|
// Error used for early cancelation on Alt branches.
|
|
var early = new Error("[ParAff] Early exit");
|
|
|
|
// Error used to kill the entire tree.
|
|
var interrupt = null;
|
|
|
|
// The root pointer of the tree.
|
|
var root = EMPTY;
|
|
|
|
// Walks a tree, invoking all the cancelers. Returns the table of pending
|
|
// cancellation fibers.
|
|
function kill(error, par, cb) {
|
|
var step = par;
|
|
var head = null;
|
|
var tail = null;
|
|
var count = 0;
|
|
var kills = {};
|
|
var tmp, kid;
|
|
|
|
loop: while (true) {
|
|
tmp = null;
|
|
|
|
switch (step.tag) {
|
|
case FORKED:
|
|
if (step._3 === EMPTY) {
|
|
tmp = fibers[step._1];
|
|
kills[count++] = tmp.kill(error, function (result) {
|
|
return function () {
|
|
count--;
|
|
if (count === 0) {
|
|
cb(result)();
|
|
}
|
|
};
|
|
});
|
|
}
|
|
// Terminal case.
|
|
if (head === null) {
|
|
break loop;
|
|
}
|
|
// Go down the right side of the tree.
|
|
step = head._2;
|
|
if (tail === null) {
|
|
head = null;
|
|
} else {
|
|
head = tail._1;
|
|
tail = tail._2;
|
|
}
|
|
break;
|
|
case MAP:
|
|
step = step._2;
|
|
break;
|
|
case APPLY:
|
|
case ALT:
|
|
if (head) {
|
|
tail = new Aff(CONS, head, tail);
|
|
}
|
|
head = step;
|
|
step = step._1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (count === 0) {
|
|
cb(util.right(void 0))();
|
|
} else {
|
|
// Run the cancelation effects. We alias `count` because it's mutable.
|
|
kid = 0;
|
|
tmp = count;
|
|
for (; kid < tmp; kid++) {
|
|
kills[kid] = kills[kid]();
|
|
}
|
|
}
|
|
|
|
return kills;
|
|
}
|
|
|
|
// When a fiber resolves, we need to bubble back up the tree with the
|
|
// result, computing the applicative nodes.
|
|
function join(result, head, tail) {
|
|
var fail, step, lhs, rhs, tmp, kid;
|
|
|
|
if (util.isLeft(result)) {
|
|
fail = result;
|
|
step = null;
|
|
} else {
|
|
step = result;
|
|
fail = null;
|
|
}
|
|
|
|
loop: while (true) {
|
|
lhs = null;
|
|
rhs = null;
|
|
tmp = null;
|
|
kid = null;
|
|
|
|
// We should never continue if the entire tree has been interrupted.
|
|
if (interrupt !== null) {
|
|
return;
|
|
}
|
|
|
|
// We've made it all the way to the root of the tree, which means
|
|
// the tree has fully evaluated.
|
|
if (head === null) {
|
|
cb(fail || step)();
|
|
return;
|
|
}
|
|
|
|
// The tree has already been computed, so we shouldn't try to do it
|
|
// again. This should never happen.
|
|
// TODO: Remove this?
|
|
if (head._3 !== EMPTY) {
|
|
return;
|
|
}
|
|
|
|
switch (head.tag) {
|
|
case MAP:
|
|
if (fail === null) {
|
|
head._3 = util.right(head._1(util.fromRight(step)));
|
|
step = head._3;
|
|
} else {
|
|
head._3 = fail;
|
|
}
|
|
break;
|
|
case APPLY:
|
|
lhs = head._1._3;
|
|
rhs = head._2._3;
|
|
// If we have a failure we should kill the other side because we
|
|
// can't possible yield a result anymore.
|
|
if (fail) {
|
|
head._3 = fail;
|
|
tmp = true;
|
|
kid = killId++;
|
|
|
|
kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {
|
|
return function () {
|
|
delete kills[kid];
|
|
if (tmp) {
|
|
tmp = false;
|
|
} else if (tail === null) {
|
|
join(fail, null, null);
|
|
} else {
|
|
join(fail, tail._1, tail._2);
|
|
}
|
|
};
|
|
});
|
|
|
|
if (tmp) {
|
|
tmp = false;
|
|
return;
|
|
}
|
|
} else if (lhs === EMPTY || rhs === EMPTY) {
|
|
// We can only proceed if both sides have resolved.
|
|
return;
|
|
} else {
|
|
step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));
|
|
head._3 = step;
|
|
}
|
|
break;
|
|
case ALT:
|
|
lhs = head._1._3;
|
|
rhs = head._2._3;
|
|
// We can only proceed if both have resolved or we have a success
|
|
if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {
|
|
return;
|
|
}
|
|
// If both sides resolve with an error, we should continue with the
|
|
// first error
|
|
if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {
|
|
fail = step === lhs ? rhs : lhs;
|
|
step = null;
|
|
head._3 = fail;
|
|
} else {
|
|
head._3 = step;
|
|
tmp = true;
|
|
kid = killId++;
|
|
// Once a side has resolved, we need to cancel the side that is still
|
|
// pending before we can continue.
|
|
kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {
|
|
return function () {
|
|
delete kills[kid];
|
|
if (tmp) {
|
|
tmp = false;
|
|
} else if (tail === null) {
|
|
join(step, null, null);
|
|
} else {
|
|
join(step, tail._1, tail._2);
|
|
}
|
|
};
|
|
});
|
|
|
|
if (tmp) {
|
|
tmp = false;
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
if (tail === null) {
|
|
head = null;
|
|
} else {
|
|
head = tail._1;
|
|
tail = tail._2;
|
|
}
|
|
}
|
|
}
|
|
|
|
function resolve(fiber) {
|
|
return function (result) {
|
|
return function () {
|
|
delete fibers[fiber._1];
|
|
fiber._3 = result;
|
|
join(result, fiber._2._1, fiber._2._2);
|
|
};
|
|
};
|
|
}
|
|
|
|
// Walks the applicative tree, substituting non-applicative nodes with
|
|
// `FORKED` nodes. In this tree, all applicative nodes use the `_3` slot
|
|
// as a mutable slot for memoization. In an unresolved state, the `_3`
|
|
// slot is `EMPTY`. In the cases of `ALT` and `APPLY`, we always walk
|
|
// the left side first, because both operations are left-associative. As
|
|
// we `RETURN` from those branches, we then walk the right side.
|
|
function run() {
|
|
var status = CONTINUE;
|
|
var step = par;
|
|
var head = null;
|
|
var tail = null;
|
|
var tmp, fid;
|
|
|
|
loop: while (true) {
|
|
tmp = null;
|
|
fid = null;
|
|
|
|
switch (status) {
|
|
case CONTINUE:
|
|
switch (step.tag) {
|
|
case MAP:
|
|
if (head) {
|
|
tail = new Aff(CONS, head, tail);
|
|
}
|
|
head = new Aff(MAP, step._1, EMPTY, EMPTY);
|
|
step = step._2;
|
|
break;
|
|
case APPLY:
|
|
if (head) {
|
|
tail = new Aff(CONS, head, tail);
|
|
}
|
|
head = new Aff(APPLY, EMPTY, step._2, EMPTY);
|
|
step = step._1;
|
|
break;
|
|
case ALT:
|
|
if (head) {
|
|
tail = new Aff(CONS, head, tail);
|
|
}
|
|
head = new Aff(ALT, EMPTY, step._2, EMPTY);
|
|
step = step._1;
|
|
break;
|
|
default:
|
|
// When we hit a leaf value, we suspend the stack in the `FORKED`.
|
|
// When the fiber resolves, it can bubble back up the tree.
|
|
fid = fiberId++;
|
|
status = RETURN;
|
|
tmp = step;
|
|
step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);
|
|
tmp = Fiber(util, supervisor, tmp);
|
|
tmp.onComplete({
|
|
rethrow: false,
|
|
handler: resolve(step)
|
|
})();
|
|
fibers[fid] = tmp;
|
|
if (supervisor) {
|
|
supervisor.register(tmp);
|
|
}
|
|
}
|
|
break;
|
|
case RETURN:
|
|
// Terminal case, we are back at the root.
|
|
if (head === null) {
|
|
break loop;
|
|
}
|
|
// If we are done with the right side, we need to continue down the
|
|
// left. Otherwise we should continue up the stack.
|
|
if (head._1 === EMPTY) {
|
|
head._1 = step;
|
|
status = CONTINUE;
|
|
step = head._2;
|
|
head._2 = EMPTY;
|
|
} else {
|
|
head._2 = step;
|
|
step = head;
|
|
if (tail === null) {
|
|
head = null;
|
|
} else {
|
|
head = tail._1;
|
|
tail = tail._2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Keep a reference to the tree root so it can be cancelled.
|
|
root = step;
|
|
|
|
for (fid = 0; fid < fiberId; fid++) {
|
|
fibers[fid].run();
|
|
}
|
|
}
|
|
|
|
// Cancels the entire tree. If there are already subtrees being canceled,
|
|
// we need to first cancel those joins. We will then add fresh joins for
|
|
// all pending branches including those that were in the process of being
|
|
// canceled.
|
|
function cancel(error, cb) {
|
|
interrupt = util.left(error);
|
|
var innerKills;
|
|
for (var kid in kills) {
|
|
if (kills.hasOwnProperty(kid)) {
|
|
innerKills = kills[kid];
|
|
for (kid in innerKills) {
|
|
if (innerKills.hasOwnProperty(kid)) {
|
|
innerKills[kid]();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
kills = null;
|
|
var newKills = kill(error, root, cb);
|
|
|
|
return function (killError) {
|
|
return new Aff(ASYNC, function (killCb) {
|
|
return function () {
|
|
for (var kid in newKills) {
|
|
if (newKills.hasOwnProperty(kid)) {
|
|
newKills[kid]();
|
|
}
|
|
}
|
|
return nonCanceler;
|
|
};
|
|
});
|
|
};
|
|
}
|
|
|
|
run();
|
|
|
|
return function (killError) {
|
|
return new Aff(ASYNC, function (killCb) {
|
|
return function () {
|
|
return cancel(killError, killCb);
|
|
};
|
|
});
|
|
};
|
|
}
|
|
|
|
function sequential(util, supervisor, par) {
|
|
return new Aff(ASYNC, function (cb) {
|
|
return function () {
|
|
return runPar(util, supervisor, par, cb);
|
|
};
|
|
});
|
|
}
|
|
|
|
Aff.EMPTY = EMPTY;
|
|
Aff.Pure = AffCtr(PURE);
|
|
Aff.Throw = AffCtr(THROW);
|
|
Aff.Catch = AffCtr(CATCH);
|
|
Aff.Sync = AffCtr(SYNC);
|
|
Aff.Async = AffCtr(ASYNC);
|
|
Aff.Bind = AffCtr(BIND);
|
|
Aff.Bracket = AffCtr(BRACKET);
|
|
Aff.Fork = AffCtr(FORK);
|
|
Aff.Seq = AffCtr(SEQ);
|
|
Aff.ParMap = AffCtr(MAP);
|
|
Aff.ParApply = AffCtr(APPLY);
|
|
Aff.ParAlt = AffCtr(ALT);
|
|
Aff.Fiber = Fiber;
|
|
Aff.Supervisor = Supervisor;
|
|
Aff.Scheduler = Scheduler;
|
|
Aff.nonCanceler = nonCanceler;
|
|
|
|
return Aff;
|
|
}();
|
|
|
|
exports._pure = Aff.Pure;
|
|
|
|
exports._throwError = Aff.Throw;
|
|
|
|
exports._catchError = function (aff) {
|
|
return function (k) {
|
|
return Aff.Catch(aff, k);
|
|
};
|
|
};
|
|
|
|
exports._map = function (f) {
|
|
return function (aff) {
|
|
if (aff.tag === Aff.Pure.tag) {
|
|
return Aff.Pure(f(aff._1));
|
|
} else {
|
|
return Aff.Bind(aff, function (value) {
|
|
return Aff.Pure(f(value));
|
|
});
|
|
}
|
|
};
|
|
};
|
|
|
|
exports._bind = function (aff) {
|
|
return function (k) {
|
|
return Aff.Bind(aff, k);
|
|
};
|
|
};
|
|
|
|
exports._fork = function (immediate) {
|
|
return function (aff) {
|
|
return Aff.Fork(immediate, aff);
|
|
};
|
|
};
|
|
|
|
exports._liftEffect = Aff.Sync;
|
|
|
|
exports._parAffMap = function (f) {
|
|
return function (aff) {
|
|
return Aff.ParMap(f, aff);
|
|
};
|
|
};
|
|
|
|
exports._parAffApply = function (aff1) {
|
|
return function (aff2) {
|
|
return Aff.ParApply(aff1, aff2);
|
|
};
|
|
};
|
|
|
|
exports.makeAff = Aff.Async;
|
|
|
|
exports._makeFiber = function (util, aff) {
|
|
return function () {
|
|
return Aff.Fiber(util, null, aff);
|
|
};
|
|
};
|
|
|
|
exports._sequential = Aff.Seq;
|
|
})(PS["Effect.Aff"] = PS["Effect.Aff"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.error = function (msg) {
|
|
return new Error(msg);
|
|
};
|
|
|
|
exports.throwException = function (e) {
|
|
return function () {
|
|
throw e;
|
|
};
|
|
};
|
|
})(PS["Effect.Exception"] = PS["Effect.Exception"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.Exception"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var $$throw = function ($1) {
|
|
return $foreign.throwException($foreign.error($1));
|
|
};
|
|
exports["throw"] = $$throw;
|
|
exports["error"] = $foreign.error;
|
|
exports["throwException"] = $foreign.throwException;
|
|
})(PS["Effect.Exception"] = PS["Effect.Exception"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafePerformEffect = function (f) {
|
|
return f();
|
|
};
|
|
})(PS["Effect.Unsafe"] = PS["Effect.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.Unsafe"];
|
|
var Effect = PS["Effect"];
|
|
exports["unsafePerformEffect"] = $foreign.unsafePerformEffect;
|
|
})(PS["Effect.Unsafe"] = PS["Effect.Unsafe"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.Aff"];
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Lazy = PS["Control.Lazy"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Parallel_Class = PS["Control.Parallel.Class"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Time_Duration = PS["Data.Time.Duration"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Unsafe = PS["Effect.Unsafe"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Canceler = function (x) {
|
|
return x;
|
|
};
|
|
var suspendAff = $foreign["_fork"](false);
|
|
var functorParAff = new Data_Functor.Functor($foreign["_parAffMap"]);
|
|
var functorAff = new Data_Functor.Functor($foreign["_map"]);
|
|
var forkAff = $foreign["_fork"](true);
|
|
var ffiUtil = (function () {
|
|
var unsafeFromRight = function (v) {
|
|
if (v instanceof Data_Either.Right) {
|
|
return v.value0;
|
|
};
|
|
if (v instanceof Data_Either.Left) {
|
|
return Partial_Unsafe.unsafeCrashWith("unsafeFromRight: Left");
|
|
};
|
|
throw new Error("Failed pattern match at Effect.Aff (line 400, column 21 - line 402, column 31): " + [ v.constructor.name ]);
|
|
};
|
|
var unsafeFromLeft = function (v) {
|
|
if (v instanceof Data_Either.Left) {
|
|
return v.value0;
|
|
};
|
|
if (v instanceof Data_Either.Right) {
|
|
return Partial_Unsafe.unsafeCrashWith("unsafeFromLeft: Right");
|
|
};
|
|
throw new Error("Failed pattern match at Effect.Aff (line 395, column 20 - line 399, column 3): " + [ v.constructor.name ]);
|
|
};
|
|
var isLeft = function (v) {
|
|
if (v instanceof Data_Either.Left) {
|
|
return true;
|
|
};
|
|
if (v instanceof Data_Either.Right) {
|
|
return false;
|
|
};
|
|
throw new Error("Failed pattern match at Effect.Aff (line 390, column 12 - line 392, column 20): " + [ v.constructor.name ]);
|
|
};
|
|
return {
|
|
isLeft: isLeft,
|
|
fromLeft: unsafeFromLeft,
|
|
fromRight: unsafeFromRight,
|
|
left: Data_Either.Left.create,
|
|
right: Data_Either.Right.create
|
|
};
|
|
})();
|
|
var makeFiber = function (aff) {
|
|
return $foreign["_makeFiber"](ffiUtil, aff);
|
|
};
|
|
var launchAff = function (aff) {
|
|
return function __do() {
|
|
var v = makeFiber(aff)();
|
|
v.run();
|
|
return v;
|
|
};
|
|
};
|
|
var applyParAff = new Control_Apply.Apply(function () {
|
|
return functorParAff;
|
|
}, $foreign["_parAffApply"]);
|
|
var monadAff = new Control_Monad.Monad(function () {
|
|
return applicativeAff;
|
|
}, function () {
|
|
return bindAff;
|
|
});
|
|
var bindAff = new Control_Bind.Bind(function () {
|
|
return applyAff;
|
|
}, $foreign["_bind"]);
|
|
var applyAff = new Control_Apply.Apply(function () {
|
|
return functorAff;
|
|
}, Control_Monad.ap(monadAff));
|
|
var applicativeAff = new Control_Applicative.Applicative(function () {
|
|
return applyAff;
|
|
}, $foreign["_pure"]);
|
|
var monadEffectAff = new Effect_Class.MonadEffect(function () {
|
|
return monadAff;
|
|
}, $foreign["_liftEffect"]);
|
|
var effectCanceler = function ($50) {
|
|
return Canceler(Data_Function["const"](Effect_Class.liftEffect(monadEffectAff)($50)));
|
|
};
|
|
var joinFiber = function (v) {
|
|
return $foreign.makeAff(function (k) {
|
|
return Data_Functor.map(Effect.functorEffect)(effectCanceler)(v.join(k));
|
|
});
|
|
};
|
|
var functorFiber = new Data_Functor.Functor(function (f) {
|
|
return function (t) {
|
|
return Effect_Unsafe.unsafePerformEffect(makeFiber(Data_Functor.map(functorAff)(f)(joinFiber(t))));
|
|
};
|
|
});
|
|
var killFiber = function (e) {
|
|
return function (v) {
|
|
return Control_Bind.bind(bindAff)(Effect_Class.liftEffect(monadEffectAff)(v.isSuspended))(function (v1) {
|
|
if (v1) {
|
|
return Effect_Class.liftEffect(monadEffectAff)(Data_Functor["void"](Effect.functorEffect)(v.kill(e, Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit)))));
|
|
};
|
|
return $foreign.makeAff(function (k) {
|
|
return Data_Functor.map(Effect.functorEffect)(effectCanceler)(v.kill(e, k));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var monadThrowAff = new Control_Monad_Error_Class.MonadThrow(function () {
|
|
return monadAff;
|
|
}, $foreign["_throwError"]);
|
|
var monadErrorAff = new Control_Monad_Error_Class.MonadError(function () {
|
|
return monadThrowAff;
|
|
}, $foreign["_catchError"]);
|
|
var runAff = function (k) {
|
|
return function (aff) {
|
|
return launchAff(Control_Bind.bindFlipped(bindAff)(function ($52) {
|
|
return Effect_Class.liftEffect(monadEffectAff)(k($52));
|
|
})(Control_Monad_Error_Class["try"](monadErrorAff)(aff)));
|
|
};
|
|
};
|
|
var runAff_ = function (k) {
|
|
return function (aff) {
|
|
return Data_Functor["void"](Effect.functorEffect)(runAff(k)(aff));
|
|
};
|
|
};
|
|
var parallelAff = new Control_Parallel_Class.Parallel(function () {
|
|
return applicativeParAff;
|
|
}, function () {
|
|
return monadAff;
|
|
}, Unsafe_Coerce.unsafeCoerce, $foreign["_sequential"]);
|
|
var applicativeParAff = new Control_Applicative.Applicative(function () {
|
|
return applyParAff;
|
|
}, function ($54) {
|
|
return Control_Parallel_Class.parallel(parallelAff)(Control_Applicative.pure(applicativeAff)($54));
|
|
});
|
|
var monadRecAff = new Control_Monad_Rec_Class.MonadRec(function () {
|
|
return monadAff;
|
|
}, function (k) {
|
|
var go = function (a) {
|
|
return Control_Bind.bind(bindAff)(k(a))(function (v) {
|
|
if (v instanceof Control_Monad_Rec_Class.Done) {
|
|
return Control_Applicative.pure(applicativeAff)(v.value0);
|
|
};
|
|
if (v instanceof Control_Monad_Rec_Class.Loop) {
|
|
return go(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Effect.Aff (line 100, column 7 - line 102, column 22): " + [ v.constructor.name ]);
|
|
});
|
|
};
|
|
return go;
|
|
});
|
|
var nonCanceler = Data_Function["const"](Control_Applicative.pure(applicativeAff)(Data_Unit.unit));
|
|
exports["Canceler"] = Canceler;
|
|
exports["launchAff"] = launchAff;
|
|
exports["runAff"] = runAff;
|
|
exports["runAff_"] = runAff_;
|
|
exports["forkAff"] = forkAff;
|
|
exports["suspendAff"] = suspendAff;
|
|
exports["killFiber"] = killFiber;
|
|
exports["joinFiber"] = joinFiber;
|
|
exports["nonCanceler"] = nonCanceler;
|
|
exports["effectCanceler"] = effectCanceler;
|
|
exports["functorAff"] = functorAff;
|
|
exports["applyAff"] = applyAff;
|
|
exports["applicativeAff"] = applicativeAff;
|
|
exports["bindAff"] = bindAff;
|
|
exports["monadAff"] = monadAff;
|
|
exports["monadRecAff"] = monadRecAff;
|
|
exports["monadThrowAff"] = monadThrowAff;
|
|
exports["monadErrorAff"] = monadErrorAff;
|
|
exports["monadEffectAff"] = monadEffectAff;
|
|
exports["functorParAff"] = functorParAff;
|
|
exports["applyParAff"] = applyParAff;
|
|
exports["applicativeParAff"] = applicativeParAff;
|
|
exports["parallelAff"] = parallelAff;
|
|
exports["functorFiber"] = functorFiber;
|
|
exports["makeAff"] = $foreign.makeAff;
|
|
})(PS["Effect.Aff"] = PS["Effect.Aff"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Prelude = PS["Prelude"];
|
|
var fromEffectFnAff = function (v) {
|
|
return Effect_Aff.makeAff(function (k) {
|
|
return function __do() {
|
|
var v1 = v(function ($4) {
|
|
return k(Data_Either.Left.create($4))();
|
|
}, function ($5) {
|
|
return k(Data_Either.Right.create($5))();
|
|
});
|
|
return function (e) {
|
|
return Effect_Aff.makeAff(function (k2) {
|
|
return function __do() {
|
|
v1(e, function ($6) {
|
|
return k2(Data_Either.Left.create($6))();
|
|
}, function ($7) {
|
|
return k2(Data_Either.Right.create($7))();
|
|
});
|
|
return Effect_Aff.nonCanceler;
|
|
};
|
|
});
|
|
};
|
|
};
|
|
});
|
|
};
|
|
exports["fromEffectFnAff"] = fromEffectFnAff;
|
|
})(PS["Effect.Aff.Compat"] = PS["Effect.Aff.Compat"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Affjax"];
|
|
var Affjax_RequestBody = PS["Affjax.RequestBody"];
|
|
var Affjax_RequestHeader = PS["Affjax.RequestHeader"];
|
|
var Affjax_ResponseFormat = PS["Affjax.ResponseFormat"];
|
|
var Affjax_ResponseHeader = PS["Affjax.ResponseHeader"];
|
|
var Affjax_StatusCode = PS["Affjax.StatusCode"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Except = PS["Control.Monad.Except"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Argonaut_Core = PS["Data.Argonaut.Core"];
|
|
var Data_Argonaut_Parser = PS["Data.Argonaut.Parser"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FormURLEncoded = PS["Data.FormURLEncoded"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HTTP_Method = PS["Data.HTTP.Method"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Int = PS["Data.Int"];
|
|
var Data_List_NonEmpty = PS["Data.List.NonEmpty"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Time_Duration = PS["Data.Time.Duration"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_Compat = PS["Effect.Aff.Compat"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Foreign = PS["Foreign"];
|
|
var $$Math = PS["Math"];
|
|
var Prelude = PS["Prelude"];
|
|
var request = function (req) {
|
|
var parseJSON = function (v) {
|
|
if (v === "") {
|
|
return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Argonaut_Core.jsonEmptyObject);
|
|
};
|
|
return Data_Either.either(function ($66) {
|
|
return Foreign.fail(Foreign.ForeignError.create($66));
|
|
})(Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity)))(Data_Argonaut_Parser.jsonParser(v));
|
|
};
|
|
var fromResponse$prime = (function () {
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat["ArrayBuffer"]) {
|
|
return Foreign.unsafeReadTagged("ArrayBuffer");
|
|
};
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat.Blob) {
|
|
return Foreign.unsafeReadTagged("Blob");
|
|
};
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat.Document) {
|
|
return Foreign.unsafeReadTagged("Document");
|
|
};
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat.Json) {
|
|
return Control_Bind.composeKleisliFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(function ($67) {
|
|
return req.responseFormat.value0(parseJSON($67));
|
|
})(Foreign.unsafeReadTagged("String"));
|
|
};
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat["String"]) {
|
|
return Foreign.unsafeReadTagged("String");
|
|
};
|
|
if (req.responseFormat instanceof Affjax_ResponseFormat.Ignore) {
|
|
return Data_Function["const"](req.responseFormat.value0(Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Unit.unit)));
|
|
};
|
|
throw new Error("Failed pattern match at Affjax (line 292, column 19 - line 298, column 57): " + [ req.responseFormat.constructor.name ]);
|
|
})();
|
|
var extractContent = function (v) {
|
|
if (v instanceof Affjax_RequestBody.ArrayView) {
|
|
return v.value0(Foreign.unsafeToForeign);
|
|
};
|
|
if (v instanceof Affjax_RequestBody.Blob) {
|
|
return Foreign.unsafeToForeign(v.value0);
|
|
};
|
|
if (v instanceof Affjax_RequestBody.Document) {
|
|
return Foreign.unsafeToForeign(v.value0);
|
|
};
|
|
if (v instanceof Affjax_RequestBody["String"]) {
|
|
return Foreign.unsafeToForeign(v.value0);
|
|
};
|
|
if (v instanceof Affjax_RequestBody.FormData) {
|
|
return Foreign.unsafeToForeign(v.value0);
|
|
};
|
|
if (v instanceof Affjax_RequestBody.FormURLEncoded) {
|
|
return Foreign.unsafeToForeign(Data_FormURLEncoded.encode(v.value0));
|
|
};
|
|
if (v instanceof Affjax_RequestBody.Json) {
|
|
return Foreign.unsafeToForeign(Data_Argonaut_Core.stringify(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Affjax (line 266, column 20 - line 273, column 57): " + [ v.constructor.name ]);
|
|
};
|
|
var addHeader = function (mh) {
|
|
return function (hs) {
|
|
if (mh instanceof Data_Maybe.Just && !Data_Foldable.any(Data_Foldable.foldableArray)(Data_HeytingAlgebra.heytingAlgebraBoolean)(Data_Function.on(Data_Eq.eq(Data_Eq.eqString))(Affjax_RequestHeader.requestHeaderName)(mh.value0))(hs)) {
|
|
return Data_Array.snoc(hs)(mh.value0);
|
|
};
|
|
return hs;
|
|
};
|
|
};
|
|
var headers = function (reqContent) {
|
|
return addHeader(Data_Functor.map(Data_Maybe.functorMaybe)(Affjax_RequestHeader.ContentType.create)(Control_Bind.bindFlipped(Data_Maybe.bindMaybe)(Affjax_RequestBody.toMediaType)(reqContent)))(addHeader(Data_Functor.map(Data_Maybe.functorMaybe)(Affjax_RequestHeader.Accept.create)(Affjax_ResponseFormat.toMediaType(req.responseFormat)))(req.headers));
|
|
};
|
|
var req$prime = {
|
|
method: Data_HTTP_Method.print(req.method),
|
|
url: req.url,
|
|
headers: Data_Functor.map(Data_Functor.functorArray)(function (h) {
|
|
return {
|
|
field: Affjax_RequestHeader.requestHeaderName(h),
|
|
value: Affjax_RequestHeader.requestHeaderValue(h)
|
|
};
|
|
})(headers(req.content)),
|
|
content: Data_Nullable.toNullable(Data_Functor.map(Data_Maybe.functorMaybe)(extractContent)(req.content)),
|
|
responseType: Affjax_ResponseFormat.toResponseType(req.responseFormat),
|
|
username: Data_Nullable.toNullable(req.username),
|
|
password: Data_Nullable.toNullable(req.password),
|
|
withCredentials: req.withCredentials
|
|
};
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Aff_Compat.fromEffectFnAff($foreign["_ajax"](Affjax_ResponseHeader.responseHeader, req$prime)))(function (v) {
|
|
var v1 = Control_Monad_Except.runExcept(fromResponse$prime(v.body));
|
|
if (v1 instanceof Data_Either.Left) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)({
|
|
body: new Data_Either.Left(new Affjax_ResponseFormat.ResponseFormatError(Data_List_NonEmpty.head(v1.value0), v.body)),
|
|
headers: v.headers,
|
|
status: v.status,
|
|
statusText: v.statusText
|
|
});
|
|
};
|
|
if (v1 instanceof Data_Either.Right) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)({
|
|
body: new Data_Either.Right(v1.value0),
|
|
headers: v.headers,
|
|
status: v.status,
|
|
statusText: v.statusText
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Affjax (line 246, column 3 - line 250, column 39): " + [ v1.constructor.name ]);
|
|
});
|
|
};
|
|
var defaultRequest = {
|
|
method: new Data_Either.Left(Data_HTTP_Method.GET.value),
|
|
url: "/",
|
|
headers: [ ],
|
|
content: Data_Maybe.Nothing.value,
|
|
username: Data_Maybe.Nothing.value,
|
|
password: Data_Maybe.Nothing.value,
|
|
withCredentials: false,
|
|
responseFormat: Affjax_ResponseFormat.ignore
|
|
};
|
|
exports["defaultRequest"] = defaultRequest;
|
|
exports["request"] = request;
|
|
})(PS["Affjax"] = PS["Affjax"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports._app = function() {
|
|
return app;
|
|
}
|
|
|
|
exports._mmoment8601 = function(just, nothing, tuple, s) {
|
|
try {
|
|
var m = moment(s, moment.ISO_8601);
|
|
var s1 = m.fromNow();
|
|
var s2 = m.format('MMMM D YYYY, h:mm a') + " (" + m.format() + ") ";
|
|
return just(tuple(s1)(s2));
|
|
} catch (error) {
|
|
return nothing
|
|
}
|
|
}
|
|
|
|
exports._closeWindow = function (window) {
|
|
window.close();
|
|
};
|
|
})(PS["Globals"] = PS["Globals"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafeReadPropImpl = function (f, s, key, value) {
|
|
return value == null ? f : s(value[key]);
|
|
};
|
|
})(PS["Foreign.Index"] = PS["Foreign.Index"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Foreign.Index"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_List_NonEmpty = PS["Data.List.NonEmpty"];
|
|
var Foreign = PS["Foreign"];
|
|
var Prelude = PS["Prelude"];
|
|
var unsafeReadProp = function (k) {
|
|
return function (value) {
|
|
return $foreign.unsafeReadPropImpl(Foreign.fail(new Foreign.TypeMismatch("object", Foreign.typeOf(value))), Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity)), k, value);
|
|
};
|
|
};
|
|
var readProp = unsafeReadProp;
|
|
exports["readProp"] = readProp;
|
|
})(PS["Foreign.Index"] = PS["Foreign.Index"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Type_Data_Boolean = PS["Type.Data.Boolean"];
|
|
var Type_Data_Symbol = PS["Type.Data.Symbol"];
|
|
var Type_Equality = PS["Type.Equality"];
|
|
var RLProxy = (function () {
|
|
function RLProxy() {
|
|
|
|
};
|
|
RLProxy.value = new RLProxy();
|
|
return RLProxy;
|
|
})();
|
|
exports["RLProxy"] = RLProxy;
|
|
})(PS["Type.Row"] = PS["Type.Row"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Prelude = PS["Prelude"];
|
|
var Record_Unsafe = PS["Record.Unsafe"];
|
|
var Record_Unsafe_Union = PS["Record.Unsafe.Union"];
|
|
var Type_Row = PS["Type.Row"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var get = function (dictIsSymbol) {
|
|
return function (dictCons) {
|
|
return function (l) {
|
|
return function (r) {
|
|
return Record_Unsafe.unsafeGet(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(r);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["get"] = get;
|
|
})(PS["Record"] = PS["Record"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.copyRecord = function(rec) {
|
|
var copy = {};
|
|
for (var key in rec) {
|
|
if ({}.hasOwnProperty.call(rec, key)) {
|
|
copy[key] = rec[key];
|
|
}
|
|
}
|
|
return copy;
|
|
};
|
|
|
|
exports.unsafeInsert = function(l) {
|
|
return function(a) {
|
|
return function(rec) {
|
|
rec[l] = a;
|
|
return rec;
|
|
};
|
|
};
|
|
};
|
|
})(PS["Record.Builder"] = PS["Record.Builder"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Record.Builder"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Prelude = PS["Prelude"];
|
|
var Record_Unsafe_Union = PS["Record.Unsafe.Union"];
|
|
var Type_Row = PS["Type.Row"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var semigroupoidBuilder = Control_Semigroupoid.semigroupoidFn;
|
|
var insert = function (dictCons) {
|
|
return function (dictLacks) {
|
|
return function (dictIsSymbol) {
|
|
return function (l) {
|
|
return function (a) {
|
|
return function (r1) {
|
|
return $foreign.unsafeInsert(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(a)(r1);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var categoryBuilder = Control_Category.categoryFn;
|
|
var build = function (v) {
|
|
return function (r1) {
|
|
return v($foreign.copyRecord(r1));
|
|
};
|
|
};
|
|
exports["build"] = build;
|
|
exports["insert"] = insert;
|
|
exports["semigroupoidBuilder"] = semigroupoidBuilder;
|
|
exports["categoryBuilder"] = categoryBuilder;
|
|
})(PS["Record.Builder"] = PS["Record.Builder"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Simple.JSON"];
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_Except = PS["Control.Monad.Except"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Variant = PS["Data.Variant"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Effect_Unsafe = PS["Effect.Unsafe"];
|
|
var Foreign = PS["Foreign"];
|
|
var Foreign_Index = PS["Foreign.Index"];
|
|
var Foreign_Object = PS["Foreign.Object"];
|
|
var Global_Unsafe = PS["Global.Unsafe"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Record = PS["Record"];
|
|
var Record_Builder = PS["Record.Builder"];
|
|
var Type_Prelude = PS["Type.Prelude"];
|
|
var Type_Row = PS["Type.Row"];
|
|
var WriteForeign = function (writeImpl) {
|
|
this.writeImpl = writeImpl;
|
|
};
|
|
var WriteForeignFields = function (writeImplFields) {
|
|
this.writeImplFields = writeImplFields;
|
|
};
|
|
var writeImplFields = function (dict) {
|
|
return dict.writeImplFields;
|
|
};
|
|
var writeImpl = function (dict) {
|
|
return dict.writeImpl;
|
|
};
|
|
var writeJSON = function (dictWriteForeign) {
|
|
return function ($85) {
|
|
return Global_Unsafe.unsafeStringify(writeImpl(dictWriteForeign)($85));
|
|
};
|
|
};
|
|
var writeForeignString = new WriteForeign(Foreign.unsafeToForeign);
|
|
var writeForeignNullable = function (dictWriteForeign) {
|
|
return new WriteForeign(function ($87) {
|
|
return Data_Maybe.maybe(Foreign.unsafeToForeign(Data_Nullable.toNullable(Data_Maybe.Nothing.value)))(writeImpl(dictWriteForeign))(Data_Nullable.toMaybe($87));
|
|
});
|
|
};
|
|
var writeForeignInt = new WriteForeign(Foreign.unsafeToForeign);
|
|
var writeForeignBoolean = new WriteForeign(Foreign.unsafeToForeign);
|
|
var recordWriteForeign = function (dictRowToList) {
|
|
return function (dictWriteForeignFields) {
|
|
return new WriteForeign(function (rec) {
|
|
var steps = writeImplFields(dictWriteForeignFields)(Type_Row.RLProxy.value)(rec);
|
|
return Foreign.unsafeToForeign(Record_Builder.build(steps)({}));
|
|
});
|
|
};
|
|
};
|
|
var nilWriteForeignFields = new WriteForeignFields(function (v) {
|
|
return function (v1) {
|
|
return Control_Category.identity(Record_Builder.categoryBuilder);
|
|
};
|
|
});
|
|
var consWriteForeignFields = function (dictIsSymbol) {
|
|
return function (dictWriteForeign) {
|
|
return function (dictWriteForeignFields) {
|
|
return function (dictCons) {
|
|
return function (dictLacks) {
|
|
return function (dictCons1) {
|
|
return new WriteForeignFields(function (v) {
|
|
return function (rec) {
|
|
var rest = writeImplFields(dictWriteForeignFields)(Type_Row.RLProxy.value)(rec);
|
|
var value = writeImpl(dictWriteForeign)(Record.get(dictIsSymbol)(dictCons)(Data_Symbol.SProxy.value)(rec));
|
|
var result = Control_Semigroupoid.compose(Record_Builder.semigroupoidBuilder)(Record_Builder.insert(dictCons1)(dictLacks)(dictIsSymbol)(Data_Symbol.SProxy.value)(value))(rest);
|
|
return result;
|
|
};
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["writeJSON"] = writeJSON;
|
|
exports["WriteForeign"] = WriteForeign;
|
|
exports["writeImpl"] = writeImpl;
|
|
exports["WriteForeignFields"] = WriteForeignFields;
|
|
exports["writeImplFields"] = writeImplFields;
|
|
exports["writeForeignString"] = writeForeignString;
|
|
exports["writeForeignInt"] = writeForeignInt;
|
|
exports["writeForeignBoolean"] = writeForeignBoolean;
|
|
exports["writeForeignNullable"] = writeForeignNullable;
|
|
exports["recordWriteForeign"] = recordWriteForeign;
|
|
exports["consWriteForeignFields"] = consWriteForeignFields;
|
|
exports["nilWriteForeignFields"] = nilWriteForeignFields;
|
|
})(PS["Simple.JSON"] = PS["Simple.JSON"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Symbol = PS["Data.Symbol"];
|
|
var Simple_JSON = PS["Simple.JSON"];
|
|
var usersettings_wfI = Simple_JSON.recordWriteForeign()(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "archiveDefault";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "privacyLock";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "privateDefault";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.nilWriteForeignFields)()()())()()())()()());
|
|
var note_wfI = Simple_JSON.recordWriteForeign()(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "created";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "id";
|
|
}))(Simple_JSON.writeForeignInt)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "isMarkdown";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "length";
|
|
}))(Simple_JSON.writeForeignInt)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "slug";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "text";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "title";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "updated";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.nilWriteForeignFields)()()())()()())()()())()()())()()())()()())()()())()()());
|
|
var bookmark_wfI = Simple_JSON.recordWriteForeign()(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "archiveUrl";
|
|
}))(Simple_JSON.writeForeignNullable(Simple_JSON.writeForeignString))(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "bid";
|
|
}))(Simple_JSON.writeForeignInt)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "description";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "private";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "selected";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "slug";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "tags";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "time";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "title";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "toread";
|
|
}))(Simple_JSON.writeForeignBoolean)(Simple_JSON.consWriteForeignFields(new Data_Symbol.IsSymbol(function () {
|
|
return "url";
|
|
}))(Simple_JSON.writeForeignString)(Simple_JSON.nilWriteForeignFields)()()())()()())()()())()()())()()())()()())()()())()()())()()())()()())()()());
|
|
exports["bookmark_wfI"] = bookmark_wfI;
|
|
exports["note_wfI"] = note_wfI;
|
|
exports["usersettings_wfI"] = usersettings_wfI;
|
|
})(PS["Model"] = PS["Model"] || {});
|
|
(function(exports) {
|
|
/* global window */
|
|
"use strict";
|
|
|
|
exports.window = function () {
|
|
return window;
|
|
};
|
|
})(PS["Web.HTML"] = PS["Web.HTML"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports._querySelector = function (selector) {
|
|
return function (node) {
|
|
return function () {
|
|
return node.querySelector(selector);
|
|
};
|
|
};
|
|
};
|
|
})(PS["Web.DOM.ParentNode"] = PS["Web.DOM.ParentNode"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.DOM.ParentNode"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM_HTMLCollection = PS["Web.DOM.HTMLCollection"];
|
|
var Web_DOM_Internal_Types = PS["Web.DOM.Internal.Types"];
|
|
var Web_DOM_NodeList = PS["Web.DOM.NodeList"];
|
|
var querySelector = function (qs) {
|
|
return function ($3) {
|
|
return Data_Functor.map(Effect.functorEffect)(Data_Nullable.toMaybe)($foreign["_querySelector"](qs)($3));
|
|
};
|
|
};
|
|
exports["querySelector"] = querySelector;
|
|
})(PS["Web.DOM.ParentNode"] = PS["Web.DOM.ParentNode"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.eventListener = function (fn) {
|
|
return function () {
|
|
return function (event) {
|
|
return fn(event)();
|
|
};
|
|
};
|
|
};
|
|
})(PS["Web.Event.EventTarget"] = PS["Web.Event.EventTarget"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports._currentTarget = function (e) {
|
|
return e.currentTarget;
|
|
};
|
|
|
|
exports.preventDefault = function (e) {
|
|
return function () {
|
|
return e.preventDefault();
|
|
};
|
|
};
|
|
})(PS["Web.Event.Event"] = PS["Web.Event.Event"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.toCharCode = function (c) {
|
|
return c.charCodeAt(0);
|
|
};
|
|
|
|
exports.fromCharCode = function (c) {
|
|
return String.fromCharCode(c);
|
|
};
|
|
})(PS["Data.Enum"] = PS["Data.Enum"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.Enum"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Enum = function (Ord0, pred, succ) {
|
|
this.Ord0 = Ord0;
|
|
this.pred = pred;
|
|
this.succ = succ;
|
|
};
|
|
var BoundedEnum = function (Bounded0, Enum1, cardinality, fromEnum, toEnum) {
|
|
this.Bounded0 = Bounded0;
|
|
this.Enum1 = Enum1;
|
|
this.cardinality = cardinality;
|
|
this.fromEnum = fromEnum;
|
|
this.toEnum = toEnum;
|
|
};
|
|
var toEnum = function (dict) {
|
|
return dict.toEnum;
|
|
};
|
|
var succ = function (dict) {
|
|
return dict.succ;
|
|
};
|
|
var pred = function (dict) {
|
|
return dict.pred;
|
|
};
|
|
var fromEnum = function (dict) {
|
|
return dict.fromEnum;
|
|
};
|
|
var toEnumWithDefaults = function (dictBoundedEnum) {
|
|
return function (low) {
|
|
return function (high) {
|
|
return function (x) {
|
|
var v = toEnum(dictBoundedEnum)(x);
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return v.value0;
|
|
};
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
var $51 = x < fromEnum(dictBoundedEnum)(Data_Bounded.bottom(dictBoundedEnum.Bounded0()));
|
|
if ($51) {
|
|
return low;
|
|
};
|
|
return high;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Enum (line 158, column 33 - line 160, column 62): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var defaultSucc = function (toEnum$prime) {
|
|
return function (fromEnum$prime) {
|
|
return function (a) {
|
|
return toEnum$prime(fromEnum$prime(a) + 1 | 0);
|
|
};
|
|
};
|
|
};
|
|
var defaultPred = function (toEnum$prime) {
|
|
return function (fromEnum$prime) {
|
|
return function (a) {
|
|
return toEnum$prime(fromEnum$prime(a) - 1 | 0);
|
|
};
|
|
};
|
|
};
|
|
var charToEnum = function (v) {
|
|
if (v >= Data_Bounded.bottom(Data_Bounded.boundedInt) && v <= Data_Bounded.top(Data_Bounded.boundedInt)) {
|
|
return new Data_Maybe.Just($foreign.fromCharCode(v));
|
|
};
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
var enumChar = new Enum(function () {
|
|
return Data_Ord.ordChar;
|
|
}, defaultPred(charToEnum)($foreign.toCharCode), defaultSucc(charToEnum)($foreign.toCharCode));
|
|
var cardinality = function (dict) {
|
|
return dict.cardinality;
|
|
};
|
|
var boundedEnumChar = new BoundedEnum(function () {
|
|
return Data_Bounded.boundedChar;
|
|
}, function () {
|
|
return enumChar;
|
|
}, $foreign.toCharCode(Data_Bounded.top(Data_Bounded.boundedChar)) - $foreign.toCharCode(Data_Bounded.bottom(Data_Bounded.boundedChar)) | 0, $foreign.toCharCode, charToEnum);
|
|
exports["Enum"] = Enum;
|
|
exports["succ"] = succ;
|
|
exports["pred"] = pred;
|
|
exports["BoundedEnum"] = BoundedEnum;
|
|
exports["cardinality"] = cardinality;
|
|
exports["toEnum"] = toEnum;
|
|
exports["fromEnum"] = fromEnum;
|
|
exports["toEnumWithDefaults"] = toEnumWithDefaults;
|
|
exports["defaultSucc"] = defaultSucc;
|
|
exports["defaultPred"] = defaultPred;
|
|
exports["enumChar"] = enumChar;
|
|
exports["boundedEnumChar"] = boundedEnumChar;
|
|
})(PS["Data.Enum"] = PS["Data.Enum"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.Event.Event"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_DateTime_Instant = PS["Data.DateTime.Instant"];
|
|
var Data_Enum = PS["Data.Enum"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_Event_EventPhase = PS["Web.Event.EventPhase"];
|
|
var Web_Event_Internal_Types = PS["Web.Event.Internal.Types"];
|
|
var currentTarget = function ($6) {
|
|
return Data_Nullable.toMaybe($foreign["_currentTarget"]($6));
|
|
};
|
|
exports["currentTarget"] = currentTarget;
|
|
exports["preventDefault"] = $foreign.preventDefault;
|
|
})(PS["Web.Event.Event"] = PS["Web.Event.Event"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.Event.EventTarget"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_Event_Internal_Types = PS["Web.Event.Internal.Types"];
|
|
exports["eventListener"] = $foreign.eventListener;
|
|
})(PS["Web.Event.EventTarget"] = PS["Web.Event.EventTarget"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports._read = function (nothing, just, value) {
|
|
var tag = Object.prototype.toString.call(value);
|
|
if (tag.indexOf("[object HTML") === 0 && tag.indexOf("Element]") === tag.length - 8) {
|
|
return just(value);
|
|
} else {
|
|
return nothing;
|
|
}
|
|
};
|
|
})(PS["Web.HTML.HTMLElement"] = PS["Web.HTML.HTMLElement"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.removeAttribute = function (name) {
|
|
return function (element) {
|
|
return function () {
|
|
element.removeAttribute(name);
|
|
return {};
|
|
};
|
|
};
|
|
};
|
|
})(PS["Web.DOM.Element"] = PS["Web.DOM.Element"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.DOM.Element"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_ChildNode = PS["Web.DOM.ChildNode"];
|
|
var Web_DOM_Internal_Types = PS["Web.DOM.Internal.Types"];
|
|
var Web_DOM_NonDocumentTypeChildNode = PS["Web.DOM.NonDocumentTypeChildNode"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Web_Internal_FFI = PS["Web.Internal.FFI"];
|
|
var toNode = Unsafe_Coerce.unsafeCoerce;
|
|
exports["toNode"] = toNode;
|
|
exports["removeAttribute"] = $foreign.removeAttribute;
|
|
})(PS["Web.DOM.Element"] = PS["Web.DOM.Element"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.HTML.HTMLElement"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var Web_DOM_DOMTokenList = PS["Web.DOM.DOMTokenList"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_Internal_Types = PS["Web.DOM.Internal.Types"];
|
|
var Web_DOM_NonDocumentTypeChildNode = PS["Web.DOM.NonDocumentTypeChildNode"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var toNode = Unsafe_Coerce.unsafeCoerce;
|
|
var toElement = Unsafe_Coerce.unsafeCoerce;
|
|
var fromElement = function (x) {
|
|
return $foreign["_read"](Data_Maybe.Nothing.value, Data_Maybe.Just.create, x);
|
|
};
|
|
exports["fromElement"] = fromElement;
|
|
exports["toElement"] = toElement;
|
|
exports["toNode"] = toNode;
|
|
})(PS["Web.HTML.HTMLElement"] = PS["Web.HTML.HTMLElement"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.HTML.HTMLDocument"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Internal_Types = PS["Web.DOM.Internal.Types"];
|
|
var Web_DOM_NonElementParentNode = PS["Web.DOM.NonElementParentNode"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Web_HTML_HTMLDocument_ReadyState = PS["Web.HTML.HTMLDocument.ReadyState"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var Web_HTML_HTMLScriptElement = PS["Web.HTML.HTMLScriptElement"];
|
|
var Web_Internal_FFI = PS["Web.Internal.FFI"];
|
|
var toParentNode = Unsafe_Coerce.unsafeCoerce;
|
|
var toDocument = Unsafe_Coerce.unsafeCoerce;
|
|
exports["toDocument"] = toDocument;
|
|
exports["toParentNode"] = toParentNode;
|
|
})(PS["Web.HTML.HTMLDocument"] = PS["Web.HTML.HTMLDocument"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
exports.href = function (location) {
|
|
return function () {
|
|
return location.href;
|
|
};
|
|
};
|
|
|
|
exports.setHref = function (href) {
|
|
return function (location) {
|
|
return function () {
|
|
location.href = href;
|
|
};
|
|
};
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
exports.search = function (location) {
|
|
return function () {
|
|
return location.search;
|
|
};
|
|
};
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
exports.reload = function (location) {
|
|
return function () {
|
|
location.reload();
|
|
};
|
|
};
|
|
})(PS["Web.HTML.Location"] = PS["Web.HTML.Location"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.HTML.Location"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
exports["setHref"] = $foreign.setHref;
|
|
exports["search"] = $foreign.search;
|
|
exports["reload"] = $foreign.reload;
|
|
})(PS["Web.HTML.Location"] = PS["Web.HTML.Location"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.document = function (window) {
|
|
return function () {
|
|
return window.document;
|
|
};
|
|
};
|
|
|
|
exports.location = function (window) {
|
|
return function () {
|
|
return window.location;
|
|
};
|
|
};
|
|
})(PS["Web.HTML.Window"] = PS["Web.HTML.Window"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.HTML.Window"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"];
|
|
var Web_HTML_History = PS["Web.HTML.History"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Web_HTML_Navigator = PS["Web.HTML.Navigator"];
|
|
var Web_Storage_Storage = PS["Web.Storage.Storage"];
|
|
exports["document"] = $foreign.document;
|
|
exports["location"] = $foreign.location;
|
|
})(PS["Web.HTML.Window"] = PS["Web.HTML.Window"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.HTML"];
|
|
var Effect = PS["Effect"];
|
|
var Web_HTML_HTMLAnchorElement = PS["Web.HTML.HTMLAnchorElement"];
|
|
var Web_HTML_HTMLAreaElement = PS["Web.HTML.HTMLAreaElement"];
|
|
var Web_HTML_HTMLAudioElement = PS["Web.HTML.HTMLAudioElement"];
|
|
var Web_HTML_HTMLBRElement = PS["Web.HTML.HTMLBRElement"];
|
|
var Web_HTML_HTMLBaseElement = PS["Web.HTML.HTMLBaseElement"];
|
|
var Web_HTML_HTMLBodyElement = PS["Web.HTML.HTMLBodyElement"];
|
|
var Web_HTML_HTMLButtonElement = PS["Web.HTML.HTMLButtonElement"];
|
|
var Web_HTML_HTMLCanvasElement = PS["Web.HTML.HTMLCanvasElement"];
|
|
var Web_HTML_HTMLDListElement = PS["Web.HTML.HTMLDListElement"];
|
|
var Web_HTML_HTMLDataElement = PS["Web.HTML.HTMLDataElement"];
|
|
var Web_HTML_HTMLDataListElement = PS["Web.HTML.HTMLDataListElement"];
|
|
var Web_HTML_HTMLDivElement = PS["Web.HTML.HTMLDivElement"];
|
|
var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var Web_HTML_HTMLEmbedElement = PS["Web.HTML.HTMLEmbedElement"];
|
|
var Web_HTML_HTMLFieldSetElement = PS["Web.HTML.HTMLFieldSetElement"];
|
|
var Web_HTML_HTMLFormElement = PS["Web.HTML.HTMLFormElement"];
|
|
var Web_HTML_HTMLHRElement = PS["Web.HTML.HTMLHRElement"];
|
|
var Web_HTML_HTMLHeadElement = PS["Web.HTML.HTMLHeadElement"];
|
|
var Web_HTML_HTMLHeadingElement = PS["Web.HTML.HTMLHeadingElement"];
|
|
var Web_HTML_HTMLIFrameElement = PS["Web.HTML.HTMLIFrameElement"];
|
|
var Web_HTML_HTMLImageElement = PS["Web.HTML.HTMLImageElement"];
|
|
var Web_HTML_HTMLInputElement = PS["Web.HTML.HTMLInputElement"];
|
|
var Web_HTML_HTMLKeygenElement = PS["Web.HTML.HTMLKeygenElement"];
|
|
var Web_HTML_HTMLLIElement = PS["Web.HTML.HTMLLIElement"];
|
|
var Web_HTML_HTMLLabelElement = PS["Web.HTML.HTMLLabelElement"];
|
|
var Web_HTML_HTMLLegendElement = PS["Web.HTML.HTMLLegendElement"];
|
|
var Web_HTML_HTMLLinkElement = PS["Web.HTML.HTMLLinkElement"];
|
|
var Web_HTML_HTMLMapElement = PS["Web.HTML.HTMLMapElement"];
|
|
var Web_HTML_HTMLMediaElement = PS["Web.HTML.HTMLMediaElement"];
|
|
var Web_HTML_HTMLMetaElement = PS["Web.HTML.HTMLMetaElement"];
|
|
var Web_HTML_HTMLMeterElement = PS["Web.HTML.HTMLMeterElement"];
|
|
var Web_HTML_HTMLModElement = PS["Web.HTML.HTMLModElement"];
|
|
var Web_HTML_HTMLOListElement = PS["Web.HTML.HTMLOListElement"];
|
|
var Web_HTML_HTMLObjectElement = PS["Web.HTML.HTMLObjectElement"];
|
|
var Web_HTML_HTMLOptGroupElement = PS["Web.HTML.HTMLOptGroupElement"];
|
|
var Web_HTML_HTMLOptionElement = PS["Web.HTML.HTMLOptionElement"];
|
|
var Web_HTML_HTMLOutputElement = PS["Web.HTML.HTMLOutputElement"];
|
|
var Web_HTML_HTMLParagraphElement = PS["Web.HTML.HTMLParagraphElement"];
|
|
var Web_HTML_HTMLParamElement = PS["Web.HTML.HTMLParamElement"];
|
|
var Web_HTML_HTMLPreElement = PS["Web.HTML.HTMLPreElement"];
|
|
var Web_HTML_HTMLProgressElement = PS["Web.HTML.HTMLProgressElement"];
|
|
var Web_HTML_HTMLQuoteElement = PS["Web.HTML.HTMLQuoteElement"];
|
|
var Web_HTML_HTMLScriptElement = PS["Web.HTML.HTMLScriptElement"];
|
|
var Web_HTML_HTMLSelectElement = PS["Web.HTML.HTMLSelectElement"];
|
|
var Web_HTML_HTMLSourceElement = PS["Web.HTML.HTMLSourceElement"];
|
|
var Web_HTML_HTMLSpanElement = PS["Web.HTML.HTMLSpanElement"];
|
|
var Web_HTML_HTMLStyleElement = PS["Web.HTML.HTMLStyleElement"];
|
|
var Web_HTML_HTMLTableCaptionElement = PS["Web.HTML.HTMLTableCaptionElement"];
|
|
var Web_HTML_HTMLTableCellElement = PS["Web.HTML.HTMLTableCellElement"];
|
|
var Web_HTML_HTMLTableColElement = PS["Web.HTML.HTMLTableColElement"];
|
|
var Web_HTML_HTMLTableDataCellElement = PS["Web.HTML.HTMLTableDataCellElement"];
|
|
var Web_HTML_HTMLTableElement = PS["Web.HTML.HTMLTableElement"];
|
|
var Web_HTML_HTMLTableHeaderCellElement = PS["Web.HTML.HTMLTableHeaderCellElement"];
|
|
var Web_HTML_HTMLTableRowElement = PS["Web.HTML.HTMLTableRowElement"];
|
|
var Web_HTML_HTMLTableSectionElement = PS["Web.HTML.HTMLTableSectionElement"];
|
|
var Web_HTML_HTMLTemplateElement = PS["Web.HTML.HTMLTemplateElement"];
|
|
var Web_HTML_HTMLTextAreaElement = PS["Web.HTML.HTMLTextAreaElement"];
|
|
var Web_HTML_HTMLTimeElement = PS["Web.HTML.HTMLTimeElement"];
|
|
var Web_HTML_HTMLTitleElement = PS["Web.HTML.HTMLTitleElement"];
|
|
var Web_HTML_HTMLTrackElement = PS["Web.HTML.HTMLTrackElement"];
|
|
var Web_HTML_HTMLUListElement = PS["Web.HTML.HTMLUListElement"];
|
|
var Web_HTML_HTMLVideoElement = PS["Web.HTML.HTMLVideoElement"];
|
|
var Web_HTML_History = PS["Web.HTML.History"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Web_HTML_Navigator = PS["Web.HTML.Navigator"];
|
|
var Web_HTML_Window = PS["Web.HTML.Window"];
|
|
exports["window"] = $foreign.window;
|
|
})(PS["Web.HTML"] = PS["Web.HTML"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Globals"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Effect = PS["Effect"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_XHR_FormData = PS["Web.XHR.FormData"];
|
|
var RawHTML = function (x) {
|
|
return x;
|
|
};
|
|
var mmoment8601 = function (s) {
|
|
return $foreign["_mmoment8601"](Data_Maybe.Just.create, Data_Maybe.Nothing.value, Data_Tuple.Tuple.create, s);
|
|
};
|
|
var closeWindow = function (win) {
|
|
return Control_Applicative.pure(Effect.applicativeEffect)($foreign["_closeWindow"](win));
|
|
};
|
|
var app$prime = function (v) {
|
|
return $foreign["_app"]();
|
|
};
|
|
exports["app'"] = app$prime;
|
|
exports["mmoment8601"] = mmoment8601;
|
|
exports["closeWindow"] = closeWindow;
|
|
exports["RawHTML"] = RawHTML;
|
|
})(PS["Globals"] = PS["Globals"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Affjax = PS["Affjax"];
|
|
var Affjax_RequestBody = PS["Affjax.RequestBody"];
|
|
var Affjax_RequestHeader = PS["Affjax.RequestHeader"];
|
|
var Affjax_ResponseFormat = PS["Affjax.ResponseFormat"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Argonaut = PS["Data.Argonaut"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_FormURLEncoded = PS["Data.FormURLEncoded"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HTTP_Method = PS["Data.HTTP.Method"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_MediaType_Common = PS["Data.MediaType.Common"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Simple_JSON = PS["Simple.JSON"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Web_HTML_Window = PS["Web.HTML.Window"];
|
|
var Star = (function () {
|
|
function Star() {
|
|
|
|
};
|
|
Star.value = new Star();
|
|
return Star;
|
|
})();
|
|
var UnStar = (function () {
|
|
function UnStar() {
|
|
|
|
};
|
|
UnStar.value = new UnStar();
|
|
return UnStar;
|
|
})();
|
|
var showStar = new Data_Show.Show(function (v) {
|
|
if (v instanceof Star) {
|
|
return "star";
|
|
};
|
|
if (v instanceof UnStar) {
|
|
return "unstar";
|
|
};
|
|
throw new Error("Failed pattern match at App (line 28, column 1 - line 28, column 37): " + [ v.constructor.name ]);
|
|
});
|
|
var fetchUrl = function (method) {
|
|
return function (url) {
|
|
return function (headers) {
|
|
return function (content) {
|
|
return function (rt) {
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
return Affjax.request({
|
|
method: new Data_Either.Left(method),
|
|
url: url,
|
|
headers: Data_Array.cons(new Affjax_RequestHeader.RequestHeader(app.csrfHeaderName, app.csrfToken))(headers),
|
|
content: content,
|
|
username: Affjax.defaultRequest.username,
|
|
password: Affjax.defaultRequest.password,
|
|
withCredentials: Affjax.defaultRequest.withCredentials,
|
|
responseFormat: rt
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var logout = function (u) {
|
|
var app = Globals["app'"](u);
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Data_Functor["void"](Effect_Aff.functorAff)(fetchUrl(Data_HTTP_Method.POST.value)(app.authRlogoutR)([ ])(Data_Maybe.Nothing.value)(Affjax_ResponseFormat.ignore)))(function () {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Control_Bind.bind(Effect.bindEffect)(Control_Bind.bind(Effect.bindEffect)(Web_HTML.window)(Web_HTML_Window.location))(Web_HTML_Location.reload));
|
|
});
|
|
};
|
|
var fetchPath = function (method) {
|
|
return function (path) {
|
|
return function (headers) {
|
|
return function (content) {
|
|
return function (rt) {
|
|
return fetchUrl(method)((Globals["app'"](Data_Unit.unit)).homeR + path)(headers)(content)(rt);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var fetchUrlEnc = function (method) {
|
|
return function (path) {
|
|
return function (content) {
|
|
return function (rt) {
|
|
return fetchPath(method)(path)([ new Affjax_RequestHeader.ContentType(Data_MediaType_Common.applicationFormURLEncoded) ])(Data_Functor.map(Data_Maybe.functorMaybe)(Affjax_RequestBody.FormURLEncoded.create)(content))(rt);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var markRead = function (bid) {
|
|
var path = "bm/" + (Data_Show.show(Data_Show.showInt)(bid) + "/read");
|
|
return fetchUrlEnc(Data_HTTP_Method.POST.value)(path)(Data_Maybe.Nothing.value)(Affjax_ResponseFormat.ignore);
|
|
};
|
|
var toggleStar = function (bid) {
|
|
return function (action) {
|
|
var path = "bm/" + (Data_Show.show(Data_Show.showInt)(bid) + ("/" + Data_Show.show(showStar)(action)));
|
|
return Data_Functor["void"](Effect_Aff.functorAff)(fetchUrlEnc(Data_HTTP_Method.POST.value)(path)(Data_Maybe.Nothing.value)(Affjax_ResponseFormat.ignore));
|
|
};
|
|
};
|
|
var fetchJson = function (dictWriteForeign) {
|
|
return function (method) {
|
|
return function (path) {
|
|
return function (content) {
|
|
return function (rt) {
|
|
return fetchPath(method)(path)([ new Affjax_RequestHeader.ContentType(Data_MediaType_Common.applicationJSON) ])(Data_Functor.map(Data_Maybe.functorMaybe)(function ($4) {
|
|
return Affjax_RequestBody.string(Simple_JSON.writeJSON(dictWriteForeign)($4));
|
|
})(content))(rt);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var editNote = function (bm) {
|
|
return fetchJson(Model.note_wfI)(Data_HTTP_Method.POST.value)("api/note/add")(new Data_Maybe.Just(bm))(Affjax_ResponseFormat.json);
|
|
};
|
|
var editBookmark = function (bm) {
|
|
return fetchJson(Model.bookmark_wfI)(Data_HTTP_Method.POST.value)("api/add")(new Data_Maybe.Just(bm))(Affjax_ResponseFormat.ignore);
|
|
};
|
|
var editAccountSettings = function (us) {
|
|
return fetchJson(Model.usersettings_wfI)(Data_HTTP_Method.POST.value)("api/accountSettings")(new Data_Maybe.Just(us))(Affjax_ResponseFormat.ignore);
|
|
};
|
|
var destroyNote = function (nid) {
|
|
return fetchUrlEnc(Data_HTTP_Method.DELETE.value)("api/note/" + Data_Show.show(Data_Show.showInt)(nid))(Data_Maybe.Nothing.value)(Affjax_ResponseFormat.ignore);
|
|
};
|
|
var destroy = function (bid) {
|
|
return fetchUrlEnc(Data_HTTP_Method.DELETE.value)("bm/" + Data_Show.show(Data_Show.showInt)(bid))(Data_Maybe.Nothing.value)(Affjax_ResponseFormat.ignore);
|
|
};
|
|
exports["Star"] = Star;
|
|
exports["UnStar"] = UnStar;
|
|
exports["toggleStar"] = toggleStar;
|
|
exports["destroy"] = destroy;
|
|
exports["markRead"] = markRead;
|
|
exports["editBookmark"] = editBookmark;
|
|
exports["editNote"] = editNote;
|
|
exports["destroyNote"] = destroyNote;
|
|
exports["editAccountSettings"] = editAccountSettings;
|
|
exports["logout"] = logout;
|
|
exports["fetchJson"] = fetchJson;
|
|
exports["fetchUrlEnc"] = fetchUrlEnc;
|
|
exports["fetchPath"] = fetchPath;
|
|
exports["fetchUrl"] = fetchUrl;
|
|
exports["showStar"] = showStar;
|
|
})(PS["App"] = PS["App"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var InputButton = (function () {
|
|
function InputButton() {
|
|
|
|
};
|
|
InputButton.value = new InputButton();
|
|
return InputButton;
|
|
})();
|
|
var InputCheckbox = (function () {
|
|
function InputCheckbox() {
|
|
|
|
};
|
|
InputCheckbox.value = new InputCheckbox();
|
|
return InputCheckbox;
|
|
})();
|
|
var InputColor = (function () {
|
|
function InputColor() {
|
|
|
|
};
|
|
InputColor.value = new InputColor();
|
|
return InputColor;
|
|
})();
|
|
var InputDate = (function () {
|
|
function InputDate() {
|
|
|
|
};
|
|
InputDate.value = new InputDate();
|
|
return InputDate;
|
|
})();
|
|
var InputDatetimeLocal = (function () {
|
|
function InputDatetimeLocal() {
|
|
|
|
};
|
|
InputDatetimeLocal.value = new InputDatetimeLocal();
|
|
return InputDatetimeLocal;
|
|
})();
|
|
var InputEmail = (function () {
|
|
function InputEmail() {
|
|
|
|
};
|
|
InputEmail.value = new InputEmail();
|
|
return InputEmail;
|
|
})();
|
|
var InputFile = (function () {
|
|
function InputFile() {
|
|
|
|
};
|
|
InputFile.value = new InputFile();
|
|
return InputFile;
|
|
})();
|
|
var InputHidden = (function () {
|
|
function InputHidden() {
|
|
|
|
};
|
|
InputHidden.value = new InputHidden();
|
|
return InputHidden;
|
|
})();
|
|
var InputImage = (function () {
|
|
function InputImage() {
|
|
|
|
};
|
|
InputImage.value = new InputImage();
|
|
return InputImage;
|
|
})();
|
|
var InputMonth = (function () {
|
|
function InputMonth() {
|
|
|
|
};
|
|
InputMonth.value = new InputMonth();
|
|
return InputMonth;
|
|
})();
|
|
var InputNumber = (function () {
|
|
function InputNumber() {
|
|
|
|
};
|
|
InputNumber.value = new InputNumber();
|
|
return InputNumber;
|
|
})();
|
|
var InputPassword = (function () {
|
|
function InputPassword() {
|
|
|
|
};
|
|
InputPassword.value = new InputPassword();
|
|
return InputPassword;
|
|
})();
|
|
var InputRadio = (function () {
|
|
function InputRadio() {
|
|
|
|
};
|
|
InputRadio.value = new InputRadio();
|
|
return InputRadio;
|
|
})();
|
|
var InputRange = (function () {
|
|
function InputRange() {
|
|
|
|
};
|
|
InputRange.value = new InputRange();
|
|
return InputRange;
|
|
})();
|
|
var InputReset = (function () {
|
|
function InputReset() {
|
|
|
|
};
|
|
InputReset.value = new InputReset();
|
|
return InputReset;
|
|
})();
|
|
var InputSearch = (function () {
|
|
function InputSearch() {
|
|
|
|
};
|
|
InputSearch.value = new InputSearch();
|
|
return InputSearch;
|
|
})();
|
|
var InputSubmit = (function () {
|
|
function InputSubmit() {
|
|
|
|
};
|
|
InputSubmit.value = new InputSubmit();
|
|
return InputSubmit;
|
|
})();
|
|
var InputTel = (function () {
|
|
function InputTel() {
|
|
|
|
};
|
|
InputTel.value = new InputTel();
|
|
return InputTel;
|
|
})();
|
|
var InputText = (function () {
|
|
function InputText() {
|
|
|
|
};
|
|
InputText.value = new InputText();
|
|
return InputText;
|
|
})();
|
|
var InputTime = (function () {
|
|
function InputTime() {
|
|
|
|
};
|
|
InputTime.value = new InputTime();
|
|
return InputTime;
|
|
})();
|
|
var InputUrl = (function () {
|
|
function InputUrl() {
|
|
|
|
};
|
|
InputUrl.value = new InputUrl();
|
|
return InputUrl;
|
|
})();
|
|
var InputWeek = (function () {
|
|
function InputWeek() {
|
|
|
|
};
|
|
InputWeek.value = new InputWeek();
|
|
return InputWeek;
|
|
})();
|
|
var renderInputType = function (v) {
|
|
if (v instanceof InputButton) {
|
|
return "button";
|
|
};
|
|
if (v instanceof InputCheckbox) {
|
|
return "checkbox";
|
|
};
|
|
if (v instanceof InputColor) {
|
|
return "color";
|
|
};
|
|
if (v instanceof InputDate) {
|
|
return "date";
|
|
};
|
|
if (v instanceof InputDatetimeLocal) {
|
|
return "datetime-local";
|
|
};
|
|
if (v instanceof InputEmail) {
|
|
return "email";
|
|
};
|
|
if (v instanceof InputFile) {
|
|
return "file";
|
|
};
|
|
if (v instanceof InputHidden) {
|
|
return "hidden";
|
|
};
|
|
if (v instanceof InputImage) {
|
|
return "image";
|
|
};
|
|
if (v instanceof InputMonth) {
|
|
return "month";
|
|
};
|
|
if (v instanceof InputNumber) {
|
|
return "number";
|
|
};
|
|
if (v instanceof InputPassword) {
|
|
return "password";
|
|
};
|
|
if (v instanceof InputRadio) {
|
|
return "radio";
|
|
};
|
|
if (v instanceof InputRange) {
|
|
return "range";
|
|
};
|
|
if (v instanceof InputReset) {
|
|
return "reset";
|
|
};
|
|
if (v instanceof InputSearch) {
|
|
return "search";
|
|
};
|
|
if (v instanceof InputSubmit) {
|
|
return "submit";
|
|
};
|
|
if (v instanceof InputTel) {
|
|
return "tel";
|
|
};
|
|
if (v instanceof InputText) {
|
|
return "text";
|
|
};
|
|
if (v instanceof InputTime) {
|
|
return "time";
|
|
};
|
|
if (v instanceof InputUrl) {
|
|
return "url";
|
|
};
|
|
if (v instanceof InputWeek) {
|
|
return "week";
|
|
};
|
|
throw new Error("Failed pattern match at DOM.HTML.Indexed.InputType (line 28, column 19 - line 50, column 16): " + [ v.constructor.name ]);
|
|
};
|
|
exports["InputButton"] = InputButton;
|
|
exports["InputCheckbox"] = InputCheckbox;
|
|
exports["InputColor"] = InputColor;
|
|
exports["InputDate"] = InputDate;
|
|
exports["InputDatetimeLocal"] = InputDatetimeLocal;
|
|
exports["InputEmail"] = InputEmail;
|
|
exports["InputFile"] = InputFile;
|
|
exports["InputHidden"] = InputHidden;
|
|
exports["InputImage"] = InputImage;
|
|
exports["InputMonth"] = InputMonth;
|
|
exports["InputNumber"] = InputNumber;
|
|
exports["InputPassword"] = InputPassword;
|
|
exports["InputRadio"] = InputRadio;
|
|
exports["InputRange"] = InputRange;
|
|
exports["InputReset"] = InputReset;
|
|
exports["InputSearch"] = InputSearch;
|
|
exports["InputSubmit"] = InputSubmit;
|
|
exports["InputTel"] = InputTel;
|
|
exports["InputText"] = InputText;
|
|
exports["InputTime"] = InputTime;
|
|
exports["InputUrl"] = InputUrl;
|
|
exports["InputWeek"] = InputWeek;
|
|
exports["renderInputType"] = renderInputType;
|
|
})(PS["DOM.HTML.Indexed.InputType"] = PS["DOM.HTML.Indexed.InputType"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Prelude = PS["Prelude"];
|
|
var Profunctor = function (dimap) {
|
|
this.dimap = dimap;
|
|
};
|
|
var profunctorFn = new Profunctor(function (a2b) {
|
|
return function (c2d) {
|
|
return function (b2c) {
|
|
return function ($9) {
|
|
return c2d(b2c(a2b($9)));
|
|
};
|
|
};
|
|
};
|
|
});
|
|
var dimap = function (dict) {
|
|
return dict.dimap;
|
|
};
|
|
var rmap = function (dictProfunctor) {
|
|
return function (b2c) {
|
|
return dimap(dictProfunctor)(Control_Category.identity(Control_Category.categoryFn))(b2c);
|
|
};
|
|
};
|
|
exports["dimap"] = dimap;
|
|
exports["Profunctor"] = Profunctor;
|
|
exports["rmap"] = rmap;
|
|
exports["profunctorFn"] = profunctorFn;
|
|
})(PS["Data.Profunctor"] = PS["Data.Profunctor"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Profunctor = PS["Data.Profunctor"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var Strong = function (Profunctor0, first, second) {
|
|
this.Profunctor0 = Profunctor0;
|
|
this.first = first;
|
|
this.second = second;
|
|
};
|
|
var strongFn = new Strong(function () {
|
|
return Data_Profunctor.profunctorFn;
|
|
}, function (a2b) {
|
|
return function (v) {
|
|
return new Data_Tuple.Tuple(a2b(v.value0), v.value1);
|
|
};
|
|
}, Data_Functor.map(Data_Tuple.functorTuple));
|
|
var second = function (dict) {
|
|
return dict.second;
|
|
};
|
|
var first = function (dict) {
|
|
return dict.first;
|
|
};
|
|
exports["first"] = first;
|
|
exports["second"] = second;
|
|
exports["Strong"] = Strong;
|
|
exports["strongFn"] = strongFn;
|
|
})(PS["Data.Profunctor.Strong"] = PS["Data.Profunctor.Strong"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Const = PS["Data.Const"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Lens_Internal_Wander = PS["Data.Lens.Internal.Wander"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Profunctor = PS["Data.Profunctor"];
|
|
var Data_Profunctor_Choice = PS["Data.Profunctor.Choice"];
|
|
var Data_Profunctor_Cochoice = PS["Data.Profunctor.Cochoice"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var Forget = function (x) {
|
|
return x;
|
|
};
|
|
var profunctorForget = new Data_Profunctor.Profunctor(function (f) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
return function ($27) {
|
|
return v1(f($27));
|
|
};
|
|
};
|
|
};
|
|
});
|
|
var strongForget = new Data_Profunctor_Strong.Strong(function () {
|
|
return profunctorForget;
|
|
}, function (v) {
|
|
return function ($28) {
|
|
return v(Data_Tuple.fst($28));
|
|
};
|
|
}, function (v) {
|
|
return function ($29) {
|
|
return v(Data_Tuple.snd($29));
|
|
};
|
|
});
|
|
var newtypeForget = new Data_Newtype.Newtype(function (n) {
|
|
return n;
|
|
}, Forget);
|
|
exports["Forget"] = Forget;
|
|
exports["newtypeForget"] = newtypeForget;
|
|
exports["profunctorForget"] = profunctorForget;
|
|
exports["strongForget"] = strongForget;
|
|
})(PS["Data.Lens.Internal.Forget"] = PS["Data.Lens.Internal.Forget"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Lens_Internal_Forget = PS["Data.Lens.Internal.Forget"];
|
|
var Data_Lens_Internal_Indexed = PS["Data.Lens.Internal.Indexed"];
|
|
var Data_Lens_Types = PS["Data.Lens.Types"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var view = function (l) {
|
|
return Data_Newtype.unwrap(Data_Lens_Internal_Forget.newtypeForget)(l(Control_Category.identity(Control_Category.categoryFn)));
|
|
};
|
|
var viewOn = function (s) {
|
|
return function (l) {
|
|
return view(l)(s);
|
|
};
|
|
};
|
|
var use = function (dictMonadState) {
|
|
return function (p) {
|
|
return Control_Monad_State_Class.gets(dictMonadState)(function (v) {
|
|
return viewOn(v)(p);
|
|
});
|
|
};
|
|
};
|
|
exports["viewOn"] = viewOn;
|
|
exports["view"] = view;
|
|
exports["use"] = use;
|
|
})(PS["Data.Lens.Getter"] = PS["Data.Lens.Getter"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Lens_Internal_Indexed = PS["Data.Lens.Internal.Indexed"];
|
|
var Data_Lens_Internal_Shop = PS["Data.Lens.Internal.Shop"];
|
|
var Data_Lens_Types = PS["Data.Lens.Types"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Profunctor = PS["Data.Profunctor"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var lens$prime = function (to) {
|
|
return function (dictStrong) {
|
|
return function (pab) {
|
|
return Data_Profunctor.dimap(dictStrong.Profunctor0())(to)(function (v) {
|
|
return v.value1(v.value0);
|
|
})(Data_Profunctor_Strong.first(dictStrong)(pab));
|
|
};
|
|
};
|
|
};
|
|
var lens = function (get) {
|
|
return function (set) {
|
|
return function (dictStrong) {
|
|
return lens$prime(function (s) {
|
|
return new Data_Tuple.Tuple(get(s), function (b) {
|
|
return set(s)(b);
|
|
});
|
|
})(dictStrong);
|
|
};
|
|
};
|
|
};
|
|
exports["lens"] = lens;
|
|
})(PS["Data.Lens.Lens"] = PS["Data.Lens.Lens"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_EuclideanRing = PS["Data.EuclideanRing"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Lens_Internal_Indexed = PS["Data.Lens.Internal.Indexed"];
|
|
var Data_Lens_Types = PS["Data.Lens.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var over = function (l) {
|
|
return l;
|
|
};
|
|
var set = function (l) {
|
|
return function (b) {
|
|
return over(l)(Data_Function["const"](b));
|
|
};
|
|
};
|
|
var modifying = function (dictMonadState) {
|
|
return function (p) {
|
|
return function (f) {
|
|
return Data_Functor["void"]((((dictMonadState.Monad0()).Bind1()).Apply0()).Functor0())(Control_Monad_State_Class.modify(dictMonadState)(over(p)(f)));
|
|
};
|
|
};
|
|
};
|
|
var assign = function (dictMonadState) {
|
|
return function (p) {
|
|
return function (b) {
|
|
return Data_Functor["void"]((((dictMonadState.Monad0()).Bind1()).Apply0()).Functor0())(Control_Monad_State_Class.modify(dictMonadState)(set(p)(b)));
|
|
};
|
|
};
|
|
};
|
|
exports["over"] = over;
|
|
exports["set"] = set;
|
|
exports["assign"] = assign;
|
|
exports["modifying"] = modifying;
|
|
})(PS["Data.Lens.Setter"] = PS["Data.Lens.Setter"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_Cont_Trans = PS["Control.Monad.Cont.Trans"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Monad_List_Trans = PS["Control.Monad.List.Trans"];
|
|
var Control_Monad_Maybe_Trans = PS["Control.Monad.Maybe.Trans"];
|
|
var Control_Monad_RWS_Trans = PS["Control.Monad.RWS.Trans"];
|
|
var Control_Monad_Reader_Trans = PS["Control.Monad.Reader.Trans"];
|
|
var Control_Monad_State_Trans = PS["Control.Monad.State.Trans"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Monad_Writer_Trans = PS["Control.Monad.Writer.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Prelude = PS["Prelude"];
|
|
var MonadAff = function (MonadEffect0, liftAff) {
|
|
this.MonadEffect0 = MonadEffect0;
|
|
this.liftAff = liftAff;
|
|
};
|
|
var monadAffAff = new MonadAff(function () {
|
|
return Effect_Aff.monadEffectAff;
|
|
}, Control_Category.identity(Control_Category.categoryFn));
|
|
var liftAff = function (dict) {
|
|
return dict.liftAff;
|
|
};
|
|
exports["liftAff"] = liftAff;
|
|
exports["MonadAff"] = MonadAff;
|
|
exports["monadAffAff"] = monadAffAff;
|
|
})(PS["Effect.Aff.Class"] = PS["Effect.Aff.Class"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Prelude = PS["Prelude"];
|
|
var OrdBox = (function () {
|
|
function OrdBox(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
OrdBox.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new OrdBox(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return OrdBox;
|
|
})();
|
|
var unOrdBox = function (v) {
|
|
return v.value2;
|
|
};
|
|
var mkOrdBox = function (dictOrd) {
|
|
return OrdBox.create(Data_Eq.eq(dictOrd.Eq0()))(Data_Ord.compare(dictOrd));
|
|
};
|
|
var eqOrdBox = new Data_Eq.Eq(function (v) {
|
|
return function (v1) {
|
|
return v.value0(v.value2)(v1.value2);
|
|
};
|
|
});
|
|
var ordOrdBox = new Data_Ord.Ord(function () {
|
|
return eqOrdBox;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
return v.value1(v.value2)(v1.value2);
|
|
};
|
|
});
|
|
exports["mkOrdBox"] = mkOrdBox;
|
|
exports["unOrdBox"] = unOrdBox;
|
|
exports["eqOrdBox"] = eqOrdBox;
|
|
exports["ordOrdBox"] = ordOrdBox;
|
|
})(PS["Halogen.Data.OrdBox"] = PS["Halogen.Data.OrdBox"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var ButtonButton = (function () {
|
|
function ButtonButton() {
|
|
|
|
};
|
|
ButtonButton.value = new ButtonButton();
|
|
return ButtonButton;
|
|
})();
|
|
var ButtonSubmit = (function () {
|
|
function ButtonSubmit() {
|
|
|
|
};
|
|
ButtonSubmit.value = new ButtonSubmit();
|
|
return ButtonSubmit;
|
|
})();
|
|
var ButtonReset = (function () {
|
|
function ButtonReset() {
|
|
|
|
};
|
|
ButtonReset.value = new ButtonReset();
|
|
return ButtonReset;
|
|
})();
|
|
var renderButtonType = function (v) {
|
|
if (v instanceof ButtonButton) {
|
|
return "button";
|
|
};
|
|
if (v instanceof ButtonSubmit) {
|
|
return "submit";
|
|
};
|
|
if (v instanceof ButtonReset) {
|
|
return "reset";
|
|
};
|
|
throw new Error("Failed pattern match at DOM.HTML.Indexed.ButtonType (line 9, column 20 - line 12, column 18): " + [ v.constructor.name ]);
|
|
};
|
|
exports["ButtonButton"] = ButtonButton;
|
|
exports["ButtonSubmit"] = ButtonSubmit;
|
|
exports["ButtonReset"] = ButtonReset;
|
|
exports["renderButtonType"] = renderButtonType;
|
|
})(PS["DOM.HTML.Indexed.ButtonType"] = PS["DOM.HTML.Indexed.ButtonType"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var On = (function () {
|
|
function On() {
|
|
|
|
};
|
|
On.value = new On();
|
|
return On;
|
|
})();
|
|
var Off = (function () {
|
|
function Off() {
|
|
|
|
};
|
|
Off.value = new Off();
|
|
return Off;
|
|
})();
|
|
var renderOnOff = function (v) {
|
|
if (v instanceof On) {
|
|
return "on";
|
|
};
|
|
if (v instanceof Off) {
|
|
return "off";
|
|
};
|
|
throw new Error("Failed pattern match at DOM.HTML.Indexed.OnOff (line 8, column 15 - line 10, column 10): " + [ v.constructor.name ]);
|
|
};
|
|
exports["On"] = On;
|
|
exports["Off"] = Off;
|
|
exports["renderOnOff"] = renderOnOff;
|
|
})(PS["DOM.HTML.Indexed.OnOff"] = PS["DOM.HTML.Indexed.OnOff"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var RefUpdate = (function () {
|
|
function RefUpdate(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
RefUpdate.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new RefUpdate(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return RefUpdate;
|
|
})();
|
|
var Query = (function () {
|
|
function Query(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Query.create = function (value0) {
|
|
return new Query(value0);
|
|
};
|
|
return Query;
|
|
})();
|
|
var bifunctorInputF = new Data_Bifunctor.Bifunctor(function (f) {
|
|
return function (g) {
|
|
return function (v) {
|
|
if (v instanceof RefUpdate) {
|
|
return new RefUpdate(v.value0, v.value1, f(v.value2));
|
|
};
|
|
if (v instanceof Query) {
|
|
return new Query(g(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Query.InputF (line 21, column 15 - line 23, column 27): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
});
|
|
var functorInputF = new Data_Functor.Functor(Data_Bifunctor.rmap(bifunctorInputF));
|
|
exports["RefUpdate"] = RefUpdate;
|
|
exports["Query"] = Query;
|
|
exports["bifunctorInputF"] = bifunctorInputF;
|
|
exports["functorInputF"] = functorInputF;
|
|
})(PS["Halogen.Query.InputF"] = PS["Halogen.Query.InputF"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Effect = PS["Effect"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Prelude = PS["Prelude"];
|
|
var Step = (function () {
|
|
function Step(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
Step.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new Step(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return Step;
|
|
})();
|
|
var step = function (v) {
|
|
return v.value1;
|
|
};
|
|
var halt = function (v) {
|
|
return v.value2;
|
|
};
|
|
var extract = function (v) {
|
|
return v.value0;
|
|
};
|
|
exports["Step"] = Step;
|
|
exports["extract"] = extract;
|
|
exports["step"] = step;
|
|
exports["halt"] = halt;
|
|
})(PS["Halogen.VDom.Machine"] = PS["Halogen.VDom.Machine"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var ElemSpec = (function () {
|
|
function ElemSpec(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
ElemSpec.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new ElemSpec(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return ElemSpec;
|
|
})();
|
|
var Text = (function () {
|
|
function Text(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Text.create = function (value0) {
|
|
return new Text(value0);
|
|
};
|
|
return Text;
|
|
})();
|
|
var Elem = (function () {
|
|
function Elem(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Elem.create = function (value0) {
|
|
return function (value1) {
|
|
return new Elem(value0, value1);
|
|
};
|
|
};
|
|
return Elem;
|
|
})();
|
|
var Keyed = (function () {
|
|
function Keyed(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Keyed.create = function (value0) {
|
|
return function (value1) {
|
|
return new Keyed(value0, value1);
|
|
};
|
|
};
|
|
return Keyed;
|
|
})();
|
|
var Widget = (function () {
|
|
function Widget(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Widget.create = function (value0) {
|
|
return new Widget(value0);
|
|
};
|
|
return Widget;
|
|
})();
|
|
var Grafted = (function () {
|
|
function Grafted(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Grafted.create = function (value0) {
|
|
return new Grafted(value0);
|
|
};
|
|
return Grafted;
|
|
})();
|
|
var Graft = (function () {
|
|
function Graft(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
Graft.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new Graft(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return Graft;
|
|
})();
|
|
var unGraft = function (f) {
|
|
return function ($90) {
|
|
return f($90);
|
|
};
|
|
};
|
|
var graft = Unsafe_Coerce.unsafeCoerce;
|
|
var functorElemSpec = new Data_Functor.Functor(function (f) {
|
|
return function (m) {
|
|
return new ElemSpec(m.value0, m.value1, f(m.value2));
|
|
};
|
|
});
|
|
var bifunctorGraft = new Data_Bifunctor.Bifunctor(function (f) {
|
|
return function (g) {
|
|
return unGraft(function (v) {
|
|
return graft(new Graft(function ($92) {
|
|
return f(v.value0($92));
|
|
}, function ($93) {
|
|
return g(v.value1($93));
|
|
}, v.value2));
|
|
});
|
|
};
|
|
});
|
|
var bifunctorVDom = new Data_Bifunctor.Bifunctor(function (f) {
|
|
return function (g) {
|
|
return function (v) {
|
|
if (v instanceof Text) {
|
|
return new Text(v.value0);
|
|
};
|
|
if (v instanceof Grafted) {
|
|
return new Grafted(Data_Bifunctor.bimap(bifunctorGraft)(f)(g)(v.value0));
|
|
};
|
|
return new Grafted(graft(new Graft(f, g, v)));
|
|
};
|
|
};
|
|
});
|
|
var runGraft = unGraft(function (v) {
|
|
var go = function (v2) {
|
|
if (v2 instanceof Text) {
|
|
return new Text(v2.value0);
|
|
};
|
|
if (v2 instanceof Elem) {
|
|
return new Elem(Data_Functor.map(functorElemSpec)(v.value0)(v2.value0), Data_Functor.map(Data_Functor.functorArray)(go)(v2.value1));
|
|
};
|
|
if (v2 instanceof Keyed) {
|
|
return new Keyed(Data_Functor.map(functorElemSpec)(v.value0)(v2.value0), Data_Functor.map(Data_Functor.functorArray)(Data_Functor.map(Data_Tuple.functorTuple)(go))(v2.value1));
|
|
};
|
|
if (v2 instanceof Widget) {
|
|
return new Widget(v.value1(v2.value0));
|
|
};
|
|
if (v2 instanceof Grafted) {
|
|
return new Grafted(Data_Bifunctor.bimap(bifunctorGraft)(v.value0)(v.value1)(v2.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.Types (line 74, column 7 - line 74, column 27): " + [ v2.constructor.name ]);
|
|
};
|
|
return go(v.value2);
|
|
});
|
|
exports["Text"] = Text;
|
|
exports["Elem"] = Elem;
|
|
exports["Keyed"] = Keyed;
|
|
exports["Widget"] = Widget;
|
|
exports["Grafted"] = Grafted;
|
|
exports["Graft"] = Graft;
|
|
exports["graft"] = graft;
|
|
exports["unGraft"] = unGraft;
|
|
exports["runGraft"] = runGraft;
|
|
exports["ElemSpec"] = ElemSpec;
|
|
exports["bifunctorVDom"] = bifunctorVDom;
|
|
exports["bifunctorGraft"] = bifunctorGraft;
|
|
exports["functorElemSpec"] = functorElemSpec;
|
|
})(PS["Halogen.VDom.Types"] = PS["Halogen.VDom.Types"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.unsafeGetAny = function (key, obj) {
|
|
return obj[key];
|
|
};
|
|
|
|
exports.unsafeHasAny = function (key, obj) {
|
|
return obj.hasOwnProperty(key);
|
|
};
|
|
|
|
exports.unsafeSetAny = function (key, val, obj) {
|
|
obj[key] = val;
|
|
};
|
|
|
|
exports.forE = function (a, f) {
|
|
var b = [];
|
|
for (var i = 0; i < a.length; i++) {
|
|
b.push(f(i, a[i]));
|
|
}
|
|
return b;
|
|
};
|
|
|
|
exports.forInE = function (o, f) {
|
|
var ks = Object.keys(o);
|
|
for (var i = 0; i < ks.length; i++) {
|
|
var k = ks[i];
|
|
f(k, o[k]);
|
|
}
|
|
};
|
|
|
|
exports.diffWithIxE = function (a1, a2, f1, f2, f3) {
|
|
var a3 = [];
|
|
var l1 = a1.length;
|
|
var l2 = a2.length;
|
|
var i = 0;
|
|
while (1) {
|
|
if (i < l1) {
|
|
if (i < l2) {
|
|
a3.push(f1(i, a1[i], a2[i]));
|
|
} else {
|
|
f2(i, a1[i]);
|
|
}
|
|
} else if (i < l2) {
|
|
a3.push(f3(i, a2[i]));
|
|
} else {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
return a3;
|
|
};
|
|
|
|
exports.strMapWithIxE = function (as, fk, f) {
|
|
var o = {};
|
|
for (var i = 0; i < as.length; i++) {
|
|
var a = as[i];
|
|
var k = fk(a);
|
|
o[k] = f(k, i, a);
|
|
}
|
|
return o;
|
|
};
|
|
|
|
exports.diffWithKeyAndIxE = function (o1, as, fk, f1, f2, f3) {
|
|
var o2 = {};
|
|
for (var i = 0; i < as.length; i++) {
|
|
var a = as[i];
|
|
var k = fk(a);
|
|
if (o1.hasOwnProperty(k)) {
|
|
o2[k] = f1(k, i, o1[k], a);
|
|
} else {
|
|
o2[k] = f3(k, i, a);
|
|
}
|
|
}
|
|
for (var k in o1) {
|
|
if (k in o2) {
|
|
continue;
|
|
}
|
|
f2(k, o1[k]);
|
|
}
|
|
return o2;
|
|
};
|
|
|
|
exports.refEq = function (a, b) {
|
|
return a === b;
|
|
};
|
|
|
|
exports.createTextNode = function (s, doc) {
|
|
return doc.createTextNode(s);
|
|
};
|
|
|
|
exports.setTextContent = function (s, n) {
|
|
n.textContent = s;
|
|
};
|
|
|
|
exports.createElement = function (ns, name, doc) {
|
|
if (ns != null) {
|
|
return doc.createElementNS(ns, name);
|
|
} else {
|
|
return doc.createElement(name)
|
|
}
|
|
};
|
|
|
|
exports.insertChildIx = function (i, a, b) {
|
|
var n = b.childNodes.item(i) || null;
|
|
if (n !== a) {
|
|
b.insertBefore(a, n);
|
|
}
|
|
};
|
|
|
|
exports.removeChild = function (a, b) {
|
|
if (b && a.parentNode === b) {
|
|
b.removeChild(a);
|
|
}
|
|
};
|
|
|
|
exports.parentNode = function (a) {
|
|
return a.parentNode;
|
|
};
|
|
|
|
exports.setAttribute = function (ns, attr, val, el) {
|
|
if (ns != null) {
|
|
el.setAttributeNS(ns, attr, val);
|
|
} else {
|
|
el.setAttribute(attr, val);
|
|
}
|
|
};
|
|
|
|
exports.removeAttribute = function (ns, attr, el) {
|
|
if (ns != null) {
|
|
el.removeAttributeNS(ns, attr);
|
|
} else {
|
|
el.removeAttribute(attr);
|
|
}
|
|
};
|
|
|
|
exports.addEventListener = function (ev, listener, el) {
|
|
el.addEventListener(ev, listener, false);
|
|
};
|
|
|
|
exports.removeEventListener = function (ev, listener, el) {
|
|
el.removeEventListener(ev, listener, false);
|
|
};
|
|
|
|
exports.jsUndefined = void 0;
|
|
})(PS["Halogen.VDom.Util"] = PS["Halogen.VDom.Util"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
var getEffProp = function (name) {
|
|
return function (node) {
|
|
return function () {
|
|
return node[name];
|
|
};
|
|
};
|
|
};
|
|
|
|
exports._parentNode = getEffProp("parentNode");
|
|
|
|
exports._nextSibling = getEffProp("nextSibling");
|
|
|
|
exports.insertBefore = function (node1) {
|
|
return function (node2) {
|
|
return function (parent) {
|
|
return function () {
|
|
return parent.insertBefore(node1, node2);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.appendChild = function (node) {
|
|
return function (parent) {
|
|
return function () {
|
|
return parent.appendChild(node);
|
|
};
|
|
};
|
|
};
|
|
|
|
exports.removeChild = function (node) {
|
|
return function (parent) {
|
|
return function () {
|
|
return parent.removeChild(node);
|
|
};
|
|
};
|
|
};
|
|
})(PS["Web.DOM.Node"] = PS["Web.DOM.Node"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Web.DOM.Node"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Enum = PS["Data.Enum"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Effect = PS["Effect"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_Internal_Types = PS["Web.DOM.Internal.Types"];
|
|
var Web_DOM_NodeType = PS["Web.DOM.NodeType"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Web_Internal_FFI = PS["Web.Internal.FFI"];
|
|
var parentNode = function ($2) {
|
|
return Data_Functor.map(Effect.functorEffect)(Data_Nullable.toMaybe)($foreign["_parentNode"]($2));
|
|
};
|
|
var nextSibling = function ($6) {
|
|
return Data_Functor.map(Effect.functorEffect)(Data_Nullable.toMaybe)($foreign["_nextSibling"]($6));
|
|
};
|
|
exports["parentNode"] = parentNode;
|
|
exports["nextSibling"] = nextSibling;
|
|
exports["insertBefore"] = $foreign.insertBefore;
|
|
exports["appendChild"] = $foreign.appendChild;
|
|
exports["removeChild"] = $foreign.removeChild;
|
|
})(PS["Web.DOM.Node"] = PS["Web.DOM.Node"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Halogen.VDom.Util"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Foreign_Object = PS["Foreign.Object"];
|
|
var Foreign_Object_ST = PS["Foreign.Object.ST"];
|
|
var Halogen_VDom_Types = PS["Halogen.VDom.Types"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_Node = PS["Web.DOM.Node"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var unsafeLookup = $foreign.unsafeGetAny;
|
|
var unsafeFreeze = Unsafe_Coerce.unsafeCoerce;
|
|
var pokeMutMap = $foreign.unsafeSetAny;
|
|
var newMutMap = Foreign_Object_ST["new"];
|
|
var effectUnit = Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit);
|
|
exports["effectUnit"] = effectUnit;
|
|
exports["newMutMap"] = newMutMap;
|
|
exports["pokeMutMap"] = pokeMutMap;
|
|
exports["unsafeFreeze"] = unsafeFreeze;
|
|
exports["unsafeLookup"] = unsafeLookup;
|
|
exports["unsafeGetAny"] = $foreign.unsafeGetAny;
|
|
exports["unsafeHasAny"] = $foreign.unsafeHasAny;
|
|
exports["unsafeSetAny"] = $foreign.unsafeSetAny;
|
|
exports["forE"] = $foreign.forE;
|
|
exports["forInE"] = $foreign.forInE;
|
|
exports["diffWithIxE"] = $foreign.diffWithIxE;
|
|
exports["diffWithKeyAndIxE"] = $foreign.diffWithKeyAndIxE;
|
|
exports["strMapWithIxE"] = $foreign.strMapWithIxE;
|
|
exports["refEq"] = $foreign.refEq;
|
|
exports["createTextNode"] = $foreign.createTextNode;
|
|
exports["setTextContent"] = $foreign.setTextContent;
|
|
exports["createElement"] = $foreign.createElement;
|
|
exports["insertChildIx"] = $foreign.insertChildIx;
|
|
exports["removeChild"] = $foreign.removeChild;
|
|
exports["parentNode"] = $foreign.parentNode;
|
|
exports["setAttribute"] = $foreign.setAttribute;
|
|
exports["removeAttribute"] = $foreign.removeAttribute;
|
|
exports["addEventListener"] = $foreign.addEventListener;
|
|
exports["removeEventListener"] = $foreign.removeEventListener;
|
|
exports["jsUndefined"] = $foreign.jsUndefined;
|
|
})(PS["Halogen.VDom.Util"] = PS["Halogen.VDom.Util"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Foreign = PS["Foreign"];
|
|
var Foreign_Object = PS["Foreign.Object"];
|
|
var Halogen_VDom = PS["Halogen.VDom"];
|
|
var Halogen_VDom_Machine = PS["Halogen.VDom.Machine"];
|
|
var Halogen_VDom_Types = PS["Halogen.VDom.Types"];
|
|
var Halogen_VDom_Util = PS["Halogen.VDom.Util"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Created = (function () {
|
|
function Created(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Created.create = function (value0) {
|
|
return new Created(value0);
|
|
};
|
|
return Created;
|
|
})();
|
|
var Removed = (function () {
|
|
function Removed(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Removed.create = function (value0) {
|
|
return new Removed(value0);
|
|
};
|
|
return Removed;
|
|
})();
|
|
var Attribute = (function () {
|
|
function Attribute(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
Attribute.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new Attribute(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return Attribute;
|
|
})();
|
|
var Property = (function () {
|
|
function Property(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Property.create = function (value0) {
|
|
return function (value1) {
|
|
return new Property(value0, value1);
|
|
};
|
|
};
|
|
return Property;
|
|
})();
|
|
var Handler = (function () {
|
|
function Handler(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Handler.create = function (value0) {
|
|
return function (value1) {
|
|
return new Handler(value0, value1);
|
|
};
|
|
};
|
|
return Handler;
|
|
})();
|
|
var Ref = (function () {
|
|
function Ref(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Ref.create = function (value0) {
|
|
return new Ref(value0);
|
|
};
|
|
return Ref;
|
|
})();
|
|
var unsafeGetProperty = Halogen_VDom_Util.unsafeGetAny;
|
|
var setProperty = Halogen_VDom_Util.unsafeSetAny;
|
|
var removeProperty = function (key, el) {
|
|
var v = Foreign.typeOf(Halogen_VDom_Util.unsafeGetAny(key, el));
|
|
if (v === "string") {
|
|
return Halogen_VDom_Util.unsafeSetAny(key, "", el);
|
|
};
|
|
if (key === "rowSpan") {
|
|
return Halogen_VDom_Util.unsafeSetAny(key, 1, el);
|
|
};
|
|
if (key === "colSpan") {
|
|
return Halogen_VDom_Util.unsafeSetAny(key, 1, el);
|
|
};
|
|
return Halogen_VDom_Util.unsafeSetAny(key, Halogen_VDom_Util.jsUndefined, el);
|
|
};
|
|
var propToStrKey = function (v) {
|
|
if (v instanceof Attribute && v.value0 instanceof Data_Maybe.Just) {
|
|
return "attr/" + (v.value0.value0 + (":" + v.value1));
|
|
};
|
|
if (v instanceof Attribute) {
|
|
return "attr/:" + v.value1;
|
|
};
|
|
if (v instanceof Property) {
|
|
return "prop/" + v.value0;
|
|
};
|
|
if (v instanceof Handler) {
|
|
return "handler/" + v.value0;
|
|
};
|
|
if (v instanceof Ref) {
|
|
return "ref";
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 178, column 16 - line 185, column 1): " + [ v.constructor.name ]);
|
|
};
|
|
var propFromString = Unsafe_Coerce.unsafeCoerce;
|
|
var propFromInt = Unsafe_Coerce.unsafeCoerce;
|
|
var propFromBoolean = Unsafe_Coerce.unsafeCoerce;
|
|
var functorProp = new Data_Functor.Functor(function (f) {
|
|
return function (v) {
|
|
if (v instanceof Handler) {
|
|
return new Handler(v.value0, Data_Functor.map(Data_Functor.functorFn)(Data_Functor.map(Data_Maybe.functorMaybe)(f))(v.value1));
|
|
};
|
|
if (v instanceof Ref) {
|
|
return new Ref(Data_Functor.map(Data_Functor.functorFn)(Data_Functor.map(Data_Maybe.functorMaybe)(f))(v.value0));
|
|
};
|
|
return v;
|
|
};
|
|
});
|
|
var buildProp = function (emit) {
|
|
return function (el) {
|
|
var removeProp = function (prevEvents) {
|
|
return function (v, v1) {
|
|
if (v1 instanceof Attribute) {
|
|
return Halogen_VDom_Util.removeAttribute(Data_Nullable.toNullable(v1.value0), v1.value1, el);
|
|
};
|
|
if (v1 instanceof Property) {
|
|
return removeProperty(v1.value0, el);
|
|
};
|
|
if (v1 instanceof Handler) {
|
|
var handler = Halogen_VDom_Util.unsafeLookup(v1.value0, prevEvents);
|
|
return Halogen_VDom_Util.removeEventListener(v1.value0, Data_Tuple.fst(handler), el);
|
|
};
|
|
if (v1 instanceof Ref) {
|
|
return Data_Unit.unit;
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 165, column 5 - line 175, column 18): " + [ v1.constructor.name ]);
|
|
};
|
|
};
|
|
var mbEmit = function (v) {
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return emit(v.value0)();
|
|
};
|
|
return Data_Unit.unit;
|
|
};
|
|
var done = function (ps) {
|
|
var v = Foreign_Object.lookup("ref")(ps);
|
|
if (v instanceof Data_Maybe.Just && v.value0 instanceof Ref) {
|
|
return function () {
|
|
return mbEmit(v.value0.value0(new Removed(el)));
|
|
};
|
|
};
|
|
return Halogen_VDom_Util.effectUnit;
|
|
};
|
|
var diffProp = function (prevEvents, events) {
|
|
return function (v, v1, v11, v2) {
|
|
if (v11 instanceof Attribute && v2 instanceof Attribute) {
|
|
var $61 = v11.value2 === v2.value2;
|
|
if ($61) {
|
|
return v2;
|
|
};
|
|
Halogen_VDom_Util.setAttribute(Data_Nullable.toNullable(v2.value0), v2.value1, v2.value2, el);
|
|
return v2;
|
|
};
|
|
if (v11 instanceof Property && v2 instanceof Property) {
|
|
var v4 = Halogen_VDom_Util.refEq(v11.value1, v2.value1);
|
|
if (v4) {
|
|
return v2;
|
|
};
|
|
if (v2.value0 === "value") {
|
|
var elVal = unsafeGetProperty("value", el);
|
|
var $70 = Halogen_VDom_Util.refEq(elVal, v2.value1);
|
|
if ($70) {
|
|
return v2;
|
|
};
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
};
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
};
|
|
if (v11 instanceof Handler && v2 instanceof Handler) {
|
|
var handler = Halogen_VDom_Util.unsafeLookup(v2.value0, prevEvents);
|
|
Effect_Ref.write(v2.value1)(Data_Tuple.snd(handler))();
|
|
Halogen_VDom_Util.pokeMutMap(v2.value0, handler, events);
|
|
return v2;
|
|
};
|
|
return v2;
|
|
};
|
|
};
|
|
var applyProp = function (events) {
|
|
return function (v, v1, v2) {
|
|
if (v2 instanceof Attribute) {
|
|
Halogen_VDom_Util.setAttribute(Data_Nullable.toNullable(v2.value0), v2.value1, v2.value2, el);
|
|
return v2;
|
|
};
|
|
if (v2 instanceof Property) {
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
};
|
|
if (v2 instanceof Handler) {
|
|
var v3 = Halogen_VDom_Util.unsafeGetAny(v2.value0, events);
|
|
if (Halogen_VDom_Util.unsafeHasAny(v2.value0, events)) {
|
|
Effect_Ref.write(v2.value1)(Data_Tuple.snd(v3))();
|
|
return v2;
|
|
};
|
|
var v4 = Effect_Ref["new"](v2.value1)();
|
|
var v5 = Web_Event_EventTarget.eventListener(function (ev) {
|
|
return function __do() {
|
|
var v5 = Effect_Ref.read(v4)();
|
|
return mbEmit(v5(ev));
|
|
};
|
|
})();
|
|
Halogen_VDom_Util.pokeMutMap(v2.value0, new Data_Tuple.Tuple(v5, v4), events);
|
|
Halogen_VDom_Util.addEventListener(v2.value0, v5, el);
|
|
return v2;
|
|
};
|
|
if (v2 instanceof Ref) {
|
|
mbEmit(v2.value0(new Created(el)));
|
|
return v2;
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 109, column 5 - line 131, column 15): " + [ v2.constructor.name ]);
|
|
};
|
|
};
|
|
var patch = function (prevEvents, ps1) {
|
|
return function (ps2) {
|
|
var v = Halogen_VDom_Util.newMutMap();
|
|
var onThis = removeProp(prevEvents);
|
|
var onThese = diffProp(prevEvents, v);
|
|
var onThat = applyProp(v);
|
|
var v1 = Halogen_VDom_Util.diffWithKeyAndIxE(ps1, ps2, propToStrKey, onThese, onThis, onThat);
|
|
return new Halogen_VDom_Machine.Step(Data_Unit.unit, patch(Halogen_VDom_Util.unsafeFreeze(v), v1), done(v1));
|
|
};
|
|
};
|
|
var render = function (ps1) {
|
|
var v = Halogen_VDom_Util.newMutMap();
|
|
var v1 = Halogen_VDom_Util.strMapWithIxE(ps1, propToStrKey, applyProp(v));
|
|
return new Halogen_VDom_Machine.Step(Data_Unit.unit, patch(Halogen_VDom_Util.unsafeFreeze(v), v1), done(v1));
|
|
};
|
|
return render;
|
|
};
|
|
};
|
|
exports["Attribute"] = Attribute;
|
|
exports["Property"] = Property;
|
|
exports["Handler"] = Handler;
|
|
exports["Ref"] = Ref;
|
|
exports["Created"] = Created;
|
|
exports["Removed"] = Removed;
|
|
exports["propFromString"] = propFromString;
|
|
exports["propFromBoolean"] = propFromBoolean;
|
|
exports["propFromInt"] = propFromInt;
|
|
exports["buildProp"] = buildProp;
|
|
exports["functorProp"] = functorProp;
|
|
})(PS["Halogen.VDom.DOM.Prop"] = PS["Halogen.VDom.DOM.Prop"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed_ButtonType = PS["DOM.HTML.Indexed.ButtonType"];
|
|
var DOM_HTML_Indexed_CrossOriginValue = PS["DOM.HTML.Indexed.CrossOriginValue"];
|
|
var DOM_HTML_Indexed_DirValue = PS["DOM.HTML.Indexed.DirValue"];
|
|
var DOM_HTML_Indexed_FormMethod = PS["DOM.HTML.Indexed.FormMethod"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var DOM_HTML_Indexed_KindValue = PS["DOM.HTML.Indexed.KindValue"];
|
|
var DOM_HTML_Indexed_MenuType = PS["DOM.HTML.Indexed.MenuType"];
|
|
var DOM_HTML_Indexed_MenuitemType = PS["DOM.HTML.Indexed.MenuitemType"];
|
|
var DOM_HTML_Indexed_OnOff = PS["DOM.HTML.Indexed.OnOff"];
|
|
var DOM_HTML_Indexed_OrderedListType = PS["DOM.HTML.Indexed.OrderedListType"];
|
|
var DOM_HTML_Indexed_PreloadValue = PS["DOM.HTML.Indexed.PreloadValue"];
|
|
var DOM_HTML_Indexed_ScopeValue = PS["DOM.HTML.Indexed.ScopeValue"];
|
|
var DOM_HTML_Indexed_StepValue = PS["DOM.HTML.Indexed.StepValue"];
|
|
var DOM_HTML_Indexed_WrapValue = PS["DOM.HTML.Indexed.WrapValue"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Halogen_VDom = PS["Halogen.VDom"];
|
|
var Halogen_VDom_DOM_Prop = PS["Halogen.VDom.DOM.Prop"];
|
|
var Halogen_VDom_Types = PS["Halogen.VDom.Types"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var HTML = function (x) {
|
|
return x;
|
|
};
|
|
var ClassName = function (x) {
|
|
return x;
|
|
};
|
|
var IsProp = function (toPropValue) {
|
|
this.toPropValue = toPropValue;
|
|
};
|
|
var toPropValue = function (dict) {
|
|
return dict.toPropValue;
|
|
};
|
|
var text = function ($27) {
|
|
return HTML(Halogen_VDom_Types.Text.create($27));
|
|
};
|
|
var stringIsProp = new IsProp(Halogen_VDom_DOM_Prop.propFromString);
|
|
var slot = function ($29) {
|
|
return HTML(Halogen_VDom_Types.Widget.create($29));
|
|
};
|
|
var ref = function (f) {
|
|
return Halogen_VDom_DOM_Prop.Ref.create(function ($31) {
|
|
return f((function (v) {
|
|
if (v instanceof Halogen_VDom_DOM_Prop.Created) {
|
|
return new Data_Maybe.Just(v.value0);
|
|
};
|
|
if (v instanceof Halogen_VDom_DOM_Prop.Removed) {
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.HTML.Core (line 103, column 21 - line 105, column 23): " + [ v.constructor.name ]);
|
|
})($31));
|
|
});
|
|
};
|
|
var prop = function (dictIsProp) {
|
|
return function (v) {
|
|
return function ($32) {
|
|
return Halogen_VDom_DOM_Prop.Property.create(v)(toPropValue(dictIsProp)($32));
|
|
};
|
|
};
|
|
};
|
|
var onOffIsProp = new IsProp(function ($35) {
|
|
return Halogen_VDom_DOM_Prop.propFromString(DOM_HTML_Indexed_OnOff.renderOnOff($35));
|
|
});
|
|
var newtypeClassName = new Data_Newtype.Newtype(function (n) {
|
|
return n;
|
|
}, ClassName);
|
|
var intIsProp = new IsProp(Halogen_VDom_DOM_Prop.propFromInt);
|
|
var inputTypeIsProp = new IsProp(function ($40) {
|
|
return Halogen_VDom_DOM_Prop.propFromString(DOM_HTML_Indexed_InputType.renderInputType($40));
|
|
});
|
|
var handler = Halogen_VDom_DOM_Prop.Handler.create;
|
|
var element = function (ns) {
|
|
return function (name) {
|
|
return function (props) {
|
|
return function (children) {
|
|
return new Halogen_VDom_Types.Elem(new Halogen_VDom_Types.ElemSpec(ns, name, props), children);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var buttonTypeIsProp = new IsProp(function ($44) {
|
|
return Halogen_VDom_DOM_Prop.propFromString(DOM_HTML_Indexed_ButtonType.renderButtonType($44));
|
|
});
|
|
var booleanIsProp = new IsProp(Halogen_VDom_DOM_Prop.propFromBoolean);
|
|
var bifunctorHTML = new Data_Bifunctor.Bifunctor(function (f) {
|
|
return function (g) {
|
|
return function (v) {
|
|
return Data_Bifunctor.bimap(Halogen_VDom_Types.bifunctorVDom)(Data_Functor.map(Data_Functor.functorArray)(Data_Functor.map(Halogen_VDom_DOM_Prop.functorProp)(Data_Functor.map(Halogen_Query_InputF.functorInputF)(g))))(f)(v);
|
|
};
|
|
};
|
|
});
|
|
var attr = function (ns) {
|
|
return function (v) {
|
|
return Halogen_VDom_DOM_Prop.Attribute.create(ns)(v);
|
|
};
|
|
};
|
|
exports["HTML"] = HTML;
|
|
exports["slot"] = slot;
|
|
exports["text"] = text;
|
|
exports["element"] = element;
|
|
exports["prop"] = prop;
|
|
exports["attr"] = attr;
|
|
exports["handler"] = handler;
|
|
exports["ref"] = ref;
|
|
exports["IsProp"] = IsProp;
|
|
exports["toPropValue"] = toPropValue;
|
|
exports["ClassName"] = ClassName;
|
|
exports["bifunctorHTML"] = bifunctorHTML;
|
|
exports["stringIsProp"] = stringIsProp;
|
|
exports["intIsProp"] = intIsProp;
|
|
exports["booleanIsProp"] = booleanIsProp;
|
|
exports["buttonTypeIsProp"] = buttonTypeIsProp;
|
|
exports["inputTypeIsProp"] = inputTypeIsProp;
|
|
exports["onOffIsProp"] = onOffIsProp;
|
|
exports["newtypeClassName"] = newtypeClassName;
|
|
})(PS["Halogen.HTML.Core"] = PS["Halogen.HTML.Core"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Const = PS["Data.Const"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_NonEmpty = PS["Data.List.NonEmpty"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_NonEmpty = PS["Data.NonEmpty"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Pure = (function () {
|
|
function Pure(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Pure.create = function (value0) {
|
|
return new Pure(value0);
|
|
};
|
|
return Pure;
|
|
})();
|
|
var Lift = (function () {
|
|
function Lift(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Lift.create = function (value0) {
|
|
return new Lift(value0);
|
|
};
|
|
return Lift;
|
|
})();
|
|
var Ap = (function () {
|
|
function Ap(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Ap.create = function (value0) {
|
|
return function (value1) {
|
|
return new Ap(value0, value1);
|
|
};
|
|
};
|
|
return Ap;
|
|
})();
|
|
var mkAp = function (fba) {
|
|
return function (fb) {
|
|
return new Ap(fba, fb);
|
|
};
|
|
};
|
|
var liftFreeAp = Lift.create;
|
|
var goLeft = function ($copy_dictApplicative) {
|
|
return function ($copy_fStack) {
|
|
return function ($copy_valStack) {
|
|
return function ($copy_nat) {
|
|
return function ($copy_func) {
|
|
return function ($copy_count) {
|
|
var $tco_var_dictApplicative = $copy_dictApplicative;
|
|
var $tco_var_fStack = $copy_fStack;
|
|
var $tco_var_valStack = $copy_valStack;
|
|
var $tco_var_nat = $copy_nat;
|
|
var $tco_var_func = $copy_func;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(dictApplicative, fStack, valStack, nat, func, count) {
|
|
if (func instanceof Pure) {
|
|
$tco_done = true;
|
|
return new Data_Tuple.Tuple(new Data_List_Types.Cons({
|
|
func: Control_Applicative.pure(dictApplicative)(func.value0),
|
|
count: count
|
|
}, fStack), valStack);
|
|
};
|
|
if (func instanceof Lift) {
|
|
$tco_done = true;
|
|
return new Data_Tuple.Tuple(new Data_List_Types.Cons({
|
|
func: nat(func.value0),
|
|
count: count
|
|
}, fStack), valStack);
|
|
};
|
|
if (func instanceof Ap) {
|
|
$tco_var_dictApplicative = dictApplicative;
|
|
$tco_var_fStack = fStack;
|
|
$tco_var_valStack = Data_List_NonEmpty.cons(func.value1)(valStack);
|
|
$tco_var_nat = nat;
|
|
$tco_var_func = func.value0;
|
|
$copy_count = count + 1 | 0;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 102, column 41 - line 105, column 81): " + [ func.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_dictApplicative, $tco_var_fStack, $tco_var_valStack, $tco_var_nat, $tco_var_func, $copy_count);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var goApply = function ($copy_dictApplicative) {
|
|
return function ($copy_fStack) {
|
|
return function ($copy_vals) {
|
|
return function ($copy_gVal) {
|
|
var $tco_var_dictApplicative = $copy_dictApplicative;
|
|
var $tco_var_fStack = $copy_fStack;
|
|
var $tco_var_vals = $copy_vals;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(dictApplicative, fStack, vals, gVal) {
|
|
if (fStack instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return new Data_Either.Left(gVal);
|
|
};
|
|
if (fStack instanceof Data_List_Types.Cons) {
|
|
var gRes = Control_Apply.apply(dictApplicative.Apply0())(fStack.value0.func)(gVal);
|
|
var $14 = fStack.value0.count === 1;
|
|
if ($14) {
|
|
if (fStack.value1 instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return new Data_Either.Left(gRes);
|
|
};
|
|
$tco_var_dictApplicative = dictApplicative;
|
|
$tco_var_fStack = fStack.value1;
|
|
$tco_var_vals = vals;
|
|
$copy_gVal = gRes;
|
|
return;
|
|
};
|
|
if (vals instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return new Data_Either.Left(gRes);
|
|
};
|
|
if (vals instanceof Data_List_Types.Cons) {
|
|
$tco_done = true;
|
|
return Data_Either.Right.create(new Data_Tuple.Tuple(new Data_List_Types.Cons({
|
|
func: gRes,
|
|
count: fStack.value0.count - 1 | 0
|
|
}, fStack.value1), new Data_NonEmpty.NonEmpty(vals.value0, vals.value1)));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 83, column 11 - line 88, column 50): " + [ vals.constructor.name ]);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 72, column 3 - line 88, column 50): " + [ fStack.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_dictApplicative, $tco_var_fStack, $tco_var_vals, $copy_gVal);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var functorFreeAp = new Data_Functor.Functor(function (f) {
|
|
return function (x) {
|
|
return mkAp(new Pure(f))(x);
|
|
};
|
|
});
|
|
var foldFreeAp = function (dictApplicative) {
|
|
return function (nat) {
|
|
return function (z) {
|
|
var go = function ($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v.value1.value0 instanceof Pure) {
|
|
var v1 = goApply(dictApplicative)(v.value0)(v.value1.value1)(Control_Applicative.pure(dictApplicative)(v.value1.value0.value0));
|
|
if (v1 instanceof Data_Either.Left) {
|
|
$tco_done = true;
|
|
return v1.value0;
|
|
};
|
|
if (v1 instanceof Data_Either.Right) {
|
|
$copy_v = v1.value0;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 54, column 17 - line 56, column 24): " + [ v1.constructor.name ]);
|
|
};
|
|
if (v.value1.value0 instanceof Lift) {
|
|
var v1 = goApply(dictApplicative)(v.value0)(v.value1.value1)(nat(v.value1.value0.value0));
|
|
if (v1 instanceof Data_Either.Left) {
|
|
$tco_done = true;
|
|
return v1.value0;
|
|
};
|
|
if (v1 instanceof Data_Either.Right) {
|
|
$copy_v = v1.value0;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 57, column 17 - line 59, column 24): " + [ v1.constructor.name ]);
|
|
};
|
|
if (v.value1.value0 instanceof Ap) {
|
|
var nextVals = new Data_NonEmpty.NonEmpty(v.value1.value0.value1, v.value1.value1);
|
|
$copy_v = goLeft(dictApplicative)(v.value0)(nextVals)(nat)(v.value1.value0.value0)(1);
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 53, column 5 - line 64, column 1): " + [ v.value1.value0.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
return go(new Data_Tuple.Tuple(Data_List_Types.Nil.value, Data_List_NonEmpty.singleton(z)));
|
|
};
|
|
};
|
|
};
|
|
var retractFreeAp = function (dictApplicative) {
|
|
return foldFreeAp(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
var applyFreeAp = new Control_Apply.Apply(function () {
|
|
return functorFreeAp;
|
|
}, function (fba) {
|
|
return function (fb) {
|
|
return mkAp(fba)(fb);
|
|
};
|
|
});
|
|
var applicativeFreeAp = new Control_Applicative.Applicative(function () {
|
|
return applyFreeAp;
|
|
}, Pure.create);
|
|
var hoistFreeAp = function (f) {
|
|
return foldFreeAp(applicativeFreeAp)(function ($37) {
|
|
return liftFreeAp(f($37));
|
|
});
|
|
};
|
|
exports["liftFreeAp"] = liftFreeAp;
|
|
exports["retractFreeAp"] = retractFreeAp;
|
|
exports["foldFreeAp"] = foldFreeAp;
|
|
exports["hoistFreeAp"] = hoistFreeAp;
|
|
exports["functorFreeAp"] = functorFreeAp;
|
|
exports["applyFreeAp"] = applyFreeAp;
|
|
exports["applicativeFreeAp"] = applicativeFreeAp;
|
|
})(PS["Control.Applicative.Free"] = PS["Control.Applicative.Free"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Prelude = PS["Prelude"];
|
|
var CatQueue = (function () {
|
|
function CatQueue(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
CatQueue.create = function (value0) {
|
|
return function (value1) {
|
|
return new CatQueue(value0, value1);
|
|
};
|
|
};
|
|
return CatQueue;
|
|
})();
|
|
var uncons = function ($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v.value0 instanceof Data_List_Types.Nil && v.value1 instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
if (v.value0 instanceof Data_List_Types.Nil) {
|
|
$copy_v = new CatQueue(Data_List.reverse(v.value1), Data_List_Types.Nil.value);
|
|
return;
|
|
};
|
|
if (v.value0 instanceof Data_List_Types.Cons) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(v.value0.value0, new CatQueue(v.value0.value1, v.value1)));
|
|
};
|
|
throw new Error("Failed pattern match at Data.CatQueue (line 83, column 1 - line 83, column 63): " + [ v.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
var snoc = function (v) {
|
|
return function (a) {
|
|
return new CatQueue(v.value0, new Data_List_Types.Cons(a, v.value1));
|
|
};
|
|
};
|
|
var $$null = function (v) {
|
|
if (v.value0 instanceof Data_List_Types.Nil && v.value1 instanceof Data_List_Types.Nil) {
|
|
return true;
|
|
};
|
|
return false;
|
|
};
|
|
var empty = new CatQueue(Data_List_Types.Nil.value, Data_List_Types.Nil.value);
|
|
exports["CatQueue"] = CatQueue;
|
|
exports["empty"] = empty;
|
|
exports["null"] = $$null;
|
|
exports["snoc"] = snoc;
|
|
exports["uncons"] = uncons;
|
|
})(PS["Data.CatQueue"] = PS["Data.CatQueue"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Data_CatQueue = PS["Data.CatQueue"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unfoldable1 = PS["Data.Unfoldable1"];
|
|
var Prelude = PS["Prelude"];
|
|
var CatNil = (function () {
|
|
function CatNil() {
|
|
|
|
};
|
|
CatNil.value = new CatNil();
|
|
return CatNil;
|
|
})();
|
|
var CatCons = (function () {
|
|
function CatCons(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
CatCons.create = function (value0) {
|
|
return function (value1) {
|
|
return new CatCons(value0, value1);
|
|
};
|
|
};
|
|
return CatCons;
|
|
})();
|
|
var link = function (v) {
|
|
return function (cat) {
|
|
if (v instanceof CatNil) {
|
|
return cat;
|
|
};
|
|
if (v instanceof CatCons) {
|
|
return new CatCons(v.value0, Data_CatQueue.snoc(v.value1)(cat));
|
|
};
|
|
throw new Error("Failed pattern match at Data.CatList (line 111, column 1 - line 111, column 54): " + [ v.constructor.name, cat.constructor.name ]);
|
|
};
|
|
};
|
|
var foldr = function (k) {
|
|
return function (b) {
|
|
return function (q) {
|
|
var foldl = function ($copy_v) {
|
|
return function ($copy_c) {
|
|
return function ($copy_v1) {
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_var_c = $copy_c;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v, c, v1) {
|
|
if (v1 instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return c;
|
|
};
|
|
if (v1 instanceof Data_List_Types.Cons) {
|
|
$tco_var_v = v;
|
|
$tco_var_c = v(c)(v1.value0);
|
|
$copy_v1 = v1.value1;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.CatList (line 126, column 3 - line 126, column 59): " + [ v.constructor.name, c.constructor.name, v1.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v, $tco_var_c, $copy_v1);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
};
|
|
var go = function ($copy_xs) {
|
|
return function ($copy_ys) {
|
|
var $tco_var_xs = $copy_xs;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(xs, ys) {
|
|
var v = Data_CatQueue.uncons(xs);
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
$tco_done = true;
|
|
return foldl(function (x) {
|
|
return function (i) {
|
|
return i(x);
|
|
};
|
|
})(b)(ys);
|
|
};
|
|
if (v instanceof Data_Maybe.Just) {
|
|
$tco_var_xs = v.value0.value1;
|
|
$copy_ys = new Data_List_Types.Cons(k(v.value0.value0), ys);
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.CatList (line 122, column 14 - line 124, column 67): " + [ v.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_xs, $copy_ys);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go(q)(Data_List_Types.Nil.value);
|
|
};
|
|
};
|
|
};
|
|
var uncons = function (v) {
|
|
if (v instanceof CatNil) {
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
if (v instanceof CatCons) {
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(v.value0, (function () {
|
|
var $45 = Data_CatQueue["null"](v.value1);
|
|
if ($45) {
|
|
return CatNil.value;
|
|
};
|
|
return foldr(link)(CatNil.value)(v.value1);
|
|
})()));
|
|
};
|
|
throw new Error("Failed pattern match at Data.CatList (line 102, column 1 - line 102, column 61): " + [ v.constructor.name ]);
|
|
};
|
|
var empty = CatNil.value;
|
|
var append = function (v) {
|
|
return function (v1) {
|
|
if (v1 instanceof CatNil) {
|
|
return v;
|
|
};
|
|
if (v instanceof CatNil) {
|
|
return v1;
|
|
};
|
|
return link(v)(v1);
|
|
};
|
|
};
|
|
var semigroupCatList = new Data_Semigroup.Semigroup(append);
|
|
var snoc = function (cat) {
|
|
return function (a) {
|
|
return append(cat)(new CatCons(a, Data_CatQueue.empty));
|
|
};
|
|
};
|
|
exports["CatNil"] = CatNil;
|
|
exports["CatCons"] = CatCons;
|
|
exports["empty"] = empty;
|
|
exports["append"] = append;
|
|
exports["snoc"] = snoc;
|
|
exports["uncons"] = uncons;
|
|
exports["semigroupCatList"] = semigroupCatList;
|
|
})(PS["Data.CatList"] = PS["Data.CatList"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_CatList = PS["Data.CatList"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Free = (function () {
|
|
function Free(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Free.create = function (value0) {
|
|
return function (value1) {
|
|
return new Free(value0, value1);
|
|
};
|
|
};
|
|
return Free;
|
|
})();
|
|
var Return = (function () {
|
|
function Return(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Return.create = function (value0) {
|
|
return new Return(value0);
|
|
};
|
|
return Return;
|
|
})();
|
|
var Bind = (function () {
|
|
function Bind(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Bind.create = function (value0) {
|
|
return function (value1) {
|
|
return new Bind(value0, value1);
|
|
};
|
|
};
|
|
return Bind;
|
|
})();
|
|
var toView = function ($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
var runExpF = function (v2) {
|
|
return v2;
|
|
};
|
|
var concatF = function (v2) {
|
|
return function (r) {
|
|
return new Free(v2.value0, Data_Semigroup.append(Data_CatList.semigroupCatList)(v2.value1)(r));
|
|
};
|
|
};
|
|
if (v.value0 instanceof Return) {
|
|
var v2 = Data_CatList.uncons(v.value1);
|
|
if (v2 instanceof Data_Maybe.Nothing) {
|
|
$tco_done = true;
|
|
return new Return(v.value0.value0);
|
|
};
|
|
if (v2 instanceof Data_Maybe.Just) {
|
|
$copy_v = concatF(runExpF(v2.value0.value0)(v.value0.value0))(v2.value0.value1);
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 220, column 7 - line 224, column 64): " + [ v2.constructor.name ]);
|
|
};
|
|
if (v.value0 instanceof Bind) {
|
|
$tco_done = true;
|
|
return new Bind(v.value0.value0, function (a) {
|
|
return concatF(v.value0.value1(a))(v.value1);
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 218, column 3 - line 226, column 56): " + [ v.value0.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
var fromView = function (f) {
|
|
return new Free(f, Data_CatList.empty);
|
|
};
|
|
var freeMonad = new Control_Monad.Monad(function () {
|
|
return freeApplicative;
|
|
}, function () {
|
|
return freeBind;
|
|
});
|
|
var freeFunctor = new Data_Functor.Functor(function (k) {
|
|
return function (f) {
|
|
return Control_Bind.bindFlipped(freeBind)(function ($118) {
|
|
return Control_Applicative.pure(freeApplicative)(k($118));
|
|
})(f);
|
|
};
|
|
});
|
|
var freeBind = new Control_Bind.Bind(function () {
|
|
return freeApply;
|
|
}, function (v) {
|
|
return function (k) {
|
|
return new Free(v.value0, Data_CatList.snoc(v.value1)(k));
|
|
};
|
|
});
|
|
var freeApply = new Control_Apply.Apply(function () {
|
|
return freeFunctor;
|
|
}, Control_Monad.ap(freeMonad));
|
|
var freeApplicative = new Control_Applicative.Applicative(function () {
|
|
return freeApply;
|
|
}, function ($119) {
|
|
return fromView(Return.create($119));
|
|
});
|
|
var liftF = function (f) {
|
|
return fromView(new Bind(f, function ($120) {
|
|
return Control_Applicative.pure(freeApplicative)($120);
|
|
}));
|
|
};
|
|
var foldFree = function (dictMonadRec) {
|
|
return function (k) {
|
|
var go = function (f) {
|
|
var v = toView(f);
|
|
if (v instanceof Return) {
|
|
return Data_Functor.map((((dictMonadRec.Monad0()).Bind1()).Apply0()).Functor0())(Control_Monad_Rec_Class.Done.create)(Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(v.value0));
|
|
};
|
|
if (v instanceof Bind) {
|
|
return Data_Functor.map((((dictMonadRec.Monad0()).Bind1()).Apply0()).Functor0())(function ($127) {
|
|
return Control_Monad_Rec_Class.Loop.create(v.value1($127));
|
|
})(k(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 151, column 10 - line 153, column 37): " + [ v.constructor.name ]);
|
|
};
|
|
return Control_Monad_Rec_Class.tailRecM(dictMonadRec)(go);
|
|
};
|
|
};
|
|
exports["liftF"] = liftF;
|
|
exports["foldFree"] = foldFree;
|
|
exports["freeFunctor"] = freeFunctor;
|
|
exports["freeBind"] = freeBind;
|
|
exports["freeApplicative"] = freeApplicative;
|
|
exports["freeApply"] = freeApply;
|
|
exports["freeMonad"] = freeMonad;
|
|
})(PS["Control.Monad.Free"] = PS["Control.Monad.Free"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var runExists = Unsafe_Coerce.unsafeCoerce;
|
|
var mkExists = Unsafe_Coerce.unsafeCoerce;
|
|
exports["mkExists"] = mkExists;
|
|
exports["runExists"] = runExists;
|
|
})(PS["Data.Exists"] = PS["Data.Exists"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Alt = PS["Control.Alt"];
|
|
var Control_Alternative = PS["Control.Alternative"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Comonad = PS["Control.Comonad"];
|
|
var Control_Extend = PS["Control.Extend"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_MonadPlus = PS["Control.MonadPlus"];
|
|
var Control_MonadZero = PS["Control.MonadZero"];
|
|
var Control_Plus = PS["Control.Plus"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Distributive = PS["Data.Distributive"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Exists = PS["Data.Exists"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Functor_Invariant = PS["Data.Functor.Invariant"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semigroup_Foldable = PS["Data.Semigroup.Foldable"];
|
|
var Data_Semigroup_Traversable = PS["Data.Semigroup.Traversable"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Prelude = PS["Prelude"];
|
|
var unCoyoneda = function (f) {
|
|
return function (v) {
|
|
return Data_Exists.runExists(function (v1) {
|
|
return f(v1.value0)(v1.value1);
|
|
})(v);
|
|
};
|
|
};
|
|
exports["unCoyoneda"] = unCoyoneda;
|
|
})(PS["Data.Coyoneda"] = PS["Data.Coyoneda"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Reader_Class = PS["Control.Monad.Reader.Class"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Monad_Writer_Class = PS["Control.Monad.Writer.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Exists = PS["Data.Exists"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Prelude = PS["Prelude"];
|
|
var Bound = (function () {
|
|
function Bound(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Bound.create = function (value0) {
|
|
return function (value1) {
|
|
return new Bound(value0, value1);
|
|
};
|
|
};
|
|
return Bound;
|
|
})();
|
|
var FreeT = (function () {
|
|
function FreeT(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
FreeT.create = function (value0) {
|
|
return new FreeT(value0);
|
|
};
|
|
return FreeT;
|
|
})();
|
|
var Bind = (function () {
|
|
function Bind(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Bind.create = function (value0) {
|
|
return new Bind(value0);
|
|
};
|
|
return Bind;
|
|
})();
|
|
var monadTransFreeT = function (dictFunctor) {
|
|
return new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
|
|
return function (ma) {
|
|
return new FreeT(function (v) {
|
|
return Data_Functor.map(((dictMonad.Bind1()).Apply0()).Functor0())(Data_Either.Left.create)(ma);
|
|
});
|
|
};
|
|
});
|
|
};
|
|
var freeT = FreeT.create;
|
|
var bound = function (m) {
|
|
return function (f) {
|
|
return new Bind(Data_Exists.mkExists(new Bound(m, f)));
|
|
};
|
|
};
|
|
var functorFreeT = function (dictFunctor) {
|
|
return function (dictFunctor1) {
|
|
return new Data_Functor.Functor(function (f) {
|
|
return function (v) {
|
|
if (v instanceof FreeT) {
|
|
return new FreeT(function (v1) {
|
|
return Data_Functor.map(dictFunctor1)(Data_Bifunctor.bimap(Data_Either.bifunctorEither)(f)(Data_Functor.map(dictFunctor)(Data_Functor.map(functorFreeT(dictFunctor)(dictFunctor1))(f))))(v.value0(Data_Unit.unit));
|
|
});
|
|
};
|
|
if (v instanceof Bind) {
|
|
return Data_Exists.runExists(function (v1) {
|
|
return bound(v1.value0)(function ($104) {
|
|
return Data_Functor.map(functorFreeT(dictFunctor)(dictFunctor1))(f)(v1.value1($104));
|
|
});
|
|
})(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 57, column 1 - line 57, column 71): " + [ f.constructor.name, v.constructor.name ]);
|
|
};
|
|
});
|
|
};
|
|
};
|
|
var monadFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return new Control_Monad.Monad(function () {
|
|
return applicativeFreeT(dictFunctor)(dictMonad);
|
|
}, function () {
|
|
return bindFreeT(dictFunctor)(dictMonad);
|
|
});
|
|
};
|
|
};
|
|
var bindFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return new Control_Bind.Bind(function () {
|
|
return applyFreeT(dictFunctor)(dictMonad);
|
|
}, function (v) {
|
|
return function (f) {
|
|
if (v instanceof Bind) {
|
|
return Data_Exists.runExists(function (v1) {
|
|
return bound(v1.value0)(function (x) {
|
|
return bound(function (v2) {
|
|
return v1.value1(x);
|
|
})(f);
|
|
});
|
|
})(v.value0);
|
|
};
|
|
return bound(function (v1) {
|
|
return v;
|
|
})(f);
|
|
};
|
|
});
|
|
};
|
|
};
|
|
var applyFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return new Control_Apply.Apply(function () {
|
|
return functorFreeT(dictFunctor)(((dictMonad.Bind1()).Apply0()).Functor0());
|
|
}, Control_Monad.ap(monadFreeT(dictFunctor)(dictMonad)));
|
|
};
|
|
};
|
|
var applicativeFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return new Control_Applicative.Applicative(function () {
|
|
return applyFreeT(dictFunctor)(dictMonad);
|
|
}, function (a) {
|
|
return new FreeT(function (v) {
|
|
return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Left(a));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var liftFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return function (fa) {
|
|
return new FreeT(function (v) {
|
|
return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Right(Data_Functor.map(dictFunctor)(Control_Applicative.pure(applicativeFreeT(dictFunctor)(dictMonad)))(fa)));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var resume = function (dictFunctor) {
|
|
return function (dictMonadRec) {
|
|
var go = function (v) {
|
|
if (v instanceof FreeT) {
|
|
return Data_Functor.map((((dictMonadRec.Monad0()).Bind1()).Apply0()).Functor0())(Control_Monad_Rec_Class.Done.create)(v.value0(Data_Unit.unit));
|
|
};
|
|
if (v instanceof Bind) {
|
|
return Data_Exists.runExists(function (v1) {
|
|
var v2 = v1.value0(Data_Unit.unit);
|
|
if (v2 instanceof FreeT) {
|
|
return Control_Bind.bind((dictMonadRec.Monad0()).Bind1())(v2.value0(Data_Unit.unit))(function (v3) {
|
|
if (v3 instanceof Data_Either.Left) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Control_Monad_Rec_Class.Loop(v1.value1(v3.value0)));
|
|
};
|
|
if (v3 instanceof Data_Either.Right) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Control_Monad_Rec_Class.Done(new Data_Either.Right(Data_Functor.map(dictFunctor)(function (h) {
|
|
return Control_Bind.bind(bindFreeT(dictFunctor)(dictMonadRec.Monad0()))(h)(v1.value1);
|
|
})(v3.value0))));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 52, column 20 - line 54, column 67): " + [ v3.constructor.name ]);
|
|
});
|
|
};
|
|
if (v2 instanceof Bind) {
|
|
return Data_Exists.runExists(function (v3) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Control_Monad_Rec_Class.Loop(Control_Bind.bind(bindFreeT(dictFunctor)(dictMonadRec.Monad0()))(v3.value0(Data_Unit.unit))(function (z) {
|
|
return Control_Bind.bind(bindFreeT(dictFunctor)(dictMonadRec.Monad0()))(v3.value1(z))(v1.value1);
|
|
})));
|
|
})(v2.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 50, column 5 - line 55, column 98): " + [ v2.constructor.name ]);
|
|
})(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 47, column 3 - line 47, column 75): " + [ v.constructor.name ]);
|
|
};
|
|
return Control_Monad_Rec_Class.tailRecM(dictMonadRec)(go);
|
|
};
|
|
};
|
|
var runFreeT = function (dictFunctor) {
|
|
return function (dictMonadRec) {
|
|
return function (interp) {
|
|
var go = function (v) {
|
|
if (v instanceof Data_Either.Left) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Control_Monad_Rec_Class.Done(v.value0));
|
|
};
|
|
if (v instanceof Data_Either.Right) {
|
|
return Data_Functor.map((((dictMonadRec.Monad0()).Bind1()).Apply0()).Functor0())(Control_Monad_Rec_Class.Loop.create)(interp(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 126, column 3 - line 126, column 63): " + [ v.constructor.name ]);
|
|
};
|
|
return Control_Monad_Rec_Class.tailRecM(dictMonadRec)(Control_Bind.composeKleisliFlipped((dictMonadRec.Monad0()).Bind1())(go)(resume(dictFunctor)(dictMonadRec)));
|
|
};
|
|
};
|
|
};
|
|
var monadRecFreeT = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return new Control_Monad_Rec_Class.MonadRec(function () {
|
|
return monadFreeT(dictFunctor)(dictMonad);
|
|
}, function (f) {
|
|
var go = function (s) {
|
|
return Control_Bind.bind(bindFreeT(dictFunctor)(dictMonad))(f(s))(function (v) {
|
|
if (v instanceof Control_Monad_Rec_Class.Loop) {
|
|
return go(v.value0);
|
|
};
|
|
if (v instanceof Control_Monad_Rec_Class.Done) {
|
|
return Control_Applicative.pure(applicativeFreeT(dictFunctor)(dictMonad))(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Control.Monad.Free.Trans (line 80, column 15 - line 82, column 25): " + [ v.constructor.name ]);
|
|
});
|
|
};
|
|
return go;
|
|
});
|
|
};
|
|
};
|
|
exports["freeT"] = freeT;
|
|
exports["liftFreeT"] = liftFreeT;
|
|
exports["resume"] = resume;
|
|
exports["runFreeT"] = runFreeT;
|
|
exports["functorFreeT"] = functorFreeT;
|
|
exports["applyFreeT"] = applyFreeT;
|
|
exports["applicativeFreeT"] = applicativeFreeT;
|
|
exports["bindFreeT"] = bindFreeT;
|
|
exports["monadFreeT"] = monadFreeT;
|
|
exports["monadTransFreeT"] = monadTransFreeT;
|
|
exports["monadRecFreeT"] = monadRecFreeT;
|
|
})(PS["Control.Monad.Free.Trans"] = PS["Control.Monad.Free.Trans"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_Except = PS["Control.Monad.Except"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Monad_Free_Trans = PS["Control.Monad.Free.Trans"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Parallel_Class = PS["Control.Parallel.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Profunctor = PS["Data.Profunctor"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Prelude = PS["Prelude"];
|
|
var Emit = (function () {
|
|
function Emit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Emit.create = function (value0) {
|
|
return function (value1) {
|
|
return new Emit(value0, value1);
|
|
};
|
|
};
|
|
return Emit;
|
|
})();
|
|
var runProcess = function (dictMonadRec) {
|
|
return Control_Monad_Free_Trans.runFreeT(Data_Identity.functorIdentity)(dictMonadRec)(function ($186) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(Data_Newtype.unwrap(Data_Identity.newtypeIdentity)($186));
|
|
});
|
|
};
|
|
var profunctorAwait = new Data_Profunctor.Profunctor(function (f) {
|
|
return function (g) {
|
|
return function (v) {
|
|
return Data_Profunctor.dimap(Data_Profunctor.profunctorFn)(f)(g)(v);
|
|
};
|
|
};
|
|
});
|
|
var loop = function (dictFunctor) {
|
|
return function (dictMonad) {
|
|
return function (me) {
|
|
return Control_Monad_Rec_Class.tailRecM(Control_Monad_Free_Trans.monadRecFreeT(dictFunctor)(dictMonad))(function (v) {
|
|
return Data_Functor.map(Control_Monad_Free_Trans.functorFreeT(dictFunctor)(((dictMonad.Bind1()).Apply0()).Functor0()))(Data_Maybe.maybe(new Control_Monad_Rec_Class.Loop(Data_Unit.unit))(Control_Monad_Rec_Class.Done.create))(me);
|
|
})(Data_Unit.unit);
|
|
};
|
|
};
|
|
};
|
|
var fuseWithL = function (dictFunctor) {
|
|
return function (dictFunctor1) {
|
|
return function (dictFunctor2) {
|
|
return function (dictMonadRec) {
|
|
return function (zap) {
|
|
return function (fs) {
|
|
return function (gs) {
|
|
var go = function (v) {
|
|
return Control_Monad_Except_Trans.runExceptT(Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(dictMonadRec.Monad0()))(Control_Monad_Except_Trans.ExceptT(Control_Monad_Free_Trans.resume(dictFunctor)(dictMonadRec)(v.value0)))(function (v1) {
|
|
return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(dictMonadRec.Monad0()))(Control_Monad_Except_Trans.ExceptT(Control_Monad_Free_Trans.resume(dictFunctor1)(dictMonadRec)(v.value1)))(function (v2) {
|
|
return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(dictMonadRec.Monad0()))(Data_Functor.map(dictFunctor2)(function (t) {
|
|
return Control_Monad_Free_Trans.freeT(function (v3) {
|
|
return go(t);
|
|
});
|
|
})(zap(Data_Tuple.Tuple.create)(v1)(v2)));
|
|
});
|
|
}));
|
|
};
|
|
return Control_Monad_Free_Trans.freeT(function (v) {
|
|
return go(new Data_Tuple.Tuple(fs, gs));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var fuseWith = function (dictFunctor) {
|
|
return function (dictFunctor1) {
|
|
return function (dictFunctor2) {
|
|
return function (dictMonadRec) {
|
|
return function (dictParallel) {
|
|
return function (zap) {
|
|
return function (fs) {
|
|
return function (gs) {
|
|
var go = function (v) {
|
|
return Control_Bind.bind((dictMonadRec.Monad0()).Bind1())(Control_Parallel_Class.sequential(dictParallel)(Control_Apply.apply((dictParallel.Applicative1()).Apply0())(Data_Functor.map(((dictParallel.Applicative1()).Apply0()).Functor0())(Control_Apply.lift2(Data_Either.applyEither)(zap(Data_Tuple.Tuple.create)))(Control_Parallel_Class.parallel(dictParallel)(Control_Monad_Free_Trans.resume(dictFunctor)(dictMonadRec)(v.value0))))(Control_Parallel_Class.parallel(dictParallel)(Control_Monad_Free_Trans.resume(dictFunctor1)(dictMonadRec)(v.value1)))))(function (v1) {
|
|
if (v1 instanceof Data_Either.Left) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Data_Either.Left(v1.value0));
|
|
};
|
|
if (v1 instanceof Data_Either.Right) {
|
|
return Control_Applicative.pure((dictMonadRec.Monad0()).Applicative0())(new Data_Either.Right(Data_Functor.map(dictFunctor2)(function (t) {
|
|
return Control_Monad_Free_Trans.freeT(function (v2) {
|
|
return go(t);
|
|
});
|
|
})(v1.value0)));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Coroutine (line 79, column 5 - line 81, column 63): " + [ v1.constructor.name ]);
|
|
});
|
|
};
|
|
return Control_Monad_Free_Trans.freeT(function (v) {
|
|
return go(new Data_Tuple.Tuple(fs, gs));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var functorAwait = new Data_Functor.Functor(Data_Profunctor.rmap(profunctorAwait));
|
|
var bifunctorEmit = new Data_Bifunctor.Bifunctor(function (f) {
|
|
return function (g) {
|
|
return function (v) {
|
|
return new Emit(f(v.value0), g(v.value1));
|
|
};
|
|
};
|
|
});
|
|
var functorEmit = new Data_Functor.Functor(Data_Bifunctor.rmap(bifunctorEmit));
|
|
var connect = function (dictMonadRec) {
|
|
return function (dictParallel) {
|
|
return fuseWith(functorEmit)(functorAwait)(Data_Identity.functorIdentity)(dictMonadRec)(dictParallel)(function (f) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
return f(v.value1)(v1(v.value0));
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
var emit = function (dictMonad) {
|
|
return function (o) {
|
|
return Control_Monad_Free_Trans.liftFreeT(functorEmit)(dictMonad)(new Emit(o, Data_Unit.unit));
|
|
};
|
|
};
|
|
var producer = function (dictMonad) {
|
|
return function (recv) {
|
|
return loop(functorEmit)(dictMonad)(Control_Bind.bind(Control_Monad_Free_Trans.bindFreeT(functorEmit)(dictMonad))(Control_Monad_Trans_Class.lift(Control_Monad_Free_Trans.monadTransFreeT(functorEmit))(dictMonad)(recv))(function (v) {
|
|
if (v instanceof Data_Either.Left) {
|
|
return Data_Functor.voidLeft(Control_Monad_Free_Trans.functorFreeT(functorEmit)(((dictMonad.Bind1()).Apply0()).Functor0()))(emit(dictMonad)(v.value0))(Data_Maybe.Nothing.value);
|
|
};
|
|
if (v instanceof Data_Either.Right) {
|
|
return Control_Applicative.pure(Control_Monad_Free_Trans.applicativeFreeT(functorEmit)(dictMonad))(new Data_Maybe.Just(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Control.Coroutine (line 125, column 3 - line 127, column 29): " + [ v.constructor.name ]);
|
|
}));
|
|
};
|
|
};
|
|
var pullFrom = function (dictMonadRec) {
|
|
return fuseWithL(functorAwait)(functorEmit)(Data_Identity.functorIdentity)(dictMonadRec)(function (f) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
return Control_Applicative.pure(Data_Identity.applicativeIdentity)(f(v(v1.value0))(v1.value1));
|
|
};
|
|
};
|
|
});
|
|
};
|
|
var $$await = function (dictMonad) {
|
|
return Control_Monad_Free_Trans.liftFreeT(functorAwait)(dictMonad)(Control_Category.identity(Control_Category.categoryFn));
|
|
};
|
|
exports["loop"] = loop;
|
|
exports["runProcess"] = runProcess;
|
|
exports["fuseWith"] = fuseWith;
|
|
exports["fuseWithL"] = fuseWithL;
|
|
exports["Emit"] = Emit;
|
|
exports["emit"] = emit;
|
|
exports["producer"] = producer;
|
|
exports["await"] = $$await;
|
|
exports["connect"] = connect;
|
|
exports["pullFrom"] = pullFrom;
|
|
exports["bifunctorEmit"] = bifunctorEmit;
|
|
exports["functorEmit"] = functorEmit;
|
|
exports["profunctorAwait"] = profunctorAwait;
|
|
exports["functorAwait"] = functorAwait;
|
|
})(PS["Control.Coroutine"] = PS["Control.Coroutine"] || {});
|
|
(function(exports) {
|
|
/* globals exports, setTimeout */
|
|
"use strict";
|
|
|
|
var AVar = function () {
|
|
|
|
function MutableQueue () {
|
|
this.head = null;
|
|
this.last = null;
|
|
this.size = 0;
|
|
}
|
|
|
|
function MutableCell (queue, value) {
|
|
this.queue = queue;
|
|
this.value = value;
|
|
this.next = null;
|
|
this.prev = null;
|
|
}
|
|
|
|
function AVar (value) {
|
|
this.draining = false;
|
|
this.error = null;
|
|
this.value = value;
|
|
this.takes = new MutableQueue();
|
|
this.reads = new MutableQueue();
|
|
this.puts = new MutableQueue();
|
|
}
|
|
|
|
var EMPTY = {};
|
|
|
|
function runEff(eff) {
|
|
try {
|
|
eff();
|
|
} catch (error) {
|
|
setTimeout(function () {
|
|
throw error;
|
|
}, 0);
|
|
}
|
|
}
|
|
|
|
function putLast (queue, value) {
|
|
var cell = new MutableCell(queue, value);
|
|
switch (queue.size) {
|
|
case 0:
|
|
queue.head = cell;
|
|
break;
|
|
case 1:
|
|
cell.prev = queue.head;
|
|
queue.head.next = cell;
|
|
queue.last = cell;
|
|
break;
|
|
default:
|
|
cell.prev = queue.last;
|
|
queue.last.next = cell;
|
|
queue.last = cell;
|
|
}
|
|
queue.size++;
|
|
return cell;
|
|
}
|
|
|
|
function takeLast (queue) {
|
|
var cell;
|
|
switch (queue.size) {
|
|
case 0:
|
|
return null;
|
|
case 1:
|
|
cell = queue.head;
|
|
queue.head = null;
|
|
break;
|
|
case 2:
|
|
cell = queue.last;
|
|
queue.head.next = null;
|
|
queue.last = null;
|
|
break;
|
|
default:
|
|
cell = queue.last;
|
|
queue.last = cell.prev;
|
|
queue.last.next = null;
|
|
}
|
|
cell.prev = null;
|
|
cell.queue = null;
|
|
queue.size--;
|
|
return cell.value;
|
|
}
|
|
|
|
function takeHead (queue) {
|
|
var cell;
|
|
switch (queue.size) {
|
|
case 0:
|
|
return null;
|
|
case 1:
|
|
cell = queue.head;
|
|
queue.head = null;
|
|
break;
|
|
case 2:
|
|
cell = queue.head;
|
|
queue.last.prev = null;
|
|
queue.head = queue.last;
|
|
queue.last = null;
|
|
break;
|
|
default:
|
|
cell = queue.head;
|
|
queue.head = cell.next;
|
|
queue.head.prev = null;
|
|
}
|
|
cell.next = null;
|
|
cell.queue = null;
|
|
queue.size--;
|
|
return cell.value;
|
|
}
|
|
|
|
function deleteCell (cell) {
|
|
if (cell.queue === null) {
|
|
return;
|
|
}
|
|
if (cell.queue.last === cell) {
|
|
takeLast(cell.queue);
|
|
return;
|
|
}
|
|
if (cell.queue.head === cell) {
|
|
takeHead(cell.queue);
|
|
return;
|
|
}
|
|
if (cell.prev) {
|
|
cell.prev.next = cell.next;
|
|
}
|
|
if (cell.next) {
|
|
cell.next.prev = cell.prev;
|
|
}
|
|
cell.queue.size--;
|
|
cell.queue = null;
|
|
cell.value = null;
|
|
cell.next = null;
|
|
cell.prev = null;
|
|
}
|
|
|
|
function drainVar (util, avar) {
|
|
if (avar.draining) {
|
|
return;
|
|
}
|
|
|
|
var ps = avar.puts;
|
|
var ts = avar.takes;
|
|
var rs = avar.reads;
|
|
var p, r, t, value, rsize;
|
|
|
|
avar.draining = true;
|
|
|
|
while (1) { // eslint-disable-line no-constant-condition
|
|
p = null;
|
|
r = null;
|
|
t = null;
|
|
value = avar.value;
|
|
rsize = rs.size;
|
|
|
|
if (avar.error !== null) {
|
|
value = util.left(avar.error);
|
|
while (p = takeHead(ps)) { // eslint-disable-line no-cond-assign
|
|
runEff(p.cb(value));
|
|
}
|
|
while (r = takeHead(rs)) { // eslint-disable-line no-cond-assign
|
|
runEff(r(value));
|
|
}
|
|
while (t = takeHead(ts)) { // eslint-disable-line no-cond-assign
|
|
runEff(t(value));
|
|
}
|
|
break;
|
|
}
|
|
|
|
// Process the next put. We do not immediately invoke the callback
|
|
// because we want to preserve ordering. If there are takes/reads
|
|
// we want to run those first.
|
|
if (value === EMPTY && (p = takeHead(ps))) {
|
|
avar.value = value = p.value;
|
|
}
|
|
|
|
if (value !== EMPTY) {
|
|
// We go ahead and queue up the next take for the same reasons as
|
|
// above. Invoking the read callbacks can affect the mutable queue.
|
|
t = takeHead(ts);
|
|
// We only want to process the reads queued up before running these
|
|
// callbacks so we guard on rsize.
|
|
while (rsize-- && (r = takeHead(rs))) {
|
|
runEff(r(util.right(value)));
|
|
}
|
|
if (t !== null) {
|
|
avar.value = EMPTY;
|
|
runEff(t(util.right(value)));
|
|
}
|
|
}
|
|
|
|
if (p !== null) {
|
|
runEff(p.cb(util.right(void 0)));
|
|
}
|
|
|
|
// Callbacks could have queued up more items so we need to guard on the
|
|
// actual mutable properties.
|
|
if (avar.value === EMPTY && ps.size === 0 || avar.value !== EMPTY && ts.size === 0) {
|
|
break;
|
|
}
|
|
}
|
|
avar.draining = false;
|
|
}
|
|
|
|
AVar.EMPTY = EMPTY;
|
|
AVar.putLast = putLast;
|
|
AVar.takeLast = takeLast;
|
|
AVar.takeHead = takeHead;
|
|
AVar.deleteCell = deleteCell;
|
|
AVar.drainVar = drainVar;
|
|
|
|
return AVar;
|
|
}();
|
|
|
|
exports.empty = function () {
|
|
return new AVar(AVar.EMPTY);
|
|
};
|
|
|
|
exports._killVar = function (util, error, avar) {
|
|
return function () {
|
|
if (avar.error === null) {
|
|
avar.error = error;
|
|
avar.value = AVar.EMPTY;
|
|
AVar.drainVar(util, avar);
|
|
}
|
|
};
|
|
};
|
|
|
|
exports._putVar = function (util, value, avar, cb) {
|
|
return function () {
|
|
var cell = AVar.putLast(avar.puts, { cb: cb, value: value });
|
|
AVar.drainVar(util, avar);
|
|
return function () {
|
|
AVar.deleteCell(cell);
|
|
};
|
|
};
|
|
};
|
|
|
|
exports._takeVar = function (util, avar, cb) {
|
|
return function () {
|
|
var cell = AVar.putLast(avar.takes, cb);
|
|
AVar.drainVar(util, avar);
|
|
return function () {
|
|
AVar.deleteCell(cell);
|
|
};
|
|
};
|
|
};
|
|
})(PS["Effect.AVar"] = PS["Effect.AVar"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.AVar"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Prelude = PS["Prelude"];
|
|
var Killed = (function () {
|
|
function Killed(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Killed.create = function (value0) {
|
|
return new Killed(value0);
|
|
};
|
|
return Killed;
|
|
})();
|
|
var Filled = (function () {
|
|
function Filled(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Filled.create = function (value0) {
|
|
return new Filled(value0);
|
|
};
|
|
return Filled;
|
|
})();
|
|
var Empty = (function () {
|
|
function Empty() {
|
|
|
|
};
|
|
Empty.value = new Empty();
|
|
return Empty;
|
|
})();
|
|
var ffiUtil = {
|
|
left: Data_Either.Left.create,
|
|
right: Data_Either.Right.create,
|
|
nothing: Data_Maybe.Nothing.value,
|
|
just: Data_Maybe.Just.create,
|
|
killed: Killed.create,
|
|
filled: Filled.create,
|
|
empty: Empty.value
|
|
};
|
|
var kill = function (err) {
|
|
return function (avar) {
|
|
return $foreign["_killVar"](ffiUtil, err, avar);
|
|
};
|
|
};
|
|
var put = function (value) {
|
|
return function (avar) {
|
|
return function (cb) {
|
|
return $foreign["_putVar"](ffiUtil, value, avar, cb);
|
|
};
|
|
};
|
|
};
|
|
var take = function (avar) {
|
|
return function (cb) {
|
|
return $foreign["_takeVar"](ffiUtil, avar, cb);
|
|
};
|
|
};
|
|
exports["Killed"] = Killed;
|
|
exports["Filled"] = Filled;
|
|
exports["Empty"] = Empty;
|
|
exports["take"] = take;
|
|
exports["put"] = put;
|
|
exports["kill"] = kill;
|
|
exports["empty"] = $foreign.empty;
|
|
})(PS["Effect.AVar"] = PS["Effect.AVar"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_AVar = PS["Effect.AVar"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Prelude = PS["Prelude"];
|
|
var take = function (avar) {
|
|
return Effect_Aff.makeAff(function (k) {
|
|
return function __do() {
|
|
var v = Effect_AVar.take(avar)(k)();
|
|
return Effect_Aff.effectCanceler(v);
|
|
};
|
|
});
|
|
};
|
|
var put = function (value) {
|
|
return function (avar) {
|
|
return Effect_Aff.makeAff(function (k) {
|
|
return function __do() {
|
|
var v = Effect_AVar.put(value)(avar)(k)();
|
|
return Effect_Aff.effectCanceler(v);
|
|
};
|
|
});
|
|
};
|
|
};
|
|
var kill = function (error) {
|
|
return function ($11) {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_AVar.kill(error)($11));
|
|
};
|
|
};
|
|
var empty = Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_AVar.empty);
|
|
exports["empty"] = empty;
|
|
exports["take"] = take;
|
|
exports["put"] = put;
|
|
exports["kill"] = kill;
|
|
})(PS["Effect.Aff.AVar"] = PS["Effect.Aff.AVar"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Coroutine = PS["Control.Coroutine"];
|
|
var Control_Monad_Free_Trans = PS["Control.Monad.Free.Trans"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_AVar = PS["Effect.Aff.AVar"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Prelude = PS["Prelude"];
|
|
var Listening = (function () {
|
|
function Listening() {
|
|
|
|
};
|
|
Listening.value = new Listening();
|
|
return Listening;
|
|
})();
|
|
var Done = (function () {
|
|
function Done() {
|
|
|
|
};
|
|
Done.value = new Done();
|
|
return Done;
|
|
})();
|
|
var unEventSource = function (v) {
|
|
return v;
|
|
};
|
|
var eqSubscribeStatus = new Data_Eq.Eq(function (x) {
|
|
return function (y) {
|
|
if (x instanceof Listening && y instanceof Listening) {
|
|
return true;
|
|
};
|
|
if (x instanceof Done && y instanceof Done) {
|
|
return true;
|
|
};
|
|
return false;
|
|
};
|
|
});
|
|
exports["Listening"] = Listening;
|
|
exports["Done"] = Done;
|
|
exports["unEventSource"] = unEventSource;
|
|
exports["eqSubscribeStatus"] = eqSubscribeStatus;
|
|
})(PS["Halogen.Query.EventSource"] = PS["Halogen.Query.EventSource"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var unFork = Unsafe_Coerce.unsafeCoerce;
|
|
exports["unFork"] = unFork;
|
|
})(PS["Halogen.Query.ForkF"] = PS["Halogen.Query.ForkF"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Applicative_Free = PS["Control.Applicative.Free"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad = PS["Control.Monad"];
|
|
var Control_Monad_Free = PS["Control.Monad.Free"];
|
|
var Control_Monad_Reader_Class = PS["Control.Monad.Reader.Class"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Monad_Writer_Class = PS["Control.Monad.Writer.Class"];
|
|
var Control_Parallel_Class = PS["Control.Parallel.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Coyoneda = PS["Data.Coyoneda"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Halogen_Query_EventSource = PS["Halogen.Query.EventSource"];
|
|
var Halogen_Query_ForkF = PS["Halogen.Query.ForkF"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var HalogenM = function (x) {
|
|
return x;
|
|
};
|
|
var State = (function () {
|
|
function State(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
State.create = function (value0) {
|
|
return new State(value0);
|
|
};
|
|
return State;
|
|
})();
|
|
var Subscribe = (function () {
|
|
function Subscribe(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Subscribe.create = function (value0) {
|
|
return function (value1) {
|
|
return new Subscribe(value0, value1);
|
|
};
|
|
};
|
|
return Subscribe;
|
|
})();
|
|
var Lift = (function () {
|
|
function Lift(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Lift.create = function (value0) {
|
|
return new Lift(value0);
|
|
};
|
|
return Lift;
|
|
})();
|
|
var Halt = (function () {
|
|
function Halt(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Halt.create = function (value0) {
|
|
return new Halt(value0);
|
|
};
|
|
return Halt;
|
|
})();
|
|
var GetSlots = (function () {
|
|
function GetSlots(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
GetSlots.create = function (value0) {
|
|
return new GetSlots(value0);
|
|
};
|
|
return GetSlots;
|
|
})();
|
|
var CheckSlot = (function () {
|
|
function CheckSlot(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
CheckSlot.create = function (value0) {
|
|
return function (value1) {
|
|
return new CheckSlot(value0, value1);
|
|
};
|
|
};
|
|
return CheckSlot;
|
|
})();
|
|
var ChildQuery = (function () {
|
|
function ChildQuery(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
ChildQuery.create = function (value0) {
|
|
return function (value1) {
|
|
return new ChildQuery(value0, value1);
|
|
};
|
|
};
|
|
return ChildQuery;
|
|
})();
|
|
var Raise = (function () {
|
|
function Raise(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Raise.create = function (value0) {
|
|
return function (value1) {
|
|
return new Raise(value0, value1);
|
|
};
|
|
};
|
|
return Raise;
|
|
})();
|
|
var Par = (function () {
|
|
function Par(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Par.create = function (value0) {
|
|
return new Par(value0);
|
|
};
|
|
return Par;
|
|
})();
|
|
var Fork = (function () {
|
|
function Fork(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Fork.create = function (value0) {
|
|
return new Fork(value0);
|
|
};
|
|
return Fork;
|
|
})();
|
|
var GetRef = (function () {
|
|
function GetRef(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
GetRef.create = function (value0) {
|
|
return function (value1) {
|
|
return new GetRef(value0, value1);
|
|
};
|
|
};
|
|
return GetRef;
|
|
})();
|
|
var raise = function (o) {
|
|
return HalogenM(Control_Monad_Free.liftF(new Raise(o, Data_Unit.unit)));
|
|
};
|
|
var getRef = function (p) {
|
|
return HalogenM(Control_Monad_Free.liftF(new GetRef(p, Control_Category.identity(Control_Category.categoryFn))));
|
|
};
|
|
var functorHalogenM = new Data_Functor.Functor(function (f) {
|
|
return function (v) {
|
|
return Data_Functor.map(Control_Monad_Free.freeFunctor)(f)(v);
|
|
};
|
|
});
|
|
var applyHalogenM = new Control_Apply.Apply(function () {
|
|
return functorHalogenM;
|
|
}, function (v) {
|
|
return function (v1) {
|
|
return Control_Apply.apply(Control_Monad_Free.freeApply)(v)(v1);
|
|
};
|
|
});
|
|
var bindHalogenM = new Control_Bind.Bind(function () {
|
|
return applyHalogenM;
|
|
}, function (v) {
|
|
return function (f) {
|
|
return Control_Bind.bind(Control_Monad_Free.freeBind)(v)(function (x) {
|
|
var v1 = f(x);
|
|
return v1;
|
|
});
|
|
};
|
|
});
|
|
var applicativeHalogenM = new Control_Applicative.Applicative(function () {
|
|
return applyHalogenM;
|
|
}, function (a) {
|
|
return Control_Applicative.pure(Control_Monad_Free.freeApplicative)(a);
|
|
});
|
|
var monadHalogenM = new Control_Monad.Monad(function () {
|
|
return applicativeHalogenM;
|
|
}, function () {
|
|
return bindHalogenM;
|
|
});
|
|
var monadEffectHalogenM = function (dictMonadEffect) {
|
|
return new Effect_Class.MonadEffect(function () {
|
|
return monadHalogenM;
|
|
}, function (eff) {
|
|
return HalogenM(Control_Monad_Free.liftF(Lift.create(Effect_Class.liftEffect(dictMonadEffect)(eff))));
|
|
});
|
|
};
|
|
var monadAffHalogenM = function (dictMonadAff) {
|
|
return new Effect_Aff_Class.MonadAff(function () {
|
|
return monadEffectHalogenM(dictMonadAff.MonadEffect0());
|
|
}, function (aff) {
|
|
return HalogenM(Control_Monad_Free.liftF(Lift.create(Effect_Aff_Class.liftAff(dictMonadAff)(aff))));
|
|
});
|
|
};
|
|
var monadStateHalogenM = new Control_Monad_State_Class.MonadState(function () {
|
|
return monadHalogenM;
|
|
}, function ($180) {
|
|
return HalogenM(Control_Monad_Free.liftF(State.create($180)));
|
|
});
|
|
exports["State"] = State;
|
|
exports["Subscribe"] = Subscribe;
|
|
exports["Lift"] = Lift;
|
|
exports["Halt"] = Halt;
|
|
exports["GetSlots"] = GetSlots;
|
|
exports["CheckSlot"] = CheckSlot;
|
|
exports["ChildQuery"] = ChildQuery;
|
|
exports["Raise"] = Raise;
|
|
exports["Par"] = Par;
|
|
exports["Fork"] = Fork;
|
|
exports["GetRef"] = GetRef;
|
|
exports["HalogenM"] = HalogenM;
|
|
exports["getRef"] = getRef;
|
|
exports["raise"] = raise;
|
|
exports["functorHalogenM"] = functorHalogenM;
|
|
exports["applyHalogenM"] = applyHalogenM;
|
|
exports["applicativeHalogenM"] = applicativeHalogenM;
|
|
exports["bindHalogenM"] = bindHalogenM;
|
|
exports["monadHalogenM"] = monadHalogenM;
|
|
exports["monadEffectHalogenM"] = monadEffectHalogenM;
|
|
exports["monadAffHalogenM"] = monadAffHalogenM;
|
|
exports["monadStateHalogenM"] = monadStateHalogenM;
|
|
})(PS["Halogen.Query.HalogenM"] = PS["Halogen.Query.HalogenM"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Bifunctor = PS["Data.Bifunctor"];
|
|
var Data_Const = PS["Data.Const"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Halogen_Data_OrdBox = PS["Halogen.Data.OrdBox"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var ComponentSlot = (function () {
|
|
function ComponentSlot(value0, value1, value2, value3, value4, value5) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
this.value4 = value4;
|
|
this.value5 = value5;
|
|
};
|
|
ComponentSlot.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return function (value4) {
|
|
return function (value5) {
|
|
return new ComponentSlot(value0, value1, value2, value3, value4, value5);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return ComponentSlot;
|
|
})();
|
|
var unComponentSlot = function (f) {
|
|
return function (cs) {
|
|
return f(cs.value0)(cs.value1)(cs.value2)(cs.value3)(cs.value4)(cs.value5);
|
|
};
|
|
};
|
|
var unComponent = Unsafe_Coerce.unsafeCoerce;
|
|
var mkComponentSlot = ComponentSlot.create;
|
|
var mkComponent = Unsafe_Coerce.unsafeCoerce;
|
|
var parentComponent = function (dictOrd) {
|
|
return function (spec) {
|
|
return mkComponent({
|
|
initialState: spec.initialState,
|
|
render: spec.render,
|
|
"eval": spec["eval"],
|
|
receiver: spec.receiver,
|
|
initializer: Data_Maybe.Nothing.value,
|
|
finalizer: Data_Maybe.Nothing.value,
|
|
mkOrdBox: Halogen_Data_OrdBox.mkOrdBox(dictOrd)
|
|
});
|
|
};
|
|
};
|
|
var lifecycleComponent = function (dictBifunctor) {
|
|
return function (spec) {
|
|
return mkComponent({
|
|
initialState: spec.initialState,
|
|
render: spec.render,
|
|
"eval": spec["eval"],
|
|
receiver: spec.receiver,
|
|
initializer: spec.initializer,
|
|
finalizer: spec.finalizer,
|
|
mkOrdBox: Halogen_Data_OrdBox.mkOrdBox(Data_Ord.ordVoid)
|
|
});
|
|
};
|
|
};
|
|
var component = function (dictBifunctor) {
|
|
return function (spec) {
|
|
return lifecycleComponent(dictBifunctor)({
|
|
initialState: spec.initialState,
|
|
render: spec.render,
|
|
"eval": spec["eval"],
|
|
receiver: spec.receiver,
|
|
initializer: Data_Maybe.Nothing.value,
|
|
finalizer: Data_Maybe.Nothing.value
|
|
});
|
|
};
|
|
};
|
|
exports["mkComponent"] = mkComponent;
|
|
exports["unComponent"] = unComponent;
|
|
exports["component"] = component;
|
|
exports["lifecycleComponent"] = lifecycleComponent;
|
|
exports["parentComponent"] = parentComponent;
|
|
exports["mkComponentSlot"] = mkComponentSlot;
|
|
exports["unComponentSlot"] = unComponentSlot;
|
|
})(PS["Halogen.Component"] = PS["Halogen.Component"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed = PS["DOM.HTML.Indexed"];
|
|
var DOM_HTML_Indexed_ButtonType = PS["DOM.HTML.Indexed.ButtonType"];
|
|
var DOM_HTML_Indexed_FormMethod = PS["DOM.HTML.Indexed.FormMethod"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var DOM_HTML_Indexed_MenuType = PS["DOM.HTML.Indexed.MenuType"];
|
|
var DOM_HTML_Indexed_MenuitemType = PS["DOM.HTML.Indexed.MenuitemType"];
|
|
var DOM_HTML_Indexed_OnOff = PS["DOM.HTML.Indexed.OnOff"];
|
|
var DOM_HTML_Indexed_OrderedListType = PS["DOM.HTML.Indexed.OrderedListType"];
|
|
var DOM_HTML_Indexed_PreloadValue = PS["DOM.HTML.Indexed.PreloadValue"];
|
|
var DOM_HTML_Indexed_StepValue = PS["DOM.HTML.Indexed.StepValue"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_MediaType = PS["Data.MediaType"];
|
|
var Data_Newtype = PS["Data.Newtype"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Halogen_VDom_DOM_Prop = PS["Halogen.VDom.DOM.Prop"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var ref = (function () {
|
|
var go = function (p) {
|
|
return function (mel) {
|
|
return new Data_Maybe.Just(new Halogen_Query_InputF.RefUpdate(p, mel, Data_Unit.unit));
|
|
};
|
|
};
|
|
return function ($10) {
|
|
return Halogen_HTML_Core.ref(go($10));
|
|
};
|
|
})();
|
|
var prop = function (dictIsProp) {
|
|
return Halogen_HTML_Core.prop(dictIsProp);
|
|
};
|
|
var required = prop(Halogen_HTML_Core.booleanIsProp)("required");
|
|
var rows = prop(Halogen_HTML_Core.intIsProp)("rows");
|
|
var target = prop(Halogen_HTML_Core.stringIsProp)("target");
|
|
var title = prop(Halogen_HTML_Core.stringIsProp)("title");
|
|
var type_ = function (dictIsProp) {
|
|
return prop(dictIsProp)("type");
|
|
};
|
|
var value = prop(Halogen_HTML_Core.stringIsProp)("value");
|
|
var name = prop(Halogen_HTML_Core.stringIsProp)("name");
|
|
var id_ = prop(Halogen_HTML_Core.stringIsProp)("id");
|
|
var href = prop(Halogen_HTML_Core.stringIsProp)("href");
|
|
var $$for = prop(Halogen_HTML_Core.stringIsProp)("htmlFor");
|
|
var class_ = function ($13) {
|
|
return prop(Halogen_HTML_Core.stringIsProp)("className")(Data_Newtype.unwrap(Halogen_HTML_Core.newtypeClassName)($13));
|
|
};
|
|
var checked = prop(Halogen_HTML_Core.booleanIsProp)("checked");
|
|
var autofocus = prop(Halogen_HTML_Core.booleanIsProp)("autofocus");
|
|
var autocomplete = function ($14) {
|
|
return prop(Halogen_HTML_Core.onOffIsProp)("autocomplete")((function (b) {
|
|
if (b) {
|
|
return DOM_HTML_Indexed_OnOff.On.value;
|
|
};
|
|
return DOM_HTML_Indexed_OnOff.Off.value;
|
|
})($14));
|
|
};
|
|
var attr = Halogen_HTML_Core.attr(Data_Maybe.Nothing.value);
|
|
exports["prop"] = prop;
|
|
exports["attr"] = attr;
|
|
exports["ref"] = ref;
|
|
exports["class_"] = class_;
|
|
exports["rows"] = rows;
|
|
exports["for"] = $$for;
|
|
exports["href"] = href;
|
|
exports["id_"] = id_;
|
|
exports["name"] = name;
|
|
exports["target"] = target;
|
|
exports["title"] = title;
|
|
exports["type_"] = type_;
|
|
exports["value"] = value;
|
|
exports["required"] = required;
|
|
exports["checked"] = checked;
|
|
exports["autocomplete"] = autocomplete;
|
|
exports["autofocus"] = autofocus;
|
|
})(PS["Halogen.HTML.Properties"] = PS["Halogen.HTML.Properties"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed = PS["DOM.HTML.Indexed"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Halogen_VDom = PS["Halogen.VDom"];
|
|
var Halogen_VDom_Types = PS["Halogen.VDom.Types"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var element = Halogen_HTML_Core.element(Data_Maybe.Nothing.value);
|
|
var form = element("form");
|
|
var input = function (props) {
|
|
return element("input")(props)([ ]);
|
|
};
|
|
var label = element("label");
|
|
var p = element("p");
|
|
var span = element("span");
|
|
var table = element("table");
|
|
var tbody = element("tbody");
|
|
var tbody_ = tbody([ ]);
|
|
var td = element("td");
|
|
var td_ = td([ ]);
|
|
var textarea = function (es) {
|
|
return element("textarea")(es)([ ]);
|
|
};
|
|
var tr = element("tr");
|
|
var tr_ = tr([ ]);
|
|
var div = element("div");
|
|
var div_ = div([ ]);
|
|
var button = element("button");
|
|
var br = function (props) {
|
|
return element("br")(props)([ ]);
|
|
};
|
|
var br_ = br([ ]);
|
|
var a = element("a");
|
|
exports["element"] = element;
|
|
exports["a"] = a;
|
|
exports["br"] = br;
|
|
exports["br_"] = br_;
|
|
exports["button"] = button;
|
|
exports["div"] = div;
|
|
exports["div_"] = div_;
|
|
exports["form"] = form;
|
|
exports["input"] = input;
|
|
exports["label"] = label;
|
|
exports["p"] = p;
|
|
exports["span"] = span;
|
|
exports["table"] = table;
|
|
exports["tbody"] = tbody;
|
|
exports["tbody_"] = tbody_;
|
|
exports["td"] = td;
|
|
exports["td_"] = td_;
|
|
exports["textarea"] = textarea;
|
|
exports["tr"] = tr;
|
|
exports["tr_"] = tr_;
|
|
})(PS["Halogen.HTML.Elements"] = PS["Halogen.HTML.Elements"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_Component_ChildPath = PS["Halogen.Component.ChildPath"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var slot = function (p) {
|
|
return function (component) {
|
|
return function (input) {
|
|
return function (outputQuery) {
|
|
var f = Halogen_Component.unComponent(function (v) {
|
|
return v.receiver;
|
|
})(component);
|
|
return Halogen_HTML_Core.slot(Halogen_Component.mkComponentSlot(p)(component)(input)(f)(outputQuery)(Data_Maybe.Just.create));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["slot"] = slot;
|
|
})(PS["Halogen.HTML"] = PS["Halogen.HTML"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Apply = PS["Control.Apply"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_FoldableWithIndex = PS["Data.FoldableWithIndex"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_FunctorWithIndex = PS["Data.FunctorWithIndex"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Lazy = PS["Data.List.Lazy"];
|
|
var Data_List_Lazy_Types = PS["Data.List.Lazy.Types"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_TraversableWithIndex = PS["Data.TraversableWithIndex"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Leaf = (function () {
|
|
function Leaf() {
|
|
|
|
};
|
|
Leaf.value = new Leaf();
|
|
return Leaf;
|
|
})();
|
|
var Two = (function () {
|
|
function Two(value0, value1, value2, value3) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
};
|
|
Two.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return new Two(value0, value1, value2, value3);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Two;
|
|
})();
|
|
var Three = (function () {
|
|
function Three(value0, value1, value2, value3, value4, value5, value6) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
this.value4 = value4;
|
|
this.value5 = value5;
|
|
this.value6 = value6;
|
|
};
|
|
Three.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return function (value4) {
|
|
return function (value5) {
|
|
return function (value6) {
|
|
return new Three(value0, value1, value2, value3, value4, value5, value6);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Three;
|
|
})();
|
|
var TwoLeft = (function () {
|
|
function TwoLeft(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
TwoLeft.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new TwoLeft(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return TwoLeft;
|
|
})();
|
|
var TwoRight = (function () {
|
|
function TwoRight(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
TwoRight.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new TwoRight(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return TwoRight;
|
|
})();
|
|
var ThreeLeft = (function () {
|
|
function ThreeLeft(value0, value1, value2, value3, value4, value5) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
this.value4 = value4;
|
|
this.value5 = value5;
|
|
};
|
|
ThreeLeft.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return function (value4) {
|
|
return function (value5) {
|
|
return new ThreeLeft(value0, value1, value2, value3, value4, value5);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return ThreeLeft;
|
|
})();
|
|
var ThreeMiddle = (function () {
|
|
function ThreeMiddle(value0, value1, value2, value3, value4, value5) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
this.value4 = value4;
|
|
this.value5 = value5;
|
|
};
|
|
ThreeMiddle.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return function (value4) {
|
|
return function (value5) {
|
|
return new ThreeMiddle(value0, value1, value2, value3, value4, value5);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return ThreeMiddle;
|
|
})();
|
|
var ThreeRight = (function () {
|
|
function ThreeRight(value0, value1, value2, value3, value4, value5) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
this.value4 = value4;
|
|
this.value5 = value5;
|
|
};
|
|
ThreeRight.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return function (value4) {
|
|
return function (value5) {
|
|
return new ThreeRight(value0, value1, value2, value3, value4, value5);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return ThreeRight;
|
|
})();
|
|
var KickUp = (function () {
|
|
function KickUp(value0, value1, value2, value3) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
this.value3 = value3;
|
|
};
|
|
KickUp.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return function (value3) {
|
|
return new KickUp(value0, value1, value2, value3);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return KickUp;
|
|
})();
|
|
var values = function (v) {
|
|
if (v instanceof Leaf) {
|
|
return Data_List_Types.Nil.value;
|
|
};
|
|
if (v instanceof Two) {
|
|
return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(values(v.value3)));
|
|
};
|
|
if (v instanceof Three) {
|
|
return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value5))(values(v.value6)))));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 602, column 1 - line 602, column 40): " + [ v.constructor.name ]);
|
|
};
|
|
var lookup = function (dictOrd) {
|
|
return function (k) {
|
|
var comp = Data_Ord.compare(dictOrd);
|
|
var go = function ($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v instanceof Leaf) {
|
|
$tco_done = true;
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
if (v instanceof Two) {
|
|
var v2 = comp(k)(v.value1);
|
|
if (v2 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(v.value2);
|
|
};
|
|
if (v2 instanceof Data_Ordering.LT) {
|
|
$copy_v = v.value0;
|
|
return;
|
|
};
|
|
$copy_v = v.value3;
|
|
return;
|
|
};
|
|
if (v instanceof Three) {
|
|
var v3 = comp(k)(v.value1);
|
|
if (v3 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(v.value2);
|
|
};
|
|
var v4 = comp(k)(v.value4);
|
|
if (v4 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(v.value5);
|
|
};
|
|
if (v3 instanceof Data_Ordering.LT) {
|
|
$copy_v = v.value0;
|
|
return;
|
|
};
|
|
if (v4 instanceof Data_Ordering.GT) {
|
|
$copy_v = v.value6;
|
|
return;
|
|
};
|
|
$copy_v = v.value3;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 197, column 5 - line 197, column 22): " + [ v.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
return go;
|
|
};
|
|
};
|
|
var member = function (dictOrd) {
|
|
return function (k) {
|
|
return function (m) {
|
|
return Data_Maybe.isJust(lookup(dictOrd)(k)(m));
|
|
};
|
|
};
|
|
};
|
|
var keys = function (v) {
|
|
if (v instanceof Leaf) {
|
|
return Data_List_Types.Nil.value;
|
|
};
|
|
if (v instanceof Two) {
|
|
return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(keys(v.value3)));
|
|
};
|
|
if (v instanceof Three) {
|
|
return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value4))(keys(v.value6)))));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 596, column 1 - line 596, column 38): " + [ v.constructor.name ]);
|
|
};
|
|
var functorMap = new Data_Functor.Functor(function (v) {
|
|
return function (v1) {
|
|
if (v1 instanceof Leaf) {
|
|
return Leaf.value;
|
|
};
|
|
if (v1 instanceof Two) {
|
|
return new Two(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3));
|
|
};
|
|
if (v1 instanceof Three) {
|
|
return new Three(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3), v1.value4, v(v1.value5), Data_Functor.map(functorMap)(v)(v1.value6));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 93, column 1 - line 93, column 39): " + [ v.constructor.name, v1.constructor.name ]);
|
|
};
|
|
});
|
|
var fromZipper = function ($copy_dictOrd) {
|
|
return function ($copy_v) {
|
|
return function ($copy_tree) {
|
|
var $tco_var_dictOrd = $copy_dictOrd;
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(dictOrd, v, tree) {
|
|
if (v instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return tree;
|
|
};
|
|
if (v instanceof Data_List_Types.Cons) {
|
|
if (v.value0 instanceof TwoLeft) {
|
|
$tco_var_dictOrd = dictOrd;
|
|
$tco_var_v = v.value1;
|
|
$copy_tree = new Two(tree, v.value0.value0, v.value0.value1, v.value0.value2);
|
|
return;
|
|
};
|
|
if (v.value0 instanceof TwoRight) {
|
|
$tco_var_dictOrd = dictOrd;
|
|
$tco_var_v = v.value1;
|
|
$copy_tree = new Two(v.value0.value0, v.value0.value1, v.value0.value2, tree);
|
|
return;
|
|
};
|
|
if (v.value0 instanceof ThreeLeft) {
|
|
$tco_var_dictOrd = dictOrd;
|
|
$tco_var_v = v.value1;
|
|
$copy_tree = new Three(tree, v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5);
|
|
return;
|
|
};
|
|
if (v.value0 instanceof ThreeMiddle) {
|
|
$tco_var_dictOrd = dictOrd;
|
|
$tco_var_v = v.value1;
|
|
$copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, tree, v.value0.value3, v.value0.value4, v.value0.value5);
|
|
return;
|
|
};
|
|
if (v.value0 instanceof ThreeRight) {
|
|
$tco_var_dictOrd = dictOrd;
|
|
$tco_var_v = v.value1;
|
|
$copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5, tree);
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 415, column 3 - line 420, column 88): " + [ v.value0.constructor.name ]);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 412, column 1 - line 412, column 80): " + [ v.constructor.name, tree.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_dictOrd, $tco_var_v, $copy_tree);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
};
|
|
var insert = function (dictOrd) {
|
|
return function (k) {
|
|
return function (v) {
|
|
var up = function ($copy_v1) {
|
|
return function ($copy_v2) {
|
|
var $tco_var_v1 = $copy_v1;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v1, v2) {
|
|
if (v1 instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return new Two(v2.value0, v2.value1, v2.value2, v2.value3);
|
|
};
|
|
if (v1 instanceof Data_List_Types.Cons) {
|
|
if (v1.value0 instanceof TwoLeft) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(v1.value1)(new Three(v2.value0, v2.value1, v2.value2, v2.value3, v1.value0.value0, v1.value0.value1, v1.value0.value2));
|
|
};
|
|
if (v1.value0 instanceof TwoRight) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(v1.value1)(new Three(v1.value0.value0, v1.value0.value1, v1.value0.value2, v2.value0, v2.value1, v2.value2, v2.value3));
|
|
};
|
|
if (v1.value0 instanceof ThreeLeft) {
|
|
$tco_var_v1 = v1.value1;
|
|
$copy_v2 = new KickUp(new Two(v2.value0, v2.value1, v2.value2, v2.value3), v1.value0.value0, v1.value0.value1, new Two(v1.value0.value2, v1.value0.value3, v1.value0.value4, v1.value0.value5));
|
|
return;
|
|
};
|
|
if (v1.value0 instanceof ThreeMiddle) {
|
|
$tco_var_v1 = v1.value1;
|
|
$copy_v2 = new KickUp(new Two(v1.value0.value0, v1.value0.value1, v1.value0.value2, v2.value0), v2.value1, v2.value2, new Two(v2.value3, v1.value0.value3, v1.value0.value4, v1.value0.value5));
|
|
return;
|
|
};
|
|
if (v1.value0 instanceof ThreeRight) {
|
|
$tco_var_v1 = v1.value1;
|
|
$copy_v2 = new KickUp(new Two(v1.value0.value0, v1.value0.value1, v1.value0.value2, v1.value0.value3), v1.value0.value4, v1.value0.value5, new Two(v2.value0, v2.value1, v2.value2, v2.value3));
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 451, column 5 - line 456, column 108): " + [ v1.value0.constructor.name, v2.constructor.name ]);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 448, column 3 - line 448, column 56): " + [ v1.constructor.name, v2.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v1, $copy_v2);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
var comp = Data_Ord.compare(dictOrd);
|
|
var down = function ($copy_ctx) {
|
|
return function ($copy_v1) {
|
|
var $tco_var_ctx = $copy_ctx;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(ctx, v1) {
|
|
if (v1 instanceof Leaf) {
|
|
$tco_done = true;
|
|
return up(ctx)(new KickUp(Leaf.value, k, v, Leaf.value));
|
|
};
|
|
if (v1 instanceof Two) {
|
|
var v2 = comp(k)(v1.value1);
|
|
if (v2 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctx)(new Two(v1.value0, k, v, v1.value3));
|
|
};
|
|
if (v2 instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new TwoLeft(v1.value1, v1.value2, v1.value3), ctx);
|
|
$copy_v1 = v1.value0;
|
|
return;
|
|
};
|
|
$tco_var_ctx = new Data_List_Types.Cons(new TwoRight(v1.value0, v1.value1, v1.value2), ctx);
|
|
$copy_v1 = v1.value3;
|
|
return;
|
|
};
|
|
if (v1 instanceof Three) {
|
|
var v3 = comp(k)(v1.value1);
|
|
if (v3 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctx)(new Three(v1.value0, k, v, v1.value3, v1.value4, v1.value5, v1.value6));
|
|
};
|
|
var v4 = comp(k)(v1.value4);
|
|
if (v4 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctx)(new Three(v1.value0, v1.value1, v1.value2, v1.value3, k, v, v1.value6));
|
|
};
|
|
if (v3 instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeLeft(v1.value1, v1.value2, v1.value3, v1.value4, v1.value5, v1.value6), ctx);
|
|
$copy_v1 = v1.value0;
|
|
return;
|
|
};
|
|
if (v3 instanceof Data_Ordering.GT && v4 instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeMiddle(v1.value0, v1.value1, v1.value2, v1.value4, v1.value5, v1.value6), ctx);
|
|
$copy_v1 = v1.value3;
|
|
return;
|
|
};
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(v1.value0, v1.value1, v1.value2, v1.value3, v1.value4, v1.value5), ctx);
|
|
$copy_v1 = v1.value6;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 431, column 3 - line 431, column 55): " + [ ctx.constructor.name, v1.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_ctx, $copy_v1);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return down(Data_List_Types.Nil.value);
|
|
};
|
|
};
|
|
};
|
|
var pop = function (dictOrd) {
|
|
return function (k) {
|
|
var up = function ($copy_ctxs) {
|
|
return function ($copy_tree) {
|
|
var $tco_var_ctxs = $copy_ctxs;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(ctxs, tree) {
|
|
if (ctxs instanceof Data_List_Types.Nil) {
|
|
$tco_done = true;
|
|
return tree;
|
|
};
|
|
if (ctxs instanceof Data_List_Types.Cons) {
|
|
if (ctxs.value0 instanceof TwoLeft && (ctxs.value0.value2 instanceof Leaf && tree instanceof Leaf)) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value));
|
|
};
|
|
if (ctxs.value0 instanceof TwoRight && (ctxs.value0.value0 instanceof Leaf && tree instanceof Leaf)) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value));
|
|
};
|
|
if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Two) {
|
|
$tco_var_ctxs = ctxs.value1;
|
|
$copy_tree = new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3);
|
|
return;
|
|
};
|
|
if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Two) {
|
|
$tco_var_ctxs = ctxs.value1;
|
|
$copy_tree = new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree);
|
|
return;
|
|
};
|
|
if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6)));
|
|
};
|
|
if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree)));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeLeft && (ctxs.value0.value2 instanceof Leaf && (ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf))) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeMiddle && (ctxs.value0.value0 instanceof Leaf && (ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf))) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeRight && (ctxs.value0.value0 instanceof Leaf && (ctxs.value0.value3 instanceof Leaf && tree instanceof Leaf))) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value4, ctxs.value0.value5, Leaf.value));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Two) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Two) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Two) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0, ctxs.value0.value5.value1, ctxs.value0.value5.value2, ctxs.value0.value5.value3)));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Two) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3, ctxs.value0.value4, ctxs.value0.value5, tree)));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0), ctxs.value0.value5.value1, ctxs.value0.value5.value2, new Two(ctxs.value0.value5.value3, ctxs.value0.value5.value4, ctxs.value0.value5.value5, ctxs.value0.value5.value6)));
|
|
};
|
|
if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Three) {
|
|
$tco_done = true;
|
|
return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3), ctxs.value0.value3.value4, ctxs.value0.value3.value5, new Two(ctxs.value0.value3.value6, ctxs.value0.value4, ctxs.value0.value5, tree)));
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 501, column 9 - line 518, column 136): " + [ ctxs.value0.constructor.name, tree.constructor.name ]);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 498, column 5 - line 518, column 136): " + [ ctxs.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_ctxs, $copy_tree);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
var removeMaxNode = function ($copy_ctx) {
|
|
return function ($copy_m) {
|
|
var $tco_var_ctx = $copy_ctx;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(ctx, m) {
|
|
if (m instanceof Two && (m.value0 instanceof Leaf && m.value3 instanceof Leaf)) {
|
|
$tco_done = true;
|
|
return up(ctx)(Leaf.value);
|
|
};
|
|
if (m instanceof Two) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx);
|
|
$copy_m = m.value3;
|
|
return;
|
|
};
|
|
if (m instanceof Three && (m.value0 instanceof Leaf && (m.value3 instanceof Leaf && m.value6 instanceof Leaf))) {
|
|
$tco_done = true;
|
|
return up(new Data_List_Types.Cons(new TwoRight(Leaf.value, m.value1, m.value2), ctx))(Leaf.value);
|
|
};
|
|
if (m instanceof Three) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(m.value0, m.value1, m.value2, m.value3, m.value4, m.value5), ctx);
|
|
$copy_m = m.value6;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 530, column 5 - line 534, column 107): " + [ m.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_ctx, $copy_m);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
var maxNode = function ($copy_m) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(m) {
|
|
if (m instanceof Two && m.value3 instanceof Leaf) {
|
|
$tco_done = true;
|
|
return {
|
|
key: m.value1,
|
|
value: m.value2
|
|
};
|
|
};
|
|
if (m instanceof Two) {
|
|
$copy_m = m.value3;
|
|
return;
|
|
};
|
|
if (m instanceof Three && m.value6 instanceof Leaf) {
|
|
$tco_done = true;
|
|
return {
|
|
key: m.value4,
|
|
value: m.value5
|
|
};
|
|
};
|
|
if (m instanceof Three) {
|
|
$copy_m = m.value6;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 521, column 33 - line 525, column 45): " + [ m.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_m);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
var comp = Data_Ord.compare(dictOrd);
|
|
var down = function ($copy_ctx) {
|
|
return function ($copy_m) {
|
|
var $tco_var_ctx = $copy_ctx;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(ctx, m) {
|
|
if (m instanceof Leaf) {
|
|
$tco_done = true;
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
if (m instanceof Two) {
|
|
var v = comp(k)(m.value1);
|
|
if (m.value3 instanceof Leaf && v instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, up(ctx)(Leaf.value)));
|
|
};
|
|
if (v instanceof Data_Ordering.EQ) {
|
|
var max = maxNode(m.value0);
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new TwoLeft(max.key, max.value, m.value3), ctx))(m.value0)));
|
|
};
|
|
if (v instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new TwoLeft(m.value1, m.value2, m.value3), ctx);
|
|
$copy_m = m.value0;
|
|
return;
|
|
};
|
|
$tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx);
|
|
$copy_m = m.value3;
|
|
return;
|
|
};
|
|
if (m instanceof Three) {
|
|
var leaves = (function () {
|
|
if (m.value0 instanceof Leaf && (m.value3 instanceof Leaf && m.value6 instanceof Leaf)) {
|
|
return true;
|
|
};
|
|
return false;
|
|
})();
|
|
var v = comp(k)(m.value4);
|
|
var v3 = comp(k)(m.value1);
|
|
if (leaves && v3 instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value4, m.value5, Leaf.value))));
|
|
};
|
|
if (leaves && v instanceof Data_Ordering.EQ) {
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value1, m.value2, Leaf.value))));
|
|
};
|
|
if (v3 instanceof Data_Ordering.EQ) {
|
|
var max = maxNode(m.value0);
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new ThreeLeft(max.key, max.value, m.value3, m.value4, m.value5, m.value6), ctx))(m.value0)));
|
|
};
|
|
if (v instanceof Data_Ordering.EQ) {
|
|
var max = maxNode(m.value3);
|
|
$tco_done = true;
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, removeMaxNode(new Data_List_Types.Cons(new ThreeMiddle(m.value0, m.value1, m.value2, max.key, max.value, m.value6), ctx))(m.value3)));
|
|
};
|
|
if (v3 instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeLeft(m.value1, m.value2, m.value3, m.value4, m.value5, m.value6), ctx);
|
|
$copy_m = m.value0;
|
|
return;
|
|
};
|
|
if (v3 instanceof Data_Ordering.GT && v instanceof Data_Ordering.LT) {
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeMiddle(m.value0, m.value1, m.value2, m.value4, m.value5, m.value6), ctx);
|
|
$copy_m = m.value3;
|
|
return;
|
|
};
|
|
$tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(m.value0, m.value1, m.value2, m.value3, m.value4, m.value5), ctx);
|
|
$copy_m = m.value6;
|
|
return;
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 471, column 34 - line 494, column 80): " + [ m.constructor.name ]);
|
|
};
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_ctx, $copy_m);
|
|
};
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return down(Data_List_Types.Nil.value);
|
|
};
|
|
};
|
|
var foldableMap = new Data_Foldable.Foldable(function (dictMonoid) {
|
|
return function (f) {
|
|
return function (m) {
|
|
return Data_Foldable.foldMap(Data_List_Types.foldableList)(dictMonoid)(f)(values(m));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (z) {
|
|
return function (m) {
|
|
return Data_Foldable.foldl(Data_List_Types.foldableList)(f)(z)(values(m));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (z) {
|
|
return function (m) {
|
|
return Data_Foldable.foldr(Data_List_Types.foldableList)(f)(z)(values(m));
|
|
};
|
|
};
|
|
});
|
|
var empty = Leaf.value;
|
|
var $$delete = function (dictOrd) {
|
|
return function (k) {
|
|
return function (m) {
|
|
return Data_Maybe.maybe(m)(Data_Tuple.snd)(pop(dictOrd)(k)(m));
|
|
};
|
|
};
|
|
};
|
|
var alter = function (dictOrd) {
|
|
return function (f) {
|
|
return function (k) {
|
|
return function (m) {
|
|
var v = f(lookup(dictOrd)(k)(m));
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
return $$delete(dictOrd)(k)(m);
|
|
};
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return insert(dictOrd)(k)(v.value0)(m);
|
|
};
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 539, column 15 - line 541, column 25): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["empty"] = empty;
|
|
exports["insert"] = insert;
|
|
exports["lookup"] = lookup;
|
|
exports["delete"] = $$delete;
|
|
exports["pop"] = pop;
|
|
exports["member"] = member;
|
|
exports["alter"] = alter;
|
|
exports["keys"] = keys;
|
|
exports["values"] = values;
|
|
exports["functorMap"] = functorMap;
|
|
exports["foldableMap"] = foldableMap;
|
|
})(PS["Data.Map.Internal"] = PS["Data.Map.Internal"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Monad_ST = PS["Control.Monad.ST"];
|
|
var Control_Monad_ST_Internal = PS["Control.Monad.ST.Internal"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Array_ST = PS["Data.Array.ST"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ordering = PS["Data.Ordering"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var toList = function (v) {
|
|
return Data_Map_Internal.keys(v);
|
|
};
|
|
var foldableSet = new Data_Foldable.Foldable(function (dictMonoid) {
|
|
return function (f) {
|
|
return function ($65) {
|
|
return Data_Foldable.foldMap(Data_List_Types.foldableList)(dictMonoid)(f)(toList($65));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (x) {
|
|
return function ($66) {
|
|
return Data_Foldable.foldl(Data_List_Types.foldableList)(f)(x)(toList($66));
|
|
};
|
|
};
|
|
}, function (f) {
|
|
return function (x) {
|
|
return function ($67) {
|
|
return Data_Foldable.foldr(Data_List_Types.foldableList)(f)(x)(toList($67));
|
|
};
|
|
};
|
|
});
|
|
exports["foldableSet"] = foldableSet;
|
|
})(PS["Data.Set"] = PS["Data.Set"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Set = PS["Data.Set"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var keys = function ($0) {
|
|
return Data_Functor["void"](Data_Map_Internal.functorMap)($0);
|
|
};
|
|
exports["keys"] = keys;
|
|
})(PS["Data.Map"] = PS["Data.Map"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Map = PS["Data.Map"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Halogen_Component_ChildPath = PS["Halogen.Component.ChildPath"];
|
|
var Halogen_Query_EventSource = PS["Halogen.Query.EventSource"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var getHTMLElementRef = function ($10) {
|
|
return Data_Functor.map(Halogen_Query_HalogenM.functorHalogenM)(function (v) {
|
|
return Control_Bind.bindFlipped(Data_Maybe.bindMaybe)(Web_HTML_HTMLElement.fromElement)(v);
|
|
})(Halogen_Query_HalogenM.getRef($10));
|
|
};
|
|
var action = function (act) {
|
|
return act(Data_Unit.unit);
|
|
};
|
|
exports["action"] = action;
|
|
exports["getHTMLElementRef"] = getHTMLElementRef;
|
|
})(PS["Halogen.Query"] = PS["Halogen.Query"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var change = "change";
|
|
exports["change"] = change;
|
|
})(PS["Web.HTML.Event.EventTypes"] = PS["Web.HTML.Event.EventTypes"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var click = "click";
|
|
exports["click"] = click;
|
|
})(PS["Web.UIEvent.MouseEvent.EventTypes"] = PS["Web.UIEvent.MouseEvent.EventTypes"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Except = PS["Control.Monad.Except"];
|
|
var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Identity = PS["Data.Identity"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Foreign = PS["Foreign"];
|
|
var Foreign_Index = PS["Foreign.Index"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query = PS["Halogen.Query"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_Clipboard_ClipboardEvent = PS["Web.Clipboard.ClipboardEvent"];
|
|
var Web_Clipboard_ClipboardEvent_EventTypes = PS["Web.Clipboard.ClipboardEvent.EventTypes"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_HTML_Event_DragEvent = PS["Web.HTML.Event.DragEvent"];
|
|
var Web_HTML_Event_DragEvent_EventTypes = PS["Web.HTML.Event.DragEvent.EventTypes"];
|
|
var Web_HTML_Event_EventTypes = PS["Web.HTML.Event.EventTypes"];
|
|
var Web_TouchEvent_TouchEvent = PS["Web.TouchEvent.TouchEvent"];
|
|
var Web_UIEvent_FocusEvent = PS["Web.UIEvent.FocusEvent"];
|
|
var Web_UIEvent_FocusEvent_EventTypes = PS["Web.UIEvent.FocusEvent.EventTypes"];
|
|
var Web_UIEvent_KeyboardEvent = PS["Web.UIEvent.KeyboardEvent"];
|
|
var Web_UIEvent_KeyboardEvent_EventTypes = PS["Web.UIEvent.KeyboardEvent.EventTypes"];
|
|
var Web_UIEvent_MouseEvent = PS["Web.UIEvent.MouseEvent"];
|
|
var Web_UIEvent_MouseEvent_EventTypes = PS["Web.UIEvent.MouseEvent.EventTypes"];
|
|
var Web_UIEvent_WheelEvent = PS["Web.UIEvent.WheelEvent"];
|
|
var Web_UIEvent_WheelEvent_EventTypes = PS["Web.UIEvent.WheelEvent.EventTypes"];
|
|
var mouseHandler = Unsafe_Coerce.unsafeCoerce;
|
|
var input_ = function (f) {
|
|
return function (v) {
|
|
return Data_Maybe.Just.create(Halogen_Query.action(f));
|
|
};
|
|
};
|
|
var input = function (f) {
|
|
return function (x) {
|
|
return Data_Maybe.Just.create(Halogen_Query.action(f(x)));
|
|
};
|
|
};
|
|
var handler = function (et) {
|
|
return function ($1) {
|
|
return Halogen_HTML_Core.handler(et)(Data_Functor.map(Data_Functor.functorFn)(Data_Functor.map(Data_Maybe.functorMaybe)(Halogen_Query_InputF.Query.create))($1));
|
|
};
|
|
};
|
|
var onClick = function ($2) {
|
|
return handler(Web_UIEvent_MouseEvent_EventTypes.click)(mouseHandler($2));
|
|
};
|
|
var onSubmit = handler("submit");
|
|
var addForeignPropHandler = function (key) {
|
|
return function (prop) {
|
|
return function (reader) {
|
|
return function (f) {
|
|
var go = function (a) {
|
|
return Control_Bind.composeKleisliFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(reader)(Foreign_Index.readProp(prop))(Foreign.unsafeToForeign(a));
|
|
};
|
|
return handler(key)(Control_Bind.composeKleisli(Data_Maybe.bindMaybe)(Web_Event_Event.currentTarget)(function (e) {
|
|
return Data_Either.either(Data_Function["const"](Data_Maybe.Nothing.value))(f)(Control_Monad_Except.runExcept(go(e)));
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var onChecked = addForeignPropHandler(Web_HTML_Event_EventTypes.change)("checked")(Foreign.readBoolean);
|
|
var onValueChange = addForeignPropHandler(Web_HTML_Event_EventTypes.change)("value")(Foreign.readString);
|
|
exports["input"] = input;
|
|
exports["input_"] = input_;
|
|
exports["handler"] = handler;
|
|
exports["onSubmit"] = onSubmit;
|
|
exports["onClick"] = onClick;
|
|
exports["onValueChange"] = onValueChange;
|
|
exports["onChecked"] = onChecked;
|
|
})(PS["Halogen.HTML.Events"] = PS["Halogen.HTML.Events"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
/* global Symbol */
|
|
|
|
var hasArrayFrom = typeof Array.from === "function";
|
|
var hasStringIterator =
|
|
typeof Symbol !== "undefined" &&
|
|
Symbol != null &&
|
|
typeof Symbol.iterator !== "undefined" &&
|
|
typeof String.prototype[Symbol.iterator] === "function";
|
|
var hasFromCodePoint = typeof String.prototype.fromCodePoint === "function";
|
|
var hasCodePointAt = typeof String.prototype.codePointAt === "function";
|
|
|
|
exports._unsafeCodePointAt0 = function (fallback) {
|
|
return hasCodePointAt
|
|
? function (str) { return str.codePointAt(0); }
|
|
: fallback;
|
|
};
|
|
|
|
exports._singleton = function (fallback) {
|
|
return hasFromCodePoint ? String.fromCodePoint : fallback;
|
|
};
|
|
|
|
exports._take = function (fallback) {
|
|
return function (n) {
|
|
if (hasStringIterator) {
|
|
return function (str) {
|
|
var accum = "";
|
|
var iter = str[Symbol.iterator]();
|
|
for (var i = 0; i < n; ++i) {
|
|
var o = iter.next();
|
|
if (o.done) return accum;
|
|
accum += o.value;
|
|
}
|
|
return accum;
|
|
};
|
|
}
|
|
return fallback(n);
|
|
};
|
|
};
|
|
|
|
exports._toCodePointArray = function (fallback) {
|
|
return function (unsafeCodePointAt0) {
|
|
if (hasArrayFrom) {
|
|
return function (str) {
|
|
return Array.from(str, unsafeCodePointAt0);
|
|
};
|
|
}
|
|
return fallback;
|
|
};
|
|
};
|
|
})(PS["Data.String.CodePoints"] = PS["Data.String.CodePoints"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Data.String.CodePoints"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Bounded = PS["Data.Bounded"];
|
|
var Data_Enum = PS["Data.Enum"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_EuclideanRing = PS["Data.EuclideanRing"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Int = PS["Data.Int"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Ring = PS["Data.Ring"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String_CodeUnits = PS["Data.String.CodeUnits"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_String_Unsafe = PS["Data.String.Unsafe"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unfoldable = PS["Data.Unfoldable"];
|
|
var Prelude = PS["Prelude"];
|
|
var unsurrogate = function (lead) {
|
|
return function (trail) {
|
|
return (((lead - 55296 | 0) * 1024 | 0) + (trail - 56320 | 0) | 0) + 65536 | 0;
|
|
};
|
|
};
|
|
var isTrail = function (cu) {
|
|
return 56320 <= cu && cu <= 57343;
|
|
};
|
|
var isLead = function (cu) {
|
|
return 55296 <= cu && cu <= 56319;
|
|
};
|
|
var uncons = function (s) {
|
|
var v = Data_String_CodeUnits.length(s);
|
|
if (v === 0) {
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
if (v === 1) {
|
|
return new Data_Maybe.Just({
|
|
head: Data_Enum.fromEnum(Data_Enum.boundedEnumChar)(Data_String_Unsafe.charAt(0)(s)),
|
|
tail: ""
|
|
});
|
|
};
|
|
var cu1 = Data_Enum.fromEnum(Data_Enum.boundedEnumChar)(Data_String_Unsafe.charAt(1)(s));
|
|
var cu0 = Data_Enum.fromEnum(Data_Enum.boundedEnumChar)(Data_String_Unsafe.charAt(0)(s));
|
|
var $21 = isLead(cu0) && isTrail(cu1);
|
|
if ($21) {
|
|
return new Data_Maybe.Just({
|
|
head: unsurrogate(cu0)(cu1),
|
|
tail: Data_String_CodeUnits.drop(2)(s)
|
|
});
|
|
};
|
|
return new Data_Maybe.Just({
|
|
head: cu0,
|
|
tail: Data_String_CodeUnits.drop(1)(s)
|
|
});
|
|
};
|
|
var unconsButWithTuple = function (s) {
|
|
return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
|
|
return new Data_Tuple.Tuple(v.head, v.tail);
|
|
})(uncons(s));
|
|
};
|
|
var toCodePointArrayFallback = function (s) {
|
|
return Data_Unfoldable.unfoldr(Data_Unfoldable.unfoldableArray)(unconsButWithTuple)(s);
|
|
};
|
|
var unsafeCodePointAt0Fallback = function (s) {
|
|
var cu0 = Data_Enum.fromEnum(Data_Enum.boundedEnumChar)(Data_String_Unsafe.charAt(0)(s));
|
|
var $25 = isLead(cu0) && Data_String_CodeUnits.length(s) > 1;
|
|
if ($25) {
|
|
var cu1 = Data_Enum.fromEnum(Data_Enum.boundedEnumChar)(Data_String_Unsafe.charAt(1)(s));
|
|
var $26 = isTrail(cu1);
|
|
if ($26) {
|
|
return unsurrogate(cu0)(cu1);
|
|
};
|
|
return cu0;
|
|
};
|
|
return cu0;
|
|
};
|
|
var unsafeCodePointAt0 = $foreign["_unsafeCodePointAt0"](unsafeCodePointAt0Fallback);
|
|
var toCodePointArray = $foreign["_toCodePointArray"](toCodePointArrayFallback)(unsafeCodePointAt0);
|
|
var length = function ($52) {
|
|
return Data_Array.length(toCodePointArray($52));
|
|
};
|
|
var fromCharCode = function ($53) {
|
|
return Data_String_CodeUnits.singleton(Data_Enum.toEnumWithDefaults(Data_Enum.boundedEnumChar)(Data_Bounded.bottom(Data_Bounded.boundedChar))(Data_Bounded.top(Data_Bounded.boundedChar))($53));
|
|
};
|
|
var singletonFallback = function (v) {
|
|
if (v <= 65535) {
|
|
return fromCharCode(v);
|
|
};
|
|
var lead = Data_EuclideanRing.div(Data_EuclideanRing.euclideanRingInt)(v - 65536 | 0)(1024) + 55296 | 0;
|
|
var trail = Data_EuclideanRing.mod(Data_EuclideanRing.euclideanRingInt)(v - 65536 | 0)(1024) + 56320 | 0;
|
|
return fromCharCode(lead) + fromCharCode(trail);
|
|
};
|
|
var singleton = $foreign["_singleton"](singletonFallback);
|
|
var takeFallback = function (n) {
|
|
return function (v) {
|
|
if (n < 1) {
|
|
return "";
|
|
};
|
|
var v1 = uncons(v);
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
return singleton(v1.value0.head) + takeFallback(n - 1 | 0)(v1.value0.tail);
|
|
};
|
|
return v;
|
|
};
|
|
};
|
|
var take = $foreign["_take"](takeFallback);
|
|
var drop = function (n) {
|
|
return function (s) {
|
|
return Data_String_CodeUnits.drop(Data_String_CodeUnits.length(take(n)(s)))(s);
|
|
};
|
|
};
|
|
exports["singleton"] = singleton;
|
|
exports["toCodePointArray"] = toCodePointArray;
|
|
exports["uncons"] = uncons;
|
|
exports["length"] = length;
|
|
exports["take"] = take;
|
|
exports["drop"] = drop;
|
|
})(PS["Data.String.CodePoints"] = PS["Data.String.CodePoints"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Maybe_Trans = PS["Control.Monad.Maybe.Trans"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_CodePoints = PS["Data.String.CodePoints"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Global_Unsafe = PS["Global.Unsafe"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Partial_Unsafe = PS["Partial.Unsafe"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_NodeList = PS["Web.DOM.NodeList"];
|
|
var Web_DOM_NonElementParentNode = PS["Web.DOM.NonElementParentNode"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Web_HTML_Window = PS["Web.HTML.Window"];
|
|
var fromNullableStr = function ($57) {
|
|
return Data_Maybe.fromMaybe("")(Data_Nullable.toMaybe($57));
|
|
};
|
|
var class_ = function ($58) {
|
|
return Halogen_HTML_Properties.class_(Halogen_HTML_Core.ClassName($58));
|
|
};
|
|
var attr = function (a) {
|
|
return Halogen_HTML_Properties.attr(a);
|
|
};
|
|
var _parseQueryString = function (srh) {
|
|
var decode = function ($59) {
|
|
return Global_Unsafe.unsafeDecodeURIComponent(Data_String_Common.replaceAll("+")(" ")($59));
|
|
};
|
|
var go = function (kv) {
|
|
var v = Data_String_Common.split("=")(kv);
|
|
if (v.length === 1) {
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(decode(v[0]), Data_Maybe.Nothing.value));
|
|
};
|
|
if (v.length === 2) {
|
|
return new Data_Maybe.Just(new Data_Tuple.Tuple(decode(v[0]), new Data_Maybe.Just(decode(v[1]))));
|
|
};
|
|
return Data_Maybe.Nothing.value;
|
|
};
|
|
var qs = (function () {
|
|
var srh$prime = Data_String_CodePoints.take(1)(srh);
|
|
var $54 = srh$prime === "#" || srh$prime === "?";
|
|
if ($54) {
|
|
return Data_String_CodePoints.drop(1)(srh);
|
|
};
|
|
return srh;
|
|
})();
|
|
return Data_Array.mapMaybe(go)(Data_Array.filter(function (v) {
|
|
return v !== "";
|
|
})(Data_String_Common.split("&")(qs)));
|
|
};
|
|
var _lookupQueryStringValue = function (qs) {
|
|
return function (k) {
|
|
return Control_Bind.join(Data_Maybe.bindMaybe)(Data_Functor.map(Data_Maybe.functorMaybe)(Data_Tuple.snd)(Data_Foldable.find(Data_Foldable.foldableArray)(function ($61) {
|
|
return (function (v) {
|
|
return v === k;
|
|
})(Data_Tuple.fst($61));
|
|
})(qs)));
|
|
};
|
|
};
|
|
var _loc = Control_Bind.bindFlipped(Effect.bindEffect)(Web_HTML_Window.location)(Web_HTML.window);
|
|
var _curQuerystring = function __do() {
|
|
var v = _loc();
|
|
var v1 = Web_HTML_Location.search(v)();
|
|
return _parseQueryString(v1);
|
|
};
|
|
exports["class_"] = class_;
|
|
exports["attr"] = attr;
|
|
exports["_loc"] = _loc;
|
|
exports["_curQuerystring"] = _curQuerystring;
|
|
exports["_parseQueryString"] = _parseQueryString;
|
|
exports["_lookupQueryStringValue"] = _lookupQueryStringValue;
|
|
exports["fromNullableStr"] = fromNullableStr;
|
|
})(PS["Util"] = PS["Util"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var App = PS["App"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Lens = PS["Data.Lens"];
|
|
var Data_Lens_Getter = PS["Data.Lens.Getter"];
|
|
var Data_Lens_Internal_Forget = PS["Data.Lens.Internal.Forget"];
|
|
var Data_Lens_Lens = PS["Data.Lens.Lens"];
|
|
var Data_Lens_Setter = PS["Data.Lens.Setter"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Util = PS["Util"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var EarchiveDefault = (function () {
|
|
function EarchiveDefault(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
EarchiveDefault.create = function (value0) {
|
|
return new EarchiveDefault(value0);
|
|
};
|
|
return EarchiveDefault;
|
|
})();
|
|
var EprivateDefault = (function () {
|
|
function EprivateDefault(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
EprivateDefault.create = function (value0) {
|
|
return new EprivateDefault(value0);
|
|
};
|
|
return EprivateDefault;
|
|
})();
|
|
var EprivacyLock = (function () {
|
|
function EprivacyLock(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
EprivacyLock.create = function (value0) {
|
|
return new EprivacyLock(value0);
|
|
};
|
|
return EprivacyLock;
|
|
})();
|
|
var UEditField = (function () {
|
|
function UEditField(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
UEditField.create = function (value0) {
|
|
return function (value1) {
|
|
return new UEditField(value0, value1);
|
|
};
|
|
};
|
|
return UEditField;
|
|
})();
|
|
var USubmit = (function () {
|
|
function USubmit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
USubmit.create = function (value0) {
|
|
return function (value1) {
|
|
return new USubmit(value0, value1);
|
|
};
|
|
};
|
|
return USubmit;
|
|
})();
|
|
var _us = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.us;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
us: v1
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var usetting = function (u$prime) {
|
|
var render = function (v) {
|
|
var editField = function (f) {
|
|
return function ($22) {
|
|
return Halogen_HTML_Events.input(UEditField.create)(f($22));
|
|
};
|
|
};
|
|
return Halogen_HTML_Elements.div([ Util.class_("settings-form") ])([ Halogen_HTML_Elements.div([ Util.class_("fw7 mb2") ])([ Halogen_HTML_Core.text("Account Settings") ]), Halogen_HTML_Elements.div([ Util.class_("flex items-center mb2") ])([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("pointer mr2"), Halogen_HTML_Properties.id_("archiveDefault"), Halogen_HTML_Properties.name("archiveDefault"), Halogen_HTML_Properties.checked(v.us.archiveDefault), Halogen_HTML_Events.onChecked(editField(EarchiveDefault.create)) ]), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("archiveDefault"), Util.class_("lh-copy") ])([ Halogen_HTML_Core.text("Archive Non-Private Bookmarks (archive.li)") ]) ]), Halogen_HTML_Elements.div([ Util.class_("flex items-center mb2") ])([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("pointer mr2"), Halogen_HTML_Properties.id_("privateDefault"), Halogen_HTML_Properties.name("privateDefault"), Halogen_HTML_Properties.checked(v.us.privateDefault), Halogen_HTML_Events.onChecked(editField(EprivateDefault.create)) ]), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("privateDefault"), Util.class_("lh-copy") ])([ Halogen_HTML_Core.text("Default new bookmarks to Private") ]) ]), Halogen_HTML_Elements.div([ Util.class_("flex items-center mb2") ])([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("pointer mr2"), Halogen_HTML_Properties.id_("privacyLock"), Halogen_HTML_Properties.name("privacyLock"), Halogen_HTML_Properties.checked(v.us.privacyLock), Halogen_HTML_Events.onChecked(editField(EprivacyLock.create)) ]), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("privacyLock"), Util.class_("lh-copy") ])([ Halogen_HTML_Core.text("Privacy Lock (Private Account)") ]) ]) ]);
|
|
};
|
|
var mkState = function (u) {
|
|
return {
|
|
us: u
|
|
};
|
|
};
|
|
var $$eval = function (v) {
|
|
if (v instanceof UEditField) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_us(Data_Profunctor_Strong.strongFn))((function () {
|
|
if (v.value0 instanceof EarchiveDefault) {
|
|
return function (v1) {
|
|
return {
|
|
archiveDefault: v.value0.value0,
|
|
privateDefault: v1.privateDefault,
|
|
privacyLock: v1.privacyLock
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof EprivateDefault) {
|
|
return function (v1) {
|
|
return {
|
|
archiveDefault: v1.archiveDefault,
|
|
privateDefault: v.value0.value0,
|
|
privacyLock: v1.privacyLock
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof EprivacyLock) {
|
|
return function (v1) {
|
|
return {
|
|
archiveDefault: v1.archiveDefault,
|
|
privateDefault: v1.privateDefault,
|
|
privacyLock: v.value0.value0
|
|
};
|
|
};
|
|
};
|
|
throw new Error("Failed pattern match at Component.AccountSettings (line 82, column 12 - line 85, column 46): " + [ v.value0.constructor.name ]);
|
|
})()))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof USubmit) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_us(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.editAccountSettings(v1))))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.AccountSettings (line 80, column 3 - line 80, column 58): " + [ v.constructor.name ]);
|
|
};
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
return Halogen_Component.component(Halogen_HTML_Core.bifunctorHTML)({
|
|
initialState: Data_Function["const"](mkState(u$prime)),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["_us"] = _us;
|
|
exports["UEditField"] = UEditField;
|
|
exports["USubmit"] = USubmit;
|
|
exports["EarchiveDefault"] = EarchiveDefault;
|
|
exports["EprivateDefault"] = EprivateDefault;
|
|
exports["EprivacyLock"] = EprivacyLock;
|
|
exports["usetting"] = usetting;
|
|
})(PS["Component.AccountSettings"] = PS["Component.AccountSettings"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var App = PS["App"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed_ButtonType = PS["DOM.HTML.Indexed.ButtonType"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Lens = PS["Data.Lens"];
|
|
var Data_Lens_Getter = PS["Data.Lens.Getter"];
|
|
var Data_Lens_Internal_Forget = PS["Data.Lens.Internal.Forget"];
|
|
var Data_Lens_Lens = PS["Data.Lens.Lens"];
|
|
var Data_Lens_Setter = PS["Data.Lens.Setter"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Util = PS["Util"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Eurl = (function () {
|
|
function Eurl(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Eurl.create = function (value0) {
|
|
return new Eurl(value0);
|
|
};
|
|
return Eurl;
|
|
})();
|
|
var Etitle = (function () {
|
|
function Etitle(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etitle.create = function (value0) {
|
|
return new Etitle(value0);
|
|
};
|
|
return Etitle;
|
|
})();
|
|
var Edescription = (function () {
|
|
function Edescription(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Edescription.create = function (value0) {
|
|
return new Edescription(value0);
|
|
};
|
|
return Edescription;
|
|
})();
|
|
var Etags = (function () {
|
|
function Etags(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etags.create = function (value0) {
|
|
return new Etags(value0);
|
|
};
|
|
return Etags;
|
|
})();
|
|
var Eprivate = (function () {
|
|
function Eprivate(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Eprivate.create = function (value0) {
|
|
return new Eprivate(value0);
|
|
};
|
|
return Eprivate;
|
|
})();
|
|
var Etoread = (function () {
|
|
function Etoread(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etoread.create = function (value0) {
|
|
return new Etoread(value0);
|
|
};
|
|
return Etoread;
|
|
})();
|
|
var BEditField = (function () {
|
|
function BEditField(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BEditField.create = function (value0) {
|
|
return function (value1) {
|
|
return new BEditField(value0, value1);
|
|
};
|
|
};
|
|
return BEditField;
|
|
})();
|
|
var BEditSubmit = (function () {
|
|
function BEditSubmit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BEditSubmit.create = function (value0) {
|
|
return function (value1) {
|
|
return new BEditSubmit(value0, value1);
|
|
};
|
|
};
|
|
return BEditSubmit;
|
|
})();
|
|
var BDeleteAsk = (function () {
|
|
function BDeleteAsk(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BDeleteAsk.create = function (value0) {
|
|
return function (value1) {
|
|
return new BDeleteAsk(value0, value1);
|
|
};
|
|
};
|
|
return BDeleteAsk;
|
|
})();
|
|
var BDestroy = (function () {
|
|
function BDestroy(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
BDestroy.create = function (value0) {
|
|
return new BDestroy(value0);
|
|
};
|
|
return BDestroy;
|
|
})();
|
|
var _edit_bm = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.edit_bm;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
edit_bm: v1,
|
|
bm: v.bm,
|
|
deleteAsk: v.deleteAsk,
|
|
destroyed: v.destroyed
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var _bm = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.bm;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
bm: v1,
|
|
deleteAsk: v.deleteAsk,
|
|
destroyed: v.destroyed,
|
|
edit_bm: v.edit_bm
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var addbmark = function (b$prime) {
|
|
var render = function (v) {
|
|
var toTextarea = function ($58) {
|
|
return Data_Array.drop(1)(Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidArray)(function (x) {
|
|
return [ Halogen_HTML_Elements.br_, Halogen_HTML_Core.text(x) ];
|
|
})(Data_String_Common.split("\x0a")($58)));
|
|
};
|
|
var mmoment = Globals.mmoment8601(v.bm.time);
|
|
var editField = function (f) {
|
|
return function ($59) {
|
|
return Halogen_HTML_Events.input(BEditField.create)(f($59));
|
|
};
|
|
};
|
|
var display_exists = Halogen_HTML_Elements.div([ Util.class_("alert") ])([ Halogen_HTML_Core.text("previously saved\xa0"), Halogen_HTML_Elements.span([ Util.class_("link f7 dib gray pr3"), Halogen_HTML_Properties.title(Data_Maybe.maybe(v.bm.time)(Data_Tuple.snd)(mmoment)) ])([ Halogen_HTML_Core.text(Data_Maybe.maybe("\xa0")(Data_Tuple.fst)(mmoment)) ]), Halogen_HTML_Elements.div([ Util.class_("edit_links dib ml1") ])([ Halogen_HTML_Elements.div([ Util.class_("delete_link di") ])([ Halogen_HTML_Elements.button(Data_Semigroup.append(Data_Semigroup.semigroupArray)([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDeleteAsk.create(true))), Util.class_("delete") ])(Data_Monoid.guard(Data_Monoid.monoidArray)(v.deleteAsk)([ Util.attr("hidden")("hidden") ])))([ Halogen_HTML_Core.text("delete") ]), Halogen_HTML_Elements.span(Data_Semigroup.append(Data_Semigroup.semigroupArray)([ Util.class_("confirm red") ])(Data_Monoid.guard(Data_Monoid.monoidArray)(!v.deleteAsk)([ Util.attr("hidden")("hidden") ])))([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDeleteAsk.create(false))) ])([ Halogen_HTML_Core.text("cancel\xa0/\xa0") ]), Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDestroy.create)), Util.class_("red") ])([ Halogen_HTML_Core.text("destroy") ]) ]) ]) ]) ]);
|
|
var display_edit = Halogen_HTML_Elements.form([ Halogen_HTML_Events.onSubmit(Halogen_HTML_Events.input(BEditSubmit.create)) ])([ Halogen_HTML_Elements.table([ Util.class_("w-100") ])([ Halogen_HTML_Elements.tbody_([ Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td([ Util.class_("w1") ])([ ]), Halogen_HTML_Elements.td_(Data_Monoid.guard(Data_Monoid.monoidArray)(v.bm.bid > 0)([ display_exists ])) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("url") ])([ Halogen_HTML_Core.text("URL") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputUrl.value), Halogen_HTML_Properties.id_("url"), Util.class_("w-100 mv1"), Halogen_HTML_Properties.required(true), Halogen_HTML_Properties.name("url"), Halogen_HTML_Properties.autofocus(Data_String_Common["null"](v.bm.url)), Halogen_HTML_Properties.value(v.edit_bm.url), Halogen_HTML_Events.onValueChange(editField(Eurl.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("title") ])([ Halogen_HTML_Core.text("title") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputText.value), Halogen_HTML_Properties.id_("title"), Util.class_("w-100 mv1"), Halogen_HTML_Properties.name("title"), Halogen_HTML_Properties.value(v.edit_bm.title), Halogen_HTML_Events.onValueChange(editField(Etitle.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("description") ])([ Halogen_HTML_Core.text("description") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.textarea([ Util.class_("w-100 mt1 mid-gray"), Halogen_HTML_Properties.id_("description"), Halogen_HTML_Properties.name("description"), Halogen_HTML_Properties.rows(4), Halogen_HTML_Properties.value(v.edit_bm.description), Halogen_HTML_Events.onValueChange(editField(Edescription.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("tags") ])([ Halogen_HTML_Core.text("tags") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputText.value), Halogen_HTML_Properties.id_("tags"), Util.class_("w-100 mv1"), Halogen_HTML_Properties.name("tags"), Halogen_HTML_Properties.autocomplete(false), Util.attr("autocapitalize")("off"), Halogen_HTML_Properties.autofocus(!Data_String_Common["null"](v.bm.url)), Halogen_HTML_Properties.value(v.edit_bm.tags), Halogen_HTML_Events.onValueChange(editField(Etags.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("private") ])([ Halogen_HTML_Core.text("private") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Halogen_HTML_Properties.id_("private"), Util.class_("private pointer"), Halogen_HTML_Properties.name("private"), Halogen_HTML_Properties.checked(v["edit_bm"]["private"]), Halogen_HTML_Events.onChecked(editField(Eprivate.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("toread") ])([ Halogen_HTML_Core.text("read later") ]) ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Halogen_HTML_Properties.id_("toread"), Util.class_("toread pointer"), Halogen_HTML_Properties.name("toread"), Halogen_HTML_Properties.checked(v.edit_bm.toread), Halogen_HTML_Events.onChecked(editField(Etoread.create)) ]) ]) ]), Halogen_HTML_Elements.tr_([ Halogen_HTML_Elements.td_([ ]), Halogen_HTML_Elements.td_([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputSubmit.value), Util.class_("ph3 pv2 input-reset ba b--navy bg-transparent pointer f6 dib mt1 dim"), Halogen_HTML_Properties.value((function () {
|
|
var $26 = v.bm.bid > 0;
|
|
if ($26) {
|
|
return "update bookmark";
|
|
};
|
|
return "add bookmark";
|
|
})()) ]) ]) ]) ]) ]) ]);
|
|
var display_destroyed = Halogen_HTML_Elements.p([ Util.class_("red") ])([ Halogen_HTML_Core.text("you killed this bookmark") ]);
|
|
return Halogen_HTML_Elements.div_([ (function () {
|
|
var $27 = !v.destroyed;
|
|
if ($27) {
|
|
return display_edit;
|
|
};
|
|
return display_destroyed;
|
|
})() ]);
|
|
};
|
|
var mkState = function (b) {
|
|
return {
|
|
bm: b,
|
|
edit_bm: b,
|
|
deleteAsk: false,
|
|
destroyed: false
|
|
};
|
|
};
|
|
var $$eval = function (v) {
|
|
if (v instanceof BDeleteAsk) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v1) {
|
|
var $31 = {};
|
|
for (var $32 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $32)) {
|
|
$31[$32] = v1[$32];
|
|
};
|
|
};
|
|
$31.deleteAsk = v.value0;
|
|
return $31;
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof BDestroy) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.gets(Halogen_Query_HalogenM.monadStateHalogenM)(function (v1) {
|
|
return v1.bm.bid;
|
|
}))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.destroy(v1))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v2) {
|
|
var $37 = {};
|
|
for (var $38 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $38)) {
|
|
$37[$38] = v2[$38];
|
|
};
|
|
};
|
|
$37.destroyed = true;
|
|
return $37;
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof BEditField) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Profunctor_Strong.strongFn))((function () {
|
|
if (v.value0 instanceof Eurl) {
|
|
return function (v1) {
|
|
return {
|
|
url: v.value0.value0,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etitle) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v.value0.value0,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Edescription) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v.value0.value0,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etags) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v.value0.value0,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Eprivate) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v.value0.value0,
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etoread) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v.value0.value0,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
throw new Error("Failed pattern match at Component.Add (line 160, column 17 - line 166, column 36): " + [ v.value0.constructor.name ]);
|
|
})()))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof BEditSubmit) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Web_Event_Event.preventDefault(v.value0)))(function () {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.editBookmark(v1))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Profunctor_Strong.strongFn))(v1))(function () {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Util["_loc"]))(function (v2) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Web_HTML.window))(function (v3) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Util["_curQuerystring"]))(function (v4) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)((function () {
|
|
var v5 = Util["_lookupQueryStringValue"](v4)("next");
|
|
if (v5 instanceof Data_Maybe.Just) {
|
|
return Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Web_HTML_Location.setHref(v5.value0)(v2));
|
|
};
|
|
return Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Globals.closeWindow(v3));
|
|
})())(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.Add (line 150, column 3 - line 150, column 58): " + [ v.constructor.name ]);
|
|
};
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
return Halogen_Component.component(Halogen_HTML_Core.bifunctorHTML)({
|
|
initialState: Data_Function["const"](mkState(b$prime)),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["BEditField"] = BEditField;
|
|
exports["BEditSubmit"] = BEditSubmit;
|
|
exports["BDeleteAsk"] = BDeleteAsk;
|
|
exports["BDestroy"] = BDestroy;
|
|
exports["Eurl"] = Eurl;
|
|
exports["Etitle"] = Etitle;
|
|
exports["Edescription"] = Edescription;
|
|
exports["Etags"] = Etags;
|
|
exports["Eprivate"] = Eprivate;
|
|
exports["Etoread"] = Etoread;
|
|
exports["_bm"] = _bm;
|
|
exports["_edit_bm"] = _edit_bm;
|
|
exports["addbmark"] = addbmark;
|
|
})(PS["Component.Add"] = PS["Component.Add"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var App = PS["App"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed_ButtonType = PS["DOM.HTML.Indexed.ButtonType"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Lens = PS["Data.Lens"];
|
|
var Data_Lens_Getter = PS["Data.Lens.Getter"];
|
|
var Data_Lens_Internal_Forget = PS["Data.Lens.Internal.Forget"];
|
|
var Data_Lens_Lens = PS["Data.Lens.Lens"];
|
|
var Data_Lens_Setter = PS["Data.Lens.Setter"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_CodePoints = PS["Data.String.CodePoints"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Util = PS["Util"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Eurl = (function () {
|
|
function Eurl(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Eurl.create = function (value0) {
|
|
return new Eurl(value0);
|
|
};
|
|
return Eurl;
|
|
})();
|
|
var Etitle = (function () {
|
|
function Etitle(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etitle.create = function (value0) {
|
|
return new Etitle(value0);
|
|
};
|
|
return Etitle;
|
|
})();
|
|
var Edescription = (function () {
|
|
function Edescription(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Edescription.create = function (value0) {
|
|
return new Edescription(value0);
|
|
};
|
|
return Edescription;
|
|
})();
|
|
var Etags = (function () {
|
|
function Etags(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etags.create = function (value0) {
|
|
return new Etags(value0);
|
|
};
|
|
return Etags;
|
|
})();
|
|
var Eprivate = (function () {
|
|
function Eprivate(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Eprivate.create = function (value0) {
|
|
return new Eprivate(value0);
|
|
};
|
|
return Eprivate;
|
|
})();
|
|
var Etoread = (function () {
|
|
function Etoread(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etoread.create = function (value0) {
|
|
return new Etoread(value0);
|
|
};
|
|
return Etoread;
|
|
})();
|
|
var BStar = (function () {
|
|
function BStar(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BStar.create = function (value0) {
|
|
return function (value1) {
|
|
return new BStar(value0, value1);
|
|
};
|
|
};
|
|
return BStar;
|
|
})();
|
|
var BDeleteAsk = (function () {
|
|
function BDeleteAsk(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BDeleteAsk.create = function (value0) {
|
|
return function (value1) {
|
|
return new BDeleteAsk(value0, value1);
|
|
};
|
|
};
|
|
return BDeleteAsk;
|
|
})();
|
|
var BDestroy = (function () {
|
|
function BDestroy(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
BDestroy.create = function (value0) {
|
|
return new BDestroy(value0);
|
|
};
|
|
return BDestroy;
|
|
})();
|
|
var BEdit = (function () {
|
|
function BEdit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BEdit.create = function (value0) {
|
|
return function (value1) {
|
|
return new BEdit(value0, value1);
|
|
};
|
|
};
|
|
return BEdit;
|
|
})();
|
|
var BEditField = (function () {
|
|
function BEditField(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BEditField.create = function (value0) {
|
|
return function (value1) {
|
|
return new BEditField(value0, value1);
|
|
};
|
|
};
|
|
return BEditField;
|
|
})();
|
|
var BEditSubmit = (function () {
|
|
function BEditSubmit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
BEditSubmit.create = function (value0) {
|
|
return function (value1) {
|
|
return new BEditSubmit(value0, value1);
|
|
};
|
|
};
|
|
return BEditSubmit;
|
|
})();
|
|
var BMarkRead = (function () {
|
|
function BMarkRead(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
BMarkRead.create = function (value0) {
|
|
return new BMarkRead(value0);
|
|
};
|
|
return BMarkRead;
|
|
})();
|
|
var BNotifyRemove = (function () {
|
|
function BNotifyRemove() {
|
|
|
|
};
|
|
BNotifyRemove.value = new BNotifyRemove();
|
|
return BNotifyRemove;
|
|
})();
|
|
var _edit_bm = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.edit_bm;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
edit_bm: v1,
|
|
bm: v.bm,
|
|
deleteAsk: v.deleteAsk,
|
|
edit: v.edit
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var _edit = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.edit;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
edit: v1,
|
|
bm: v.bm,
|
|
deleteAsk: v.deleteAsk,
|
|
edit_bm: v.edit_bm
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var _bm = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.bm;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
bm: v1,
|
|
deleteAsk: v.deleteAsk,
|
|
edit: v.edit,
|
|
edit_bm: v.edit_bm
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var bmark = function (b$prime) {
|
|
var mkState = function (b) {
|
|
return {
|
|
bm: b,
|
|
edit_bm: b,
|
|
deleteAsk: false,
|
|
edit: false
|
|
};
|
|
};
|
|
var $$eval = function (v) {
|
|
if (v instanceof BStar) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.toggleStar(v1.bid)((function () {
|
|
if (v.value0) {
|
|
return App.Star.value;
|
|
};
|
|
return App.UnStar.value;
|
|
})())))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Profunctor_Strong.strongFn))(function (v2) {
|
|
return {
|
|
url: v2.url,
|
|
title: v2.title,
|
|
description: v2.description,
|
|
tags: v2.tags,
|
|
"private": v2["private"],
|
|
toread: v2.toread,
|
|
bid: v2.bid,
|
|
slug: v2.slug,
|
|
selected: v.value0,
|
|
time: v2.time,
|
|
archiveUrl: v2.archiveUrl
|
|
};
|
|
}))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Profunctor_Strong.strongFn))(function (v2) {
|
|
return {
|
|
url: v2.url,
|
|
title: v2.title,
|
|
description: v2.description,
|
|
tags: v2.tags,
|
|
"private": v2["private"],
|
|
toread: v2.toread,
|
|
bid: v2.bid,
|
|
slug: v2.slug,
|
|
selected: v.value0,
|
|
time: v2.time,
|
|
archiveUrl: v2.archiveUrl
|
|
};
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof BDeleteAsk) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v1) {
|
|
var $34 = {};
|
|
for (var $35 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $35)) {
|
|
$34[$35] = v1[$35];
|
|
};
|
|
};
|
|
$34.deleteAsk = v.value0;
|
|
return $34;
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof BDestroy) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.destroy(v1.bid))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Halogen_Query_HalogenM.raise(BNotifyRemove.value))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof BMarkRead) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.markRead(v1.bid))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Profunctor_Strong.strongFn))(function (v2) {
|
|
return {
|
|
url: v2.url,
|
|
title: v2.title,
|
|
description: v2.description,
|
|
tags: v2.tags,
|
|
"private": v2["private"],
|
|
toread: false,
|
|
bid: v2.bid,
|
|
slug: v2.slug,
|
|
selected: v2.selected,
|
|
time: v2.time,
|
|
archiveUrl: v2.archiveUrl
|
|
};
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof BEdit) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Profunctor_Strong.strongFn))(v1))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit(Data_Profunctor_Strong.strongFn))(v.value0))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof BEditField) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Profunctor_Strong.strongFn))((function () {
|
|
if (v.value0 instanceof Eurl) {
|
|
return function (v1) {
|
|
return {
|
|
url: v.value0.value0,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etitle) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v.value0.value0,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Edescription) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v.value0.value0,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etags) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v.value0.value0,
|
|
"private": v1["private"],
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Eprivate) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v.value0.value0,
|
|
toread: v1.toread,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etoread) {
|
|
return function (v1) {
|
|
return {
|
|
url: v1.url,
|
|
title: v1.title,
|
|
description: v1.description,
|
|
tags: v1.tags,
|
|
"private": v1["private"],
|
|
toread: v.value0.value0,
|
|
bid: v1.bid,
|
|
slug: v1.slug,
|
|
selected: v1.selected,
|
|
time: v1.time,
|
|
archiveUrl: v1.archiveUrl
|
|
};
|
|
};
|
|
};
|
|
throw new Error("Failed pattern match at Component.BMark (line 231, column 17 - line 237, column 36): " + [ v.value0.constructor.name ]);
|
|
})()))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof BEditSubmit) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Web_Event_Event.preventDefault(v.value0)))(function () {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_bm(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.editBookmark(v1))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_bm(Data_Profunctor_Strong.strongFn))(v1))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit(Data_Profunctor_Strong.strongFn))(false))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.BMark (line 193, column 3 - line 193, column 62): " + [ v.constructor.name ]);
|
|
};
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
var render = function (v) {
|
|
var toTextarea = function (input) {
|
|
return Data_Array.drop(1)(Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidArray)(function (x) {
|
|
return [ Halogen_HTML_Elements.br_, Halogen_HTML_Core.text(x) ];
|
|
})(Data_String_Common.split("\x0a")(input)));
|
|
};
|
|
var star = Data_Monoid.guard(Data_Monoid.monoidArray)(app.dat.isowner)([ Halogen_HTML_Elements.div([ Util.class_("star fl pointer" + Data_Monoid.guard(Data_Monoid.monoidString)(v.bm.selected)(" selected")) ])([ Halogen_HTML_Elements.button([ Util.class_("moon-gray"), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BStar.create(!v.bm.selected))) ])([ Halogen_HTML_Core.text("\u272d") ]) ]) ]);
|
|
var mmoment = Globals.mmoment8601(v.bm.time);
|
|
var links = Data_Monoid.guard(Data_Monoid.monoidArray)(app.dat.isowner)([ Halogen_HTML_Elements.div([ Util.class_("edit_links di") ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BEdit.create(true))), Util.class_("edit light-silver hover-blue") ])([ Halogen_HTML_Core.text("edit\xa0\xa0") ]), Halogen_HTML_Elements.div([ Util.class_("delete_link di") ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDeleteAsk.create(true))), Util.class_("delete light-silver hover-blue" + Data_Monoid.guard(Data_Monoid.monoidString)(v.deleteAsk)(" dn")) ])([ Halogen_HTML_Core.text("delete") ]), Halogen_HTML_Elements.span([ Util.class_("confirm red" + Data_Monoid.guard(Data_Monoid.monoidString)(!v.deleteAsk)(" dn")) ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDeleteAsk.create(false))) ])([ Halogen_HTML_Core.text("cancel\xa0/\xa0") ]), Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BDestroy.create)), Util.class_("red") ])([ Halogen_HTML_Core.text("destroy") ]) ]) ]) ]), Halogen_HTML_Elements.div([ Util.class_("read di") ])(Data_Monoid.guard(Data_Monoid.monoidArray)(v.bm.toread)([ Halogen_HTML_Core.text("\xa0\xa0"), Halogen_HTML_Elements.button([ Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BMarkRead.create)), Util.class_("mark_read") ])([ Halogen_HTML_Core.text("mark as read") ]) ])) ]);
|
|
var linkToFilterTag = function (tag) {
|
|
return Util.fromNullableStr(app.userR) + ("/t:" + tag);
|
|
};
|
|
var linkToFilterSingle = function (slug) {
|
|
return Util.fromNullableStr(app.userR) + ("/b:" + slug);
|
|
};
|
|
var editField = function (f) {
|
|
return function ($64) {
|
|
return Halogen_HTML_Events.input(BEditField.create)(f($64));
|
|
};
|
|
};
|
|
var display_edit = [ Halogen_HTML_Elements.div([ Util.class_("edit_bookmark_form pa2 pt0 bg-white") ])([ Halogen_HTML_Elements.form([ Halogen_HTML_Events.onSubmit(Halogen_HTML_Events.input(BEditSubmit.create)) ])([ Halogen_HTML_Elements.div_([ Halogen_HTML_Core.text("url") ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputUrl.value), Util.class_("url w-100 mb2 pt1 f7 edit_form_input"), Halogen_HTML_Properties.required(true), Halogen_HTML_Properties.name("url"), Halogen_HTML_Properties.value(v.edit_bm.url), Halogen_HTML_Events.onValueChange(editField(Eurl.create)) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.div_([ Halogen_HTML_Core.text("title") ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputText.value), Util.class_("title w-100 mb2 pt1 f7 edit_form_input"), Halogen_HTML_Properties.name("title"), Halogen_HTML_Properties.value(v.edit_bm.title), Halogen_HTML_Events.onValueChange(editField(Etitle.create)) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.div_([ Halogen_HTML_Core.text("description") ]), Halogen_HTML_Elements.textarea([ Util.class_("description w-100 mb1 pt1 f7 edit_form_input"), Halogen_HTML_Properties.name("description"), Halogen_HTML_Properties.rows(5), Halogen_HTML_Properties.value(v.edit_bm.description), Halogen_HTML_Events.onValueChange(editField(Edescription.create)) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.div([ Halogen_HTML_Properties.id_("tags_input_box") ])([ Halogen_HTML_Elements.div_([ Halogen_HTML_Core.text("tags") ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputText.value), Util.class_("tags w-100 mb1 pt1 f7 edit_form_input"), Halogen_HTML_Properties.name("tags"), Halogen_HTML_Properties.autocomplete(false), Util.attr("autocapitalize")("off"), Halogen_HTML_Properties.value(v.edit_bm.tags), Halogen_HTML_Events.onValueChange(editField(Etags.create)) ]), Halogen_HTML_Elements.br_ ]), Halogen_HTML_Elements.div([ Util.class_("edit_form_checkboxes mv3") ])([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("private pointer"), Halogen_HTML_Properties.id_("edit_private"), Halogen_HTML_Properties.name("private"), Halogen_HTML_Properties.checked(v["edit_bm"]["private"]), Halogen_HTML_Events.onChecked(editField(Eprivate.create)) ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("edit_private"), Util.class_("mr2") ])([ Halogen_HTML_Core.text("private") ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("toread pointer"), Halogen_HTML_Properties.id_("edit_toread"), Halogen_HTML_Properties.name("toread"), Halogen_HTML_Properties.checked(v.edit_bm.toread), Halogen_HTML_Events.onChecked(editField(Etoread.create)) ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("edit_toread") ])([ Halogen_HTML_Core.text("to-read") ]), Halogen_HTML_Elements.br_ ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputSubmit.value), Util.class_("mr1 pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim"), Halogen_HTML_Properties.value("save") ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputReset.value), Util.class_("pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim"), Halogen_HTML_Properties.value("cancel"), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(BEdit.create(false))) ]) ]) ]) ];
|
|
var display = [ Halogen_HTML_Elements.div([ Util.class_("display") ])(Data_Semigroup.append(Data_Semigroup.semigroupArray)([ Halogen_HTML_Elements.a([ Halogen_HTML_Properties.href(v.bm.url), Halogen_HTML_Properties.target("_blank"), Util.class_("link f5 lh-title" + Data_Monoid.guard(Data_Monoid.monoidString)(v.bm.toread)(" unread")) ])([ Halogen_HTML_Core.text((function () {
|
|
var $59 = Data_String_Common["null"](v.bm.title);
|
|
if ($59) {
|
|
return "[no title]";
|
|
};
|
|
return v.bm.title;
|
|
})()) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.a([ Halogen_HTML_Properties.href(v.bm.url), Util.class_("link f7 gray hover-blue") ])([ Halogen_HTML_Core.text(v.bm.url) ]), Halogen_HTML_Elements.a([ Halogen_HTML_Properties.href(Data_Maybe.fromMaybe("http://archive.is/" + v.bm.url)(Data_Nullable.toMaybe(v.bm.archiveUrl))), Util.class_("link f7 gray hover-blue ml2" + Data_Monoid.guard(Data_Monoid.monoidString)(Data_Maybe.isJust(Data_Nullable.toMaybe(v.bm.archiveUrl)))(" green")), Halogen_HTML_Properties.target("_blank"), Halogen_HTML_Properties.title("archive link") ])([ (function () {
|
|
var $60 = Data_Maybe.isJust(Data_Nullable.toMaybe(v.bm.archiveUrl));
|
|
if ($60) {
|
|
return Halogen_HTML_Core.text("\u2611");
|
|
};
|
|
return Halogen_HTML_Core.text("\u2610");
|
|
})() ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.div([ Util.class_("description mt1 mid-gray") ])(toTextarea(v.bm.description)), Halogen_HTML_Elements.div([ Util.class_("tags") ])(Data_Monoid.guard(Data_Monoid.monoidFn(Data_Monoid.monoidFn(Data_Monoid.monoidArray)))(!Data_String_Common["null"](v.bm.tags))(Data_Functor.map(Data_Functor.functorArray))(function (tag) {
|
|
return Halogen_HTML_Elements.a([ Util.class_("link tag mr1" + Data_Monoid.guard(Data_Monoid.monoidString)(Data_String_CodePoints.take(1)(tag) === ".")(" private")), Halogen_HTML_Properties.href(linkToFilterTag(tag)) ])([ Halogen_HTML_Core.text(tag) ]);
|
|
})(Data_String_Common.split(" ")(v.bm.tags))), Halogen_HTML_Elements.a([ Util.class_("link f7 dib gray w4"), Halogen_HTML_Properties.title(Data_Maybe.maybe(v.bm.time)(Data_Tuple.snd)(mmoment)), Halogen_HTML_Properties.href(linkToFilterSingle(v.bm.slug)) ])([ Halogen_HTML_Core.text(Data_Maybe.maybe("\xa0")(Data_Tuple.fst)(mmoment)) ]) ])(links)) ];
|
|
return Halogen_HTML_Elements.div([ Halogen_HTML_Properties.id_(Data_Show.show(Data_Show.showInt)(v.bm.bid)), Util.class_("bookmark w-100 mw7 pa1 mb3" + Data_Monoid.guard(Data_Monoid.monoidString)(v["bm"]["private"])(" private")) ])(Data_Semigroup.append(Data_Semigroup.semigroupArray)(star)((function () {
|
|
if (v.edit) {
|
|
return display_edit;
|
|
};
|
|
return display;
|
|
})()));
|
|
};
|
|
return Halogen_Component.component(Halogen_HTML_Core.bifunctorHTML)({
|
|
initialState: Data_Function["const"](mkState(b$prime)),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["BStar"] = BStar;
|
|
exports["BDeleteAsk"] = BDeleteAsk;
|
|
exports["BDestroy"] = BDestroy;
|
|
exports["BEdit"] = BEdit;
|
|
exports["BEditField"] = BEditField;
|
|
exports["BEditSubmit"] = BEditSubmit;
|
|
exports["BMarkRead"] = BMarkRead;
|
|
exports["Eurl"] = Eurl;
|
|
exports["Etitle"] = Etitle;
|
|
exports["Edescription"] = Edescription;
|
|
exports["Etags"] = Etags;
|
|
exports["Eprivate"] = Eprivate;
|
|
exports["Etoread"] = Etoread;
|
|
exports["BNotifyRemove"] = BNotifyRemove;
|
|
exports["_bm"] = _bm;
|
|
exports["_edit_bm"] = _edit_bm;
|
|
exports["_edit"] = _edit;
|
|
exports["bmark"] = bmark;
|
|
})(PS["Component.BMark"] = PS["Component.BMark"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Component_BMark = PS["Component.BMark"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var HandleBMessage = (function () {
|
|
function HandleBMessage(value0, value1, value2) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value2;
|
|
};
|
|
HandleBMessage.create = function (value0) {
|
|
return function (value1) {
|
|
return function (value2) {
|
|
return new HandleBMessage(value0, value1, value2);
|
|
};
|
|
};
|
|
};
|
|
return HandleBMessage;
|
|
})();
|
|
var blist = function (st) {
|
|
var render = function (bms) {
|
|
var renderBookmark = function (b) {
|
|
return Halogen_HTML.slot(b.bid)(Component_BMark.bmark(b))(Data_Unit.unit)(Halogen_HTML_Events.input(HandleBMessage.create(b.bid)));
|
|
};
|
|
return Halogen_HTML_Elements.div_(Data_Functor.map(Data_Functor.functorArray)(renderBookmark)(bms));
|
|
};
|
|
var $$eval = function (v) {
|
|
var removeBookmark = function (bookmarkId) {
|
|
return Data_Array.filter(function (b) {
|
|
return b.bid !== bookmarkId;
|
|
});
|
|
};
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(removeBookmark(v.value0)))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value2);
|
|
});
|
|
};
|
|
return Halogen_Component.parentComponent(Data_Ord.ordInt)({
|
|
initialState: Data_Function["const"](st),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["HandleBMessage"] = HandleBMessage;
|
|
exports["blist"] = blist;
|
|
})(PS["Component.BList"] = PS["Component.BList"] || {});
|
|
(function(exports) {// use at your own risk!
|
|
exports.unsafeSetInnerHTML = function(element) {
|
|
return function(html) {
|
|
return function() {
|
|
element.innerHTML = html;
|
|
};
|
|
};
|
|
};
|
|
})(PS["Component.RawHtml"] = PS["Component.RawHtml"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Component.RawHtml"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query = PS["Halogen.Query"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var SetInnerHTML = (function () {
|
|
function SetInnerHTML(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
SetInnerHTML.create = function (value0) {
|
|
return new SetInnerHTML(value0);
|
|
};
|
|
return SetInnerHTML;
|
|
})();
|
|
var Receive = (function () {
|
|
function Receive(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
Receive.create = function (value0) {
|
|
return function (value1) {
|
|
return new Receive(value0, value1);
|
|
};
|
|
};
|
|
return Receive;
|
|
})();
|
|
var mkComponent = function (toRawHTML) {
|
|
var render = function (state) {
|
|
return Halogen_HTML_Elements.div([ Halogen_HTML_Properties.ref(state.elRef) ])([ ]);
|
|
};
|
|
var $$eval = function (v) {
|
|
if (v instanceof SetInnerHTML) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.get(Halogen_Query_HalogenM.monadStateHalogenM))(function (v1) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Halogen_Query.getHTMLElementRef(v1.elRef))(function (v2) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Foldable.for_(Halogen_Query_HalogenM.applicativeHalogenM)(Data_Foldable.foldableMaybe)(v2)(function (el) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.get(Halogen_Query_HalogenM.monadStateHalogenM))(function (v3) {
|
|
return Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))($foreign.unsafeSetInnerHTML(el)(toRawHTML(v3.inputval)));
|
|
});
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof Receive) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v1) {
|
|
var $12 = {};
|
|
for (var $13 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $13)) {
|
|
$12[$13] = v1[$13];
|
|
};
|
|
};
|
|
$12.inputval = v.value0;
|
|
return $12;
|
|
}))(function () {
|
|
return $$eval(new SetInnerHTML(v.value1));
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.RawHtml (line 51, column 10 - line 62, column 27): " + [ v.constructor.name ]);
|
|
};
|
|
return Halogen_Component.lifecycleComponent(Halogen_HTML_Core.bifunctorHTML)({
|
|
initialState: function (inputval) {
|
|
return {
|
|
elRef: "inputval",
|
|
inputval: inputval
|
|
};
|
|
},
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Halogen_HTML_Events.input(Receive.create),
|
|
initializer: Data_Maybe.Just.create(Halogen_Query.action(SetInnerHTML.create)),
|
|
finalizer: Data_Maybe.Nothing.value
|
|
});
|
|
};
|
|
exports["SetInnerHTML"] = SetInnerHTML;
|
|
exports["Receive"] = Receive;
|
|
exports["mkComponent"] = mkComponent;
|
|
})(PS["Component.RawHtml"] = PS["Component.RawHtml"] || {});
|
|
(function(exports) {exports.markedImpl = function(str) {
|
|
marked.setOptions({
|
|
pedantic: false,
|
|
gfm: true
|
|
});
|
|
return marked(str);
|
|
};
|
|
})(PS["Foreign.Marked"] = PS["Foreign.Marked"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Foreign.Marked"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Globals = PS["Globals"];
|
|
var Prelude = PS["Prelude"];
|
|
var marked = function ($0) {
|
|
return Globals.RawHTML($foreign.markedImpl($0));
|
|
};
|
|
exports["marked"] = marked;
|
|
})(PS["Foreign.Marked"] = PS["Foreign.Marked"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Component_RawHtml = PS["Component.RawHtml"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Foreign_Marked = PS["Foreign.Marked"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var component = Component_RawHtml.mkComponent(Foreign_Marked.marked);
|
|
exports["component"] = component;
|
|
})(PS["Component.Markdown"] = PS["Component.Markdown"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_CodePoints = PS["Data.String.CodePoints"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Util = PS["Util"];
|
|
var nlist = function (st$prime) {
|
|
var toTextarea = function (input) {
|
|
return Data_Array.drop(1)(Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidArray)(function (x) {
|
|
return [ Halogen_HTML_Elements.br_, Halogen_HTML_Core.text(x) ];
|
|
})(Data_String_Common.split("\x0a")(input)));
|
|
};
|
|
var mmoment = function (bm) {
|
|
return Globals.mmoment8601(bm.created);
|
|
};
|
|
var mkState = function (notes$prime) {
|
|
return {
|
|
notes: notes$prime,
|
|
cur: Data_Maybe.Nothing.value,
|
|
deleteAsk: false,
|
|
edit: false
|
|
};
|
|
};
|
|
var $$eval = function (v) {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
};
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
var linkToFilterSingle = function (slug) {
|
|
return Util.fromNullableStr(app.userR) + ("/notes/" + slug);
|
|
};
|
|
var render = function (v) {
|
|
var renderNote = function (bm) {
|
|
return Halogen_HTML_Elements.div([ Halogen_HTML_Properties.id_(Data_Show.show(Data_Show.showInt)(bm.id)), Util.class_("note w-100 mw7 pa1 mb2") ])([ Halogen_HTML_Elements.div([ Util.class_("display") ])([ Halogen_HTML_Elements.a([ Halogen_HTML_Properties.href(linkToFilterSingle(bm.slug)), Util.class_("link f5 lh-title") ])([ Halogen_HTML_Core.text((function () {
|
|
var $5 = Data_String_Common["null"](bm.title);
|
|
if ($5) {
|
|
return "[no title]";
|
|
};
|
|
return bm.title;
|
|
})()) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.div([ Util.class_("description mt1 mid-gray") ])(toTextarea(Data_String_CodePoints.take(200)(bm.text))), Halogen_HTML_Elements.a([ Util.class_("link f7 dib gray w4"), Halogen_HTML_Properties.title(Data_Maybe.maybe(bm.created)(Data_Tuple.snd)(mmoment(bm))), Halogen_HTML_Properties.href(linkToFilterSingle(bm.slug)) ])([ Halogen_HTML_Core.text(Data_Maybe.maybe("\xa0")(Data_Tuple.fst)(mmoment(bm))) ]) ]) ]);
|
|
};
|
|
return Halogen_HTML_Elements.div_(Data_Functor.map(Data_Functor.functorArray)(renderNote)(v.notes));
|
|
};
|
|
return Halogen_Component.component(Halogen_HTML_Core.bifunctorHTML)({
|
|
initialState: Data_Function["const"](mkState(st$prime)),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["nlist"] = nlist;
|
|
})(PS["Component.NList"] = PS["Component.NList"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var App = PS["App"];
|
|
var Component_Markdown = PS["Component.Markdown"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_State_Class = PS["Control.Monad.State.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var DOM_HTML_Indexed_ButtonType = PS["DOM.HTML.Indexed.ButtonType"];
|
|
var DOM_HTML_Indexed_InputType = PS["DOM.HTML.Indexed.InputType"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Lens = PS["Data.Lens"];
|
|
var Data_Lens_Getter = PS["Data.Lens.Getter"];
|
|
var Data_Lens_Internal_Forget = PS["Data.Lens.Internal.Forget"];
|
|
var Data_Lens_Lens = PS["Data.Lens.Lens"];
|
|
var Data_Lens_Setter = PS["Data.Lens.Setter"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Monoid = PS["Data.Monoid"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Profunctor_Strong = PS["Data.Profunctor.Strong"];
|
|
var Data_Semigroup = PS["Data.Semigroup"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_String = PS["Data.String"];
|
|
var Data_String_Common = PS["Data.String.Common"];
|
|
var Data_String_Pattern = PS["Data.String.Pattern"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Data_Void = PS["Data.Void"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_Class = PS["Effect.Aff.Class"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Globals = PS["Globals"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML = PS["Halogen.HTML"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_HTML_Elements = PS["Halogen.HTML.Elements"];
|
|
var Halogen_HTML_Events = PS["Halogen.HTML.Events"];
|
|
var Halogen_HTML_Properties = PS["Halogen.HTML.Properties"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Util = PS["Util"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_HTML_Location = PS["Web.HTML.Location"];
|
|
var Etitle = (function () {
|
|
function Etitle(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etitle.create = function (value0) {
|
|
return new Etitle(value0);
|
|
};
|
|
return Etitle;
|
|
})();
|
|
var Etext = (function () {
|
|
function Etext(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
Etext.create = function (value0) {
|
|
return new Etext(value0);
|
|
};
|
|
return Etext;
|
|
})();
|
|
var EisMarkdown = (function () {
|
|
function EisMarkdown(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
EisMarkdown.create = function (value0) {
|
|
return new EisMarkdown(value0);
|
|
};
|
|
return EisMarkdown;
|
|
})();
|
|
var NNop = (function () {
|
|
function NNop(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
NNop.create = function (value0) {
|
|
return new NNop(value0);
|
|
};
|
|
return NNop;
|
|
})();
|
|
var NEditField = (function () {
|
|
function NEditField(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
NEditField.create = function (value0) {
|
|
return function (value1) {
|
|
return new NEditField(value0, value1);
|
|
};
|
|
};
|
|
return NEditField;
|
|
})();
|
|
var NEditSubmit = (function () {
|
|
function NEditSubmit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
NEditSubmit.create = function (value0) {
|
|
return function (value1) {
|
|
return new NEditSubmit(value0, value1);
|
|
};
|
|
};
|
|
return NEditSubmit;
|
|
})();
|
|
var NEdit = (function () {
|
|
function NEdit(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
NEdit.create = function (value0) {
|
|
return function (value1) {
|
|
return new NEdit(value0, value1);
|
|
};
|
|
};
|
|
return NEdit;
|
|
})();
|
|
var NDeleteAsk = (function () {
|
|
function NDeleteAsk(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
};
|
|
NDeleteAsk.create = function (value0) {
|
|
return function (value1) {
|
|
return new NDeleteAsk(value0, value1);
|
|
};
|
|
};
|
|
return NDeleteAsk;
|
|
})();
|
|
var NDestroy = (function () {
|
|
function NDestroy(value0) {
|
|
this.value0 = value0;
|
|
};
|
|
NDestroy.create = function (value0) {
|
|
return new NDestroy(value0);
|
|
};
|
|
return NDestroy;
|
|
})();
|
|
var _note = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.note;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
note: v1,
|
|
deleteAsk: v.deleteAsk,
|
|
destroyed: v.destroyed,
|
|
edit: v.edit,
|
|
edit_note: v.edit_note
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var _edit_note = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.edit_note;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
edit_note: v1,
|
|
deleteAsk: v.deleteAsk,
|
|
destroyed: v.destroyed,
|
|
edit: v.edit,
|
|
note: v.note
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var _edit = function (dictStrong) {
|
|
return Data_Lens_Lens.lens(function (v) {
|
|
return v.edit;
|
|
})(function (v) {
|
|
return function (v1) {
|
|
return {
|
|
edit: v1,
|
|
deleteAsk: v.deleteAsk,
|
|
destroyed: v.destroyed,
|
|
edit_note: v.edit_note,
|
|
note: v.note
|
|
};
|
|
};
|
|
})(dictStrong);
|
|
};
|
|
var nnote = function (st$prime) {
|
|
var render = function (v) {
|
|
var toTextarea = function (input) {
|
|
return Data_Array.drop(1)(Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidArray)(function (x) {
|
|
return [ Halogen_HTML_Elements.br_, Halogen_HTML_Core.text(x) ];
|
|
})(Data_String_Common.split("\x0a")(input)));
|
|
};
|
|
var mmoment = function (n) {
|
|
return Globals.mmoment8601(n.created);
|
|
};
|
|
var renderNote = Halogen_HTML_Elements.div([ Halogen_HTML_Properties.id_(Data_Show.show(Data_Show.showInt)(v.note.id)), Util.class_("note w-100 mw7 pa1 mb2") ])(Data_Semigroup.append(Data_Semigroup.semigroupArray)([ Halogen_HTML_Elements.div([ Util.class_("display") ])([ Halogen_HTML_Elements.div([ Util.class_("link f5 lh-title") ])([ Halogen_HTML_Core.text((function () {
|
|
var $24 = Data_String_Common["null"](v.note.title);
|
|
if ($24) {
|
|
return "[no title]";
|
|
};
|
|
return v.note.title;
|
|
})()) ]), Halogen_HTML_Elements.br_, (function () {
|
|
if (v.note.isMarkdown) {
|
|
return Halogen_HTML_Elements.div([ Util.class_("description mt1") ])([ Halogen_HTML.slot(Data_Unit.unit)(Component_Markdown.component)(v.note.text)(Data_Void.absurd) ]);
|
|
};
|
|
return Halogen_HTML_Elements.div([ Util.class_("description mt1 mid-gray") ])(toTextarea(v.note.text));
|
|
})(), Halogen_HTML_Elements.div([ Util.class_("link f7 dib gray w4"), Halogen_HTML_Properties.title(Data_Maybe.maybe(v.note.created)(Data_Tuple.snd)(mmoment(v.note))) ])([ Halogen_HTML_Core.text(Data_Maybe.maybe("\xa0")(Data_Tuple.fst)(mmoment(v.note))) ]) ]) ])([ Halogen_HTML_Elements.div([ Util.class_("edit_links db mt3") ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(NEdit.create(true))), Util.class_("edit light-silver hover-blue") ])([ Halogen_HTML_Core.text("edit\xa0\xa0") ]), Halogen_HTML_Elements.div([ Util.class_("delete_link di") ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(NDeleteAsk.create(true))), Util.class_("delete light-silver hover-blue" + Data_Monoid.guard(Data_Monoid.monoidString)(v.deleteAsk)(" dn")) ])([ Halogen_HTML_Core.text("delete") ]), Halogen_HTML_Elements.span([ Util.class_("confirm red" + Data_Monoid.guard(Data_Monoid.monoidString)(!v.deleteAsk)(" dn")) ])([ Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(NDeleteAsk.create(false))) ])([ Halogen_HTML_Core.text("cancel\xa0/\xa0") ]), Halogen_HTML_Elements.button([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.buttonTypeIsProp)(DOM_HTML_Indexed_ButtonType.ButtonButton.value), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(NDestroy.create)), Util.class_("red") ])([ Halogen_HTML_Core.text("destroy") ]) ]) ]) ]) ]));
|
|
var editField = function (f) {
|
|
return function ($59) {
|
|
return Halogen_HTML_Events.input(NEditField.create)(f($59));
|
|
};
|
|
};
|
|
var renderNote_edit = Halogen_HTML_Elements.form([ Halogen_HTML_Events.onSubmit(Halogen_HTML_Events.input(NEditSubmit.create)) ])([ Halogen_HTML_Elements.p([ Util.class_("mt2 mb1") ])([ Halogen_HTML_Core.text("title:") ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputText.value), Util.class_("title w-100 mb1 pt1 f7 edit_form_input"), Halogen_HTML_Properties.name("title"), Halogen_HTML_Properties.value(v.edit_note.title), Halogen_HTML_Events.onValueChange(editField(Etitle.create)) ]), Halogen_HTML_Elements.br_, Halogen_HTML_Elements.p([ Util.class_("mt2 mb1") ])([ Halogen_HTML_Core.text("description:") ]), Halogen_HTML_Elements.textarea([ Util.class_("description w-100 mb1 pt1 f7 edit_form_input"), Halogen_HTML_Properties.name("text"), Halogen_HTML_Properties.rows(30), Halogen_HTML_Properties.value(v.edit_note.text), Halogen_HTML_Events.onValueChange(editField(Etext.create)) ]), Halogen_HTML_Elements.div([ Util.class_("edit_form_checkboxes mb3") ])([ Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputCheckbox.value), Util.class_("is-markdown pointer"), Halogen_HTML_Properties.id_("edit_ismarkdown"), Halogen_HTML_Properties.name("ismarkdown"), Halogen_HTML_Properties.checked(v.edit_note.isMarkdown), Halogen_HTML_Events.onChecked(editField(EisMarkdown.create)) ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.label([ Halogen_HTML_Properties["for"]("edit_ismarkdown"), Util.class_("mr2") ])([ Halogen_HTML_Core.text("use markdown?") ]), Halogen_HTML_Elements.br_ ]), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputSubmit.value), Util.class_("mr1 pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim"), Halogen_HTML_Properties.value("save") ]), Halogen_HTML_Core.text(" "), Halogen_HTML_Elements.input([ Halogen_HTML_Properties.type_(Halogen_HTML_Core.inputTypeIsProp)(DOM_HTML_Indexed_InputType.InputReset.value), Util.class_("pv1 ph2 dark-gray ba b--moon-gray bg-near-white pointer rdim"), Halogen_HTML_Properties.value("cancel"), Halogen_HTML_Events.onClick(Halogen_HTML_Events.input_(NEdit.create(false))) ]) ]);
|
|
var display_destroyed = Halogen_HTML_Elements.p([ Util.class_("red") ])([ Halogen_HTML_Core.text("you killed this note") ]);
|
|
if (v.destroyed) {
|
|
return display_destroyed;
|
|
};
|
|
if (v.edit) {
|
|
return renderNote_edit;
|
|
};
|
|
return renderNote;
|
|
};
|
|
var mkState = function (note$prime) {
|
|
return {
|
|
note: note$prime,
|
|
edit_note: note$prime,
|
|
deleteAsk: false,
|
|
edit: note$prime.id <= 0,
|
|
destroyed: false
|
|
};
|
|
};
|
|
var app = Globals["app'"](Data_Unit.unit);
|
|
var $$eval = function (v) {
|
|
if (v instanceof NNop) {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
};
|
|
if (v instanceof NEditField) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.modifying(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_note(Data_Profunctor_Strong.strongFn))((function () {
|
|
if (v.value0 instanceof Etitle) {
|
|
return function (v1) {
|
|
return {
|
|
id: v1.id,
|
|
slug: v1.slug,
|
|
title: v.value0.value0,
|
|
text: v1.text,
|
|
length: v1.length,
|
|
isMarkdown: v1.isMarkdown,
|
|
created: v1.created,
|
|
updated: v1.updated
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof Etext) {
|
|
return function (v1) {
|
|
return {
|
|
id: v1.id,
|
|
slug: v1.slug,
|
|
title: v1.title,
|
|
text: v.value0.value0,
|
|
length: v1.length,
|
|
isMarkdown: v1.isMarkdown,
|
|
created: v1.created,
|
|
updated: v1.updated
|
|
};
|
|
};
|
|
};
|
|
if (v.value0 instanceof EisMarkdown) {
|
|
return function (v1) {
|
|
return {
|
|
id: v1.id,
|
|
slug: v1.slug,
|
|
title: v1.title,
|
|
text: v1.text,
|
|
length: v1.length,
|
|
isMarkdown: v.value0.value0,
|
|
created: v1.created,
|
|
updated: v1.updated
|
|
};
|
|
};
|
|
};
|
|
throw new Error("Failed pattern match at Component.NNote (line 158, column 19 - line 161, column 44): " + [ v.value0.constructor.name ]);
|
|
})()))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof NDeleteAsk) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v1) {
|
|
var $38 = {};
|
|
for (var $39 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $39)) {
|
|
$38[$39] = v1[$39];
|
|
};
|
|
};
|
|
$38.deleteAsk = v.value0;
|
|
return $38;
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
if (v instanceof NDestroy) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_note(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Functor["void"](Halogen_Query_HalogenM.functorHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.destroyNote(v1.id))))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Control_Monad_State_Class.modify_(Halogen_Query_HalogenM.monadStateHalogenM)(function (v2) {
|
|
var $44 = {};
|
|
for (var $45 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $45)) {
|
|
$44[$45] = v2[$45];
|
|
};
|
|
};
|
|
$44.destroyed = true;
|
|
return $44;
|
|
}))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value0);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof NEdit) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_note(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_note(Data_Profunctor_Strong.strongFn))(v1))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit(Data_Profunctor_Strong.strongFn))(v.value0))(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof NEditSubmit) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Web_Event_Event.preventDefault(v.value0)))(function () {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Getter.use(Halogen_Query_HalogenM.monadStateHalogenM)(_edit_note(Data_Lens_Internal_Forget.strongForget)))(function (v1) {
|
|
return Control_Bind.bind(Halogen_Query_HalogenM.bindHalogenM)(Effect_Aff_Class.liftAff(Halogen_Query_HalogenM.monadAffHalogenM(Effect_Aff_Class.monadAffAff))(App.editNote(v1)))(function (v2) {
|
|
if (v2.body instanceof Data_Either.Left) {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
};
|
|
if (v2.body instanceof Data_Either.Right) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)((function () {
|
|
var $55 = v1.id === 0;
|
|
if ($55) {
|
|
return Effect_Class.liftEffect(Halogen_Query_HalogenM.monadEffectHalogenM(Effect_Aff.monadEffectAff))(Control_Bind.bindFlipped(Effect.bindEffect)(Web_HTML_Location.setHref(Util.fromNullableStr(app.noteR)))(Util["_loc"]));
|
|
};
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Halogen_Query_HalogenM.bindHalogenM)(Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_note(Data_Profunctor_Strong.strongFn))(v1))(function () {
|
|
return Data_Lens_Setter.assign(Halogen_Query_HalogenM.monadStateHalogenM)(_edit(Data_Profunctor_Strong.strongFn))(false);
|
|
});
|
|
})())(function () {
|
|
return Control_Applicative.pure(Halogen_Query_HalogenM.applicativeHalogenM)(v.value1);
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.NNote (line 188, column 5 - line 197, column 14): " + [ v2.body.constructor.name ]);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Component.NNote (line 153, column 3 - line 153, column 72): " + [ v.constructor.name ]);
|
|
};
|
|
return Halogen_Component.parentComponent(Data_Ord.ordUnit)({
|
|
initialState: Data_Function["const"](mkState(st$prime)),
|
|
render: render,
|
|
"eval": $$eval,
|
|
receiver: Data_Function["const"](Data_Maybe.Nothing.value)
|
|
});
|
|
};
|
|
exports["NNop"] = NNop;
|
|
exports["NEditField"] = NEditField;
|
|
exports["NEditSubmit"] = NEditSubmit;
|
|
exports["NEdit"] = NEdit;
|
|
exports["NDeleteAsk"] = NDeleteAsk;
|
|
exports["NDestroy"] = NDestroy;
|
|
exports["_note"] = _note;
|
|
exports["_edit_note"] = _edit_note;
|
|
exports["_edit"] = _edit;
|
|
exports["Etitle"] = Etitle;
|
|
exports["Etext"] = Etext;
|
|
exports["EisMarkdown"] = EisMarkdown;
|
|
exports["nnote"] = nnote;
|
|
})(PS["Component.NNote"] = PS["Component.NNote"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Reader_Trans = PS["Control.Monad.Reader.Trans"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Prelude = PS["Prelude"];
|
|
var MonadFork = function (Functor1, Monad0, fork, join, suspend) {
|
|
this.Functor1 = Functor1;
|
|
this.Monad0 = Monad0;
|
|
this.fork = fork;
|
|
this.join = join;
|
|
this.suspend = suspend;
|
|
};
|
|
var suspend = function (dict) {
|
|
return dict.suspend;
|
|
};
|
|
var monadForkAff = new MonadFork(function () {
|
|
return Effect_Aff.functorFiber;
|
|
}, function () {
|
|
return Effect_Aff.monadAff;
|
|
}, Effect_Aff.forkAff, Effect_Aff.joinFiber, Effect_Aff.suspendAff);
|
|
var join = function (dict) {
|
|
return dict.join;
|
|
};
|
|
var fork = function (dict) {
|
|
return dict.fork;
|
|
};
|
|
exports["fork"] = fork;
|
|
exports["join"] = join;
|
|
exports["suspend"] = suspend;
|
|
exports["MonadFork"] = MonadFork;
|
|
exports["monadForkAff"] = monadForkAff;
|
|
})(PS["Control.Monad.Fork.Class"] = PS["Control.Monad.Fork.Class"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.warn = function (s) {
|
|
return function () {
|
|
console.warn(s);
|
|
return {};
|
|
};
|
|
};
|
|
})(PS["Effect.Console"] = PS["Effect.Console"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Effect.Console"];
|
|
var Data_Show = PS["Data.Show"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
exports["warn"] = $foreign.warn;
|
|
})(PS["Effect.Console"] = PS["Effect.Console"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Map = PS["Data.Map"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_Data_OrdBox = PS["Halogen.Data.OrdBox"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Coerce = PS["Unsafe.Coerce"];
|
|
var Web_DOM = PS["Web.DOM"];
|
|
var unRenderStateX = Unsafe_Coerce.unsafeCoerce;
|
|
var unDriverStateX = Unsafe_Coerce.unsafeCoerce;
|
|
var renderStateX_ = function (dictApplicative) {
|
|
return function (f) {
|
|
return unDriverStateX(function (st) {
|
|
return Data_Foldable.traverse_(dictApplicative)(Data_Foldable.foldableMaybe)(f)(st.rendering);
|
|
});
|
|
};
|
|
};
|
|
var mkRenderStateX = function (v) {
|
|
return Unsafe_Coerce.unsafeCoerce;
|
|
};
|
|
var renderStateX = function (dictFunctor) {
|
|
return function (f) {
|
|
return unDriverStateX(function (st) {
|
|
return mkRenderStateX(st.prjQuery)(f(st.rendering));
|
|
});
|
|
};
|
|
};
|
|
var mkDriverStateXRef = Unsafe_Coerce.unsafeCoerce;
|
|
var initDriverState = function (component) {
|
|
return function (input) {
|
|
return function (handler) {
|
|
return function (prjQuery) {
|
|
return function (lchs) {
|
|
return function __do() {
|
|
var v = Effect_Ref["new"]({})();
|
|
var v1 = Effect_Ref["new"](Data_Map_Internal.empty)();
|
|
var v2 = Effect_Ref["new"](Data_Map_Internal.empty)();
|
|
var v3 = Effect_Ref["new"](Data_Functor.voidLeft(Data_Maybe.functorMaybe)(component.initializer)(Data_List_Types.Nil.value))();
|
|
var v4 = Effect_Ref["new"](new Data_Maybe.Just(Data_List_Types.Nil.value))();
|
|
var v5 = Effect_Ref["new"](Data_Maybe.Nothing.value)();
|
|
var v6 = Effect_Ref["new"](0)();
|
|
var v7 = Effect_Ref["new"](new Data_Maybe.Just(Data_Map_Internal.empty))();
|
|
var ds = {
|
|
component: component,
|
|
state: component.initialState(input),
|
|
refs: Data_Map_Internal.empty,
|
|
children: Data_Map_Internal.empty,
|
|
childrenIn: v1,
|
|
childrenOut: v2,
|
|
selfRef: v,
|
|
handler: handler,
|
|
pendingQueries: v3,
|
|
pendingOuts: v4,
|
|
pendingHandlers: v5,
|
|
rendering: Data_Maybe.Nothing.value,
|
|
prjQuery: prjQuery,
|
|
fresh: v6,
|
|
subscriptions: v7,
|
|
lifecycleHandlers: lchs
|
|
};
|
|
Effect_Ref.write(ds)(v)();
|
|
return mkDriverStateXRef(v);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
exports["unDriverStateX"] = unDriverStateX;
|
|
exports["mkDriverStateXRef"] = mkDriverStateXRef;
|
|
exports["renderStateX"] = renderStateX;
|
|
exports["renderStateX_"] = renderStateX_;
|
|
exports["unRenderStateX"] = unRenderStateX;
|
|
exports["initDriverState"] = initDriverState;
|
|
})(PS["Halogen.Aff.Driver.State"] = PS["Halogen.Aff.Driver.State"] || {});
|
|
(function(exports) {
|
|
"use strict";
|
|
|
|
exports.reallyUnsafeRefEq = function (a) {
|
|
return function (b) {
|
|
return a === b;
|
|
};
|
|
};
|
|
})(PS["Unsafe.Reference"] = PS["Unsafe.Reference"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var $foreign = PS["Unsafe.Reference"];
|
|
var unsafeRefEq = $foreign.reallyUnsafeRefEq;
|
|
exports["unsafeRefEq"] = unsafeRefEq;
|
|
})(PS["Unsafe.Reference"] = PS["Unsafe.Reference"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Applicative_Free = PS["Control.Applicative.Free"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Coroutine = PS["Control.Coroutine"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Monad_Fork_Class = PS["Control.Monad.Fork.Class"];
|
|
var Control_Monad_Free = PS["Control.Monad.Free"];
|
|
var Control_Monad_Free_Trans = PS["Control.Monad.Free.Trans"];
|
|
var Control_Monad_Trans_Class = PS["Control.Monad.Trans.Class"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Parallel_Class = PS["Control.Parallel.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Boolean = PS["Data.Boolean"];
|
|
var Data_Coyoneda = PS["Data.Coyoneda"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Map = PS["Data.Map"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Set = PS["Data.Set"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Halogen_Aff_Driver_State = PS["Halogen.Aff.Driver.State"];
|
|
var Halogen_Data_OrdBox = PS["Halogen.Data.OrdBox"];
|
|
var Halogen_Query_EventSource = PS["Halogen.Query.EventSource"];
|
|
var Halogen_Query_ForkF = PS["Halogen.Query.ForkF"];
|
|
var Halogen_Query_HalogenM = PS["Halogen.Query.HalogenM"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Reference = PS["Unsafe.Reference"];
|
|
var queuingHandler = function (handler) {
|
|
return function (ref) {
|
|
return function (message) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v) {
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
return handler(message);
|
|
};
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.write(new Data_Maybe.Just(new Data_List_Types.Cons(handler(message), v.value0)))(ref));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 171, column 3 - line 175, column 59): " + [ v.constructor.name ]);
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var handleLifecycle = function (lchs) {
|
|
return function (f) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.write({
|
|
initializers: Data_List_Types.Nil.value,
|
|
finalizers: Data_List_Types.Nil.value
|
|
})(lchs)))(function () {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(f))(function (v) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(lchs)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_List_Types.foldableList)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff))(v1.finalizers))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Parallel.parSequence_(Effect_Aff.parallelAff)(Data_List_Types.foldableList)(v1.initializers))(function () {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var $$eval = function (render) {
|
|
return function (r) {
|
|
var go = function (ref) {
|
|
return function (v) {
|
|
if (v instanceof Halogen_Query_HalogenM.State) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
var v2 = v.value0(v1.state);
|
|
if (Unsafe_Reference.unsafeRefEq(v1.state)(v2.value1)) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v2.value0);
|
|
};
|
|
if (Data_Boolean.otherwise) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.write({
|
|
component: v1.component,
|
|
state: v2.value1,
|
|
refs: v1.refs,
|
|
children: v1.children,
|
|
childrenIn: v1.childrenIn,
|
|
childrenOut: v1.childrenOut,
|
|
selfRef: v1.selfRef,
|
|
handler: v1.handler,
|
|
pendingQueries: v1.pendingQueries,
|
|
pendingOuts: v1.pendingOuts,
|
|
pendingHandlers: v1.pendingHandlers,
|
|
rendering: v1.rendering,
|
|
prjQuery: v1.prjQuery,
|
|
fresh: v1.fresh,
|
|
subscriptions: v1.subscriptions,
|
|
lifecycleHandlers: v1.lifecycleHandlers
|
|
})(ref)))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(handleLifecycle(v1.lifecycleHandlers)(render(v1.lifecycleHandlers)(ref)))(function () {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v2.value0);
|
|
});
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 76, column 7 - line 82, column 21): " + [ v2.constructor.name ]);
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Subscribe) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff)(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Query_EventSource.unEventSource(v.value0))(function (v2) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref["modify'"](function (i) {
|
|
return {
|
|
state: i + 1 | 0,
|
|
value: i
|
|
};
|
|
})(v1.fresh)))(function (v3) {
|
|
var done$prime = Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(v1.subscriptions)))(function (v4) {
|
|
return Control_Applicative.when(Effect_Aff.applicativeAff)(Data_Maybe.maybe(false)(Data_Map_Internal.member(Data_Ord.ordInt)(v3))(v4))(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.modify_(Data_Functor.map(Data_Maybe.functorMaybe)(Data_Map_Internal["delete"](Data_Ord.ordInt)(v3)))(v1.subscriptions)));
|
|
});
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.modify_(Data_Functor.map(Data_Maybe.functorMaybe)(Data_Map_Internal.insert(Data_Ord.ordInt)(v3)(done$prime)))(v1.subscriptions)))(function () {
|
|
var consumer = Control_Bind.bind(Control_Monad_Free_Trans.bindFreeT(Control_Coroutine.functorAwait)(Effect_Aff.monadAff))(Control_Coroutine["await"](Effect_Aff.monadAff))(function (v4) {
|
|
return Control_Bind.bind(Control_Monad_Free_Trans.bindFreeT(Control_Coroutine.functorAwait)(Effect_Aff.monadAff))(Control_Monad_Trans_Class.lift(Control_Monad_Free_Trans.monadTransFreeT(Control_Coroutine.functorAwait))(Effect_Aff.monadAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(v1.subscriptions))))(function (v5) {
|
|
return Control_Applicative.when(Control_Monad_Free_Trans.applicativeFreeT(Control_Coroutine.functorAwait)(Effect_Aff.monadAff))(Data_Maybe.isJust(v5))(Control_Bind.bind(Control_Monad_Free_Trans.bindFreeT(Control_Coroutine.functorAwait)(Effect_Aff.monadAff))(Control_Monad_Trans_Class.lift(Control_Monad_Free_Trans.monadTransFreeT(Control_Coroutine.functorAwait))(Effect_Aff.monadAff)(evalF(ref)(v4)))(function (v6) {
|
|
return Control_Applicative.when(Control_Monad_Free_Trans.applicativeFreeT(Control_Coroutine.functorAwait)(Effect_Aff.monadAff))(Data_Eq.eq(Halogen_Query_EventSource.eqSubscribeStatus)(v6)(Halogen_Query_EventSource.Listening.value))(consumer);
|
|
}));
|
|
});
|
|
});
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Coroutine.runProcess(Effect_Aff.monadRecAff)(Control_Coroutine.pullFrom(Effect_Aff.monadRecAff)(consumer)(v2.producer)))(function () {
|
|
return done$prime;
|
|
});
|
|
});
|
|
});
|
|
})))(function (v2) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value1);
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Lift) {
|
|
return v.value0;
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Halt) {
|
|
return Control_Monad_Error_Class.throwError(Effect_Aff.monadThrowAff)(Effect_Exception.error(v.value0));
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.GetSlots) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value0(Data_Functor.map(Data_List_Types.functorList)(Halogen_Data_OrdBox.unOrdBox)(Data_List.fromFoldable(Data_Set.foldableSet)(Data_Map.keys(v1.children)))));
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.CheckSlot) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value1(Data_Map_Internal.member(Halogen_Data_OrdBox.ordOrdBox)(v1.component.mkOrdBox(v.value0))(v1.children)));
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.ChildQuery) {
|
|
return evalChildQuery(ref)(v.value0)(v.value1);
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Raise) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(queuingHandler(v1.handler)(v1.pendingOuts)(v.value0))(function () {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value1);
|
|
});
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Par) {
|
|
return Control_Parallel_Class.sequential(Effect_Aff.parallelAff)(Control_Applicative_Free.retractFreeAp(Effect_Aff.applicativeParAff)(Control_Applicative_Free.hoistFreeAp(function ($103) {
|
|
return Control_Parallel_Class.parallel(Effect_Aff.parallelAff)(evalM(ref)($103));
|
|
})(v.value0)));
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.Fork) {
|
|
return Halogen_Query_ForkF.unFork(function (v1) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff)(evalM(ref)(v1.value0)))(function (v2) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v1.value1(Data_Function.flip(Effect_Aff.killFiber)(v2)));
|
|
});
|
|
})(v.value0);
|
|
};
|
|
if (v instanceof Halogen_Query_HalogenM.GetRef) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v1) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value1(Data_Map_Internal.lookup(Data_Ord.ordString)(v.value0)(v1.refs)));
|
|
});
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 73, column 12 - line 128, column 33): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
var evalM = function (ref) {
|
|
return function (v) {
|
|
return Control_Monad_Free.foldFree(Effect_Aff.monadRecAff)(go(ref))(v);
|
|
};
|
|
};
|
|
var evalF = function (ref) {
|
|
return function (q) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v) {
|
|
var v1 = v["component"]["eval"](q);
|
|
return Control_Monad_Free.foldFree(Effect_Aff.monadRecAff)(go(ref))(v1);
|
|
});
|
|
};
|
|
};
|
|
var evalChildQuery = function (ref) {
|
|
return function (p) {
|
|
return Data_Coyoneda.unCoyoneda(function (k) {
|
|
return function (q) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v) {
|
|
var v1 = Data_Map_Internal.lookup(Halogen_Data_OrdBox.ordOrdBox)(v.component.mkOrdBox(p))(v.children);
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(v1.value0)))(function (v2) {
|
|
return Halogen_Aff_Driver_State.unDriverStateX(function (ds) {
|
|
var v3 = ds.prjQuery(q);
|
|
if (v3 instanceof Data_Maybe.Just) {
|
|
return Data_Functor.map(Effect_Aff.functorAff)(k)(evalF(ds.selfRef)(v3.value0));
|
|
};
|
|
if (v3 instanceof Data_Maybe.Nothing) {
|
|
return Control_Monad_Error_Class.throwError(Effect_Aff.monadThrowAff)(Effect_Exception.error("Query projection failed for child query"));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 141, column 32 - line 143, column 82): " + [ v3.constructor.name ]);
|
|
})(v2);
|
|
});
|
|
};
|
|
if (v1 instanceof Data_Maybe.Nothing) {
|
|
return Control_Monad_Error_Class.throwError(Effect_Aff.monadThrowAff)(Effect_Exception.error("Slot lookup failed for child query"));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 138, column 5 - line 144, column 73): " + [ v1.constructor.name ]);
|
|
});
|
|
};
|
|
});
|
|
};
|
|
};
|
|
return function (v) {
|
|
if (v instanceof Halogen_Query_InputF.RefUpdate) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.modify_(function (v1) {
|
|
return {
|
|
component: v1.component,
|
|
state: v1.state,
|
|
refs: Data_Map_Internal.alter(Data_Ord.ordString)(Data_Function["const"](v.value1))(v.value0)(v1.refs),
|
|
children: v1.children,
|
|
childrenIn: v1.childrenIn,
|
|
childrenOut: v1.childrenOut,
|
|
selfRef: v1.selfRef,
|
|
handler: v1.handler,
|
|
pendingQueries: v1.pendingQueries,
|
|
pendingOuts: v1.pendingOuts,
|
|
pendingHandlers: v1.pendingHandlers,
|
|
rendering: v1.rendering,
|
|
prjQuery: v1.prjQuery,
|
|
fresh: v1.fresh,
|
|
subscriptions: v1.subscriptions,
|
|
lifecycleHandlers: v1.lifecycleHandlers
|
|
};
|
|
})(r)))(function () {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(v.value2);
|
|
});
|
|
};
|
|
if (v instanceof Halogen_Query_InputF.Query) {
|
|
return evalF(r)(v.value0);
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 59, column 3 - line 64, column 25): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
exports["handleLifecycle"] = handleLifecycle;
|
|
exports["eval"] = $$eval;
|
|
exports["queuingHandler"] = queuingHandler;
|
|
})(PS["Halogen.Aff.Driver.Eval"] = PS["Halogen.Aff.Driver.Eval"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Coroutine = PS["Control.Coroutine"];
|
|
var Control_Monad_Fork_Class = PS["Control.Monad.Fork.Class"];
|
|
var Control_Monad_Rec_Class = PS["Control.Monad.Rec.Class"];
|
|
var Control_Parallel = PS["Control.Parallel"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_List = PS["Data.List"];
|
|
var Data_List_Types = PS["Data.List.Types"];
|
|
var Data_Map = PS["Data.Map"];
|
|
var Data_Map_Internal = PS["Data.Map.Internal"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Ord = PS["Data.Ord"];
|
|
var Data_Semiring = PS["Data.Semiring"];
|
|
var Data_Traversable = PS["Data.Traversable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Aff_AVar = PS["Effect.Aff.AVar"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Console = PS["Effect.Console"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Halogen = PS["Halogen"];
|
|
var Halogen_Aff_Driver_Eval = PS["Halogen.Aff.Driver.Eval"];
|
|
var Halogen_Aff_Driver_State = PS["Halogen.Aff.Driver.State"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_Data_OrdBox = PS["Halogen.Data.OrdBox"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Prelude = PS["Prelude"];
|
|
var newLifecycleHandlers = Effect_Ref["new"]({
|
|
initializers: Data_List_Types.Nil.value,
|
|
finalizers: Data_List_Types.Nil.value
|
|
});
|
|
var handleAff = Effect_Aff.runAff_(Data_Either.either(Effect_Exception.throwException)(Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit))));
|
|
var runUI = function (renderSpec) {
|
|
return function (component) {
|
|
return function (i) {
|
|
var subscribe = function (fresh) {
|
|
return function (ref) {
|
|
return function (consumer) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Aff_AVar.empty)(function (v) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(function __do() {
|
|
var v1 = Effect_Ref.read(fresh)();
|
|
Effect_Ref.modify_(function (v2) {
|
|
return v2 + 1 | 0;
|
|
})(fresh)();
|
|
Effect_Ref.modify_(Data_Map_Internal.insert(Data_Ord.ordInt)(v1)(v))(ref)();
|
|
return v1;
|
|
}))(function (v1) {
|
|
var producer = Control_Coroutine.producer(Effect_Aff.monadAff)(Data_Functor.map(Effect_Aff.functorAff)(Data_Either.Left.create)(Effect_Aff_AVar.take(v)));
|
|
return Data_Functor["void"](Effect_Aff.functorAff)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff)(Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Coroutine.runProcess(Effect_Aff.monadRecAff)(Control_Coroutine.connect(Effect_Aff.monadRecAff)(Effect_Aff.parallelAff)(producer)(consumer)))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.modify_(Data_Map_Internal["delete"](Data_Ord.ordInt)(v1))(ref)))(function () {
|
|
return Effect_Aff_AVar.kill(Effect_Exception.error("ended"))(v);
|
|
});
|
|
})));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var rootHandler = function (ref) {
|
|
return function (message) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref.read(ref)))(function (v) {
|
|
return Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Map_Internal.foldableMap)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff))(Data_Functor.map(Data_Map_Internal.functorMap)(Effect_Aff_AVar.put(message))(v));
|
|
});
|
|
};
|
|
};
|
|
var handlePending = function (ref) {
|
|
return function __do() {
|
|
var v = Effect_Ref.read(ref)();
|
|
Effect_Ref.write(Data_Maybe.Nothing.value)(ref)();
|
|
return Data_Foldable.for_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(v)(function ($63) {
|
|
return handleAff(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_List_Types.foldableList)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff))(Data_List.reverse($63)));
|
|
})();
|
|
};
|
|
};
|
|
var cleanupSubscriptions = function (v) {
|
|
return function __do() {
|
|
Control_Bind.bindFlipped(Effect.bindEffect)(Data_Foldable.traverse_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(function ($64) {
|
|
return handleAff(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Map_Internal.foldableMap)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff))($64));
|
|
}))(Effect_Ref.read(v.subscriptions))();
|
|
return Effect_Ref.write(Data_Maybe.Nothing.value)(v.subscriptions)();
|
|
};
|
|
};
|
|
var squashChildInitializers = function (lchs) {
|
|
return function (preInits) {
|
|
return Halogen_Aff_Driver_State.unDriverStateX(function (st) {
|
|
var parentInitializer = Data_Functor.map(Data_Maybe.functorMaybe)(function ($65) {
|
|
return evalF(st.selfRef)(Halogen_Query_InputF.Query.create($65));
|
|
})(st.component.initializer);
|
|
return Effect_Ref.modify_(function (handlers) {
|
|
return {
|
|
initializers: new Data_List_Types.Cons(Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Control_Parallel.parSequence_(Effect_Aff.parallelAff)(Data_List_Types.foldableList)(Data_List.reverse(handlers.initializers)))(function () {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Data_Foldable.sequence_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(parentInitializer))(function () {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(function __do() {
|
|
handlePending(st.pendingQueries)();
|
|
return handlePending(st.pendingOuts)();
|
|
});
|
|
});
|
|
}), preInits),
|
|
finalizers: handlers.finalizers
|
|
};
|
|
})(lchs);
|
|
});
|
|
};
|
|
};
|
|
var runComponent = function (lchs) {
|
|
return function (handler) {
|
|
return function (j) {
|
|
return function (prjQuery) {
|
|
return Halogen_Component.unComponent(function (c) {
|
|
return function __do() {
|
|
var v = newLifecycleHandlers();
|
|
var v1 = Halogen_Aff_Driver_State.initDriverState(c)(j)(handler)(prjQuery)(v)();
|
|
var v2 = Effect_Ref.read(lchs)();
|
|
Effect_Ref.write({
|
|
initializers: Data_List_Types.Nil.value,
|
|
finalizers: v2.finalizers
|
|
})(lchs)();
|
|
Control_Bind.bindFlipped(Effect.bindEffect)(Halogen_Aff_Driver_State.unDriverStateX(function ($66) {
|
|
return render(lchs)((function (v3) {
|
|
return v3.selfRef;
|
|
})($66));
|
|
}))(Effect_Ref.read(v1))();
|
|
Control_Bind.bindFlipped(Effect.bindEffect)(squashChildInitializers(lchs)(v2.initializers))(Effect_Ref.read(v1))();
|
|
return v1;
|
|
};
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var renderChild = function (lchs) {
|
|
return function (handler) {
|
|
return function (mkOrdBox) {
|
|
return function (childrenInRef) {
|
|
return function (childrenOutRef) {
|
|
return Halogen_Component.unComponentSlot(function (p) {
|
|
return function (ctor) {
|
|
return function (input) {
|
|
return function (inputQuery) {
|
|
return function (outputQuery) {
|
|
return function (prjQuery) {
|
|
var ordP = mkOrdBox(p);
|
|
return function __do() {
|
|
var v = Effect_Ref.read(childrenInRef)();
|
|
var v1 = (function () {
|
|
var v1 = Data_Map_Internal.pop(Halogen_Data_OrdBox.ordOrdBox)(ordP)(v);
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
Effect_Ref.write(v1.value0.value1)(childrenInRef)();
|
|
Data_Foldable.for_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(inputQuery(input))(function (q) {
|
|
return function __do() {
|
|
var v2 = Effect_Ref.read(v1.value0.value0)();
|
|
return Halogen_Aff_Driver_State.unDriverStateX(function (st) {
|
|
return Data_Foldable.for_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(st.prjQuery(q))(function ($67) {
|
|
return handleAff(evalF(st.selfRef)(Halogen_Query_InputF.Query.create($67)));
|
|
});
|
|
})(v2)();
|
|
};
|
|
})();
|
|
return v1.value0.value0;
|
|
};
|
|
if (v1 instanceof Data_Maybe.Nothing) {
|
|
return runComponent(lchs)(function ($68) {
|
|
return Data_Maybe.maybe(Control_Applicative.pure(Effect_Aff.applicativeAff)(Data_Unit.unit))(handler)(outputQuery($68));
|
|
})(input)(prjQuery)(ctor)();
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver (line 258, column 14 - line 266, column 92): " + [ v1.constructor.name ]);
|
|
})();
|
|
var v2 = Data_Functor.map(Effect.functorEffect)(Data_Map_Internal.member(Halogen_Data_OrdBox.ordOrdBox)(ordP))(Effect_Ref.read(childrenOutRef))();
|
|
Control_Applicative.when(Effect.applicativeEffect)(v2)(Effect_Console.warn("Halogen: Duplicate slot address was detected during rendering, unexpected results may occur"))();
|
|
Effect_Ref.modify_(Data_Map_Internal.insert(Halogen_Data_OrdBox.ordOrdBox)(ordP)(v1))(childrenOutRef)();
|
|
return Control_Bind.bind(Effect.bindEffect)(Effect_Ref.read(v1))(Halogen_Aff_Driver_State.renderStateX(Effect.functorEffect)(function (v3) {
|
|
if (v3 instanceof Data_Maybe.Nothing) {
|
|
return Effect_Exception["throw"]("Halogen internal error: child was not initialized in renderChild");
|
|
};
|
|
if (v3 instanceof Data_Maybe.Just) {
|
|
return Control_Applicative.pure(Effect.applicativeEffect)(renderSpec.renderChild(v3.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver (line 271, column 37 - line 273, column 50): " + [ v3.constructor.name ]);
|
|
}))();
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var render = function (lchs) {
|
|
return function ($$var) {
|
|
return function __do() {
|
|
var v = Effect_Ref.read($$var)();
|
|
var v1 = Data_Functor.map(Effect.functorEffect)(Data_Maybe.isNothing)(Effect_Ref.read(v.pendingHandlers))();
|
|
Control_Applicative.when(Effect.applicativeEffect)(v1)(Effect_Ref.write(new Data_Maybe.Just(Data_List_Types.Nil.value))(v.pendingHandlers))();
|
|
Effect_Ref.write(Data_Map_Internal.empty)(v.childrenOut)();
|
|
Effect_Ref.write(v.children)(v.childrenIn)();
|
|
var handler = Halogen_Aff_Driver_Eval.queuingHandler(function ($69) {
|
|
return Data_Functor["void"](Effect_Aff.functorAff)(evalF(v.selfRef)($69));
|
|
})(v.pendingHandlers);
|
|
var childHandler = Halogen_Aff_Driver_Eval.queuingHandler(function ($70) {
|
|
return handler(Halogen_Query_InputF.Query.create($70));
|
|
})(v.pendingQueries);
|
|
var v2 = renderSpec.render(function ($71) {
|
|
return handleAff(handler($71));
|
|
})(renderChild(lchs)(childHandler)(v.component.mkOrdBox)(v.childrenIn)(v.childrenOut))(v.component.render(v.state))(v.rendering)();
|
|
var v3 = Effect_Ref.read(v.childrenOut)();
|
|
Control_Bind.bind(Effect.bindEffect)(Effect_Ref.read(v.childrenIn))(Data_Foldable.traverse_(Effect.applicativeEffect)(Data_Map_Internal.foldableMap)(function (childVar) {
|
|
return function __do() {
|
|
var v4 = Effect_Ref.read(childVar)();
|
|
Halogen_Aff_Driver_State.renderStateX_(Effect.applicativeEffect)(renderSpec.removeChild)(v4)();
|
|
return finalize(lchs)(v4)();
|
|
};
|
|
}))();
|
|
Effect_Ref.modify_(function (v4) {
|
|
return {
|
|
rendering: new Data_Maybe.Just(v2),
|
|
children: v3,
|
|
component: v4.component,
|
|
state: v4.state,
|
|
refs: v4.refs,
|
|
childrenIn: v4.childrenIn,
|
|
childrenOut: v4.childrenOut,
|
|
selfRef: v4.selfRef,
|
|
handler: v4.handler,
|
|
pendingQueries: v4.pendingQueries,
|
|
pendingOuts: v4.pendingOuts,
|
|
pendingHandlers: v4.pendingHandlers,
|
|
prjQuery: v4.prjQuery,
|
|
fresh: v4.fresh,
|
|
subscriptions: v4.subscriptions,
|
|
lifecycleHandlers: v4.lifecycleHandlers
|
|
};
|
|
})(v.selfRef)();
|
|
return Control_Applicative.when(Effect.applicativeEffect)(v1)(Data_Function.flip(Control_Monad_Rec_Class.tailRecM(Control_Monad_Rec_Class.monadRecEffect))(Data_Unit.unit)(function (v4) {
|
|
return function __do() {
|
|
var v5 = Effect_Ref.read(v.pendingHandlers)();
|
|
Effect_Ref.write(new Data_Maybe.Just(Data_List_Types.Nil.value))(v.pendingHandlers)();
|
|
Data_Foldable.traverse_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(function ($72) {
|
|
return handleAff(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_List_Types.foldableList)(Control_Monad_Fork_Class.fork(Control_Monad_Fork_Class.monadForkAff))(Data_List.reverse($72)));
|
|
})(v5)();
|
|
var v6 = Effect_Ref.read(v.pendingHandlers)();
|
|
var $57 = Data_Maybe.maybe(false)(Data_List["null"])(v6);
|
|
if ($57) {
|
|
return Data_Functor.voidLeft(Effect.functorEffect)(Effect_Ref.write(Data_Maybe.Nothing.value)(v.pendingHandlers))(new Control_Monad_Rec_Class.Done(Data_Unit.unit))();
|
|
};
|
|
return new Control_Monad_Rec_Class.Loop(Data_Unit.unit);
|
|
};
|
|
}))();
|
|
};
|
|
};
|
|
};
|
|
var finalize = function (lchs) {
|
|
return Halogen_Aff_Driver_State.unDriverStateX(function (st) {
|
|
return function __do() {
|
|
cleanupSubscriptions(st)();
|
|
Data_Foldable.for_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(Data_Functor.map(Data_Maybe.functorMaybe)(function ($73) {
|
|
return evalF(st.selfRef)(Halogen_Query_InputF.Query.create($73));
|
|
})(st.component.finalizer))(function (f) {
|
|
return Effect_Ref.modify_(function (handlers) {
|
|
return {
|
|
initializers: handlers.initializers,
|
|
finalizers: new Data_List_Types.Cons(f, handlers.finalizers)
|
|
};
|
|
})(lchs);
|
|
})();
|
|
return Data_Foldable.for_(Effect.applicativeEffect)(Data_Map_Internal.foldableMap)(st.children)(Control_Bind.composeKleisliFlipped(Effect.bindEffect)(finalize(lchs))(Effect_Ref.read))();
|
|
};
|
|
});
|
|
};
|
|
var evalF = function (ref) {
|
|
return Halogen_Aff_Driver_Eval["eval"](render)(ref);
|
|
};
|
|
var evalDriver = function (ref) {
|
|
return function (prjQuery) {
|
|
return function (q) {
|
|
var v = prjQuery(q);
|
|
if (v instanceof Data_Maybe.Just) {
|
|
return evalF(ref)(new Halogen_Query_InputF.Query(v.value0));
|
|
};
|
|
if (v instanceof Data_Maybe.Nothing) {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Exception.throwException(Effect_Exception.error("Halogen internal error: query projection failed in runUI'")));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver (line 136, column 5 - line 138, column 113): " + [ v.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(newLifecycleHandlers))(function (v) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Ref["new"](0)))(function (v1) {
|
|
return Halogen_Aff_Driver_Eval.handleLifecycle(v)(function __do() {
|
|
var v2 = Effect_Ref["new"](Data_Map_Internal.empty)();
|
|
return Control_Bind.bind(Effect.bindEffect)(Control_Bind.bind(Effect.bindEffect)(runComponent(v)(rootHandler(v2))(i)(Data_Maybe.Just.create)(component))(Effect_Ref.read))(Halogen_Aff_Driver_State.unDriverStateX(function (st) {
|
|
return Control_Applicative.pure(Effect.applicativeEffect)({
|
|
query: evalDriver(st.selfRef)(st.prjQuery),
|
|
subscribe: subscribe(v1)(v2)
|
|
});
|
|
}))();
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
exports["runUI"] = runUI;
|
|
})(PS["Halogen.Aff.Driver"] = PS["Halogen.Aff.Driver"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Monad_Error_Class = PS["Control.Monad.Error.Class"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Either = PS["Data.Either"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Exception = PS["Effect.Exception"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_Event_EventTarget = PS["Web.Event.EventTarget"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_HTML_Event_EventTypes = PS["Web.HTML.Event.EventTypes"];
|
|
var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"];
|
|
var Web_HTML_HTMLDocument_ReadyState = PS["Web.HTML.HTMLDocument.ReadyState"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var Web_HTML_Window = PS["Web.HTML.Window"];
|
|
var selectElement = function (query) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Control_Bind.bindFlipped(Effect.bindEffect)(Control_Bind.composeKleisliFlipped(Effect.bindEffect)(function ($12) {
|
|
return Web_DOM_ParentNode.querySelector(query)(Web_HTML_HTMLDocument.toParentNode($12));
|
|
})(Web_HTML_Window.document))(Web_HTML.window)))(function (v) {
|
|
return Control_Applicative.pure(Effect_Aff.applicativeAff)(Control_Bind.bindFlipped(Data_Maybe.bindMaybe)(Web_HTML_HTMLElement.fromElement)(v));
|
|
});
|
|
};
|
|
var runHalogenAff = Effect_Aff.runAff_(Data_Either.either(Effect_Exception.throwException)(Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit))));
|
|
exports["selectElement"] = selectElement;
|
|
exports["runHalogenAff"] = runHalogenAff;
|
|
})(PS["Halogen.Aff.Util"] = PS["Halogen.Aff.Util"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Data_Array = PS["Data.Array"];
|
|
var Data_Eq = PS["Data.Eq"];
|
|
var Data_Function_Uncurried = PS["Data.Function.Uncurried"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Nullable = PS["Data.Nullable"];
|
|
var Data_Tuple = PS["Data.Tuple"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Halogen_VDom_Machine = PS["Halogen.VDom.Machine"];
|
|
var Halogen_VDom_Types = PS["Halogen.VDom.Types"];
|
|
var Halogen_VDom_Util = PS["Halogen.VDom.Util"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_Node = PS["Web.DOM.Node"];
|
|
var eqElemSpec = function (a, b) {
|
|
if (a.value1 === b.value1) {
|
|
if (a.value0 instanceof Data_Maybe.Just && (b.value0 instanceof Data_Maybe.Just && a.value0.value0 === b.value0.value0)) {
|
|
return true;
|
|
};
|
|
if (a.value0 instanceof Data_Maybe.Nothing && b.value0 instanceof Data_Maybe.Nothing) {
|
|
return true;
|
|
};
|
|
return false;
|
|
};
|
|
return false;
|
|
};
|
|
var buildWidget = (function () {
|
|
var patch = function (build, v) {
|
|
return function (v1) {
|
|
if (v1 instanceof Halogen_VDom_Types.Grafted) {
|
|
return patch(build, v)(Halogen_VDom_Types.runGraft(v1.value0));
|
|
};
|
|
if (v1 instanceof Halogen_VDom_Types.Widget) {
|
|
var v2 = v.value1(v1.value0);
|
|
return new Halogen_VDom_Machine.Step(v2.value0, patch(build, v2), v2.value2);
|
|
};
|
|
v.value2();
|
|
return build(v1);
|
|
};
|
|
};
|
|
var render = function (v, build, w) {
|
|
var v1 = v.buildWidget(v)(w);
|
|
return new Halogen_VDom_Machine.Step(v1.value0, patch(build, v1), v1.value2);
|
|
};
|
|
return render;
|
|
})();
|
|
var buildText = (function () {
|
|
var patch = function (build, halt, node, s1) {
|
|
return function (v) {
|
|
if (v instanceof Halogen_VDom_Types.Grafted) {
|
|
return patch(build, halt, node, s1)(Halogen_VDom_Types.runGraft(v.value0));
|
|
};
|
|
if (v instanceof Halogen_VDom_Types.Text) {
|
|
var res = new Halogen_VDom_Machine.Step(node, patch(build, halt, node, v.value0), halt);
|
|
var $84 = s1 === v.value0;
|
|
if ($84) {
|
|
return res;
|
|
};
|
|
Halogen_VDom_Util.setTextContent(v.value0, node);
|
|
return res;
|
|
};
|
|
halt();
|
|
return build(v);
|
|
};
|
|
};
|
|
var done = function (node) {
|
|
return function __do() {
|
|
var v = Halogen_VDom_Util.parentNode(node);
|
|
return Halogen_VDom_Util.removeChild(node, v);
|
|
};
|
|
};
|
|
var render = function (v, build, s) {
|
|
var v1 = Halogen_VDom_Util.createTextNode(s, v.document);
|
|
var halt = done(v1);
|
|
return new Halogen_VDom_Machine.Step(v1, patch(build, halt, v1, s), halt);
|
|
};
|
|
return render;
|
|
})();
|
|
var buildKeyed = (function () {
|
|
var done = function (node, attrs, steps) {
|
|
return function __do() {
|
|
var v = Halogen_VDom_Util.parentNode(node);
|
|
Halogen_VDom_Util.removeChild(node, v);
|
|
Halogen_VDom_Util.forInE(steps, function (v1, v2) {
|
|
return v2.value2();
|
|
});
|
|
return Halogen_VDom_Machine.halt(attrs)();
|
|
};
|
|
};
|
|
var patch = function (build, halt, node, attrs, v, ch1, len1) {
|
|
return function (v1) {
|
|
if (v1 instanceof Halogen_VDom_Types.Grafted) {
|
|
return patch(build, halt, node, attrs, v, ch1, len1)(Halogen_VDom_Types.runGraft(v1.value0));
|
|
};
|
|
if (v1 instanceof Halogen_VDom_Types.Keyed && eqElemSpec(v, v1.value0)) {
|
|
var v2 = Data_Array.length(v1.value1);
|
|
if (len1 === 0 && v2 === 0) {
|
|
var v4 = Halogen_VDom_Machine.step(attrs)(v1.value0.value2);
|
|
var halt$prime = done(node, v4, ch1);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt$prime, node, v4, v1.value0, ch1, 0), halt$prime);
|
|
};
|
|
var onThis = function (v4, v5) {
|
|
return v5.value2();
|
|
};
|
|
var onThese = function (v4, ix$prime, v5, v6) {
|
|
var v7 = v5.value1(v6.value1);
|
|
Halogen_VDom_Util.insertChildIx(ix$prime, v7.value0, node);
|
|
return v7;
|
|
};
|
|
var onThat = function (v4, ix, v5) {
|
|
var v6 = build(v5.value1);
|
|
Halogen_VDom_Util.insertChildIx(ix, v6.value0, node);
|
|
return v6;
|
|
};
|
|
var v4 = Halogen_VDom_Util.diffWithKeyAndIxE(ch1, v1.value1, Data_Tuple.fst, onThese, onThis, onThat);
|
|
var v5 = Halogen_VDom_Machine.step(attrs)(v1.value0.value2);
|
|
var halt$prime = done(node, v5, v4);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt$prime, node, v5, v1.value0, v4, v2), halt$prime);
|
|
};
|
|
halt();
|
|
return build(v1);
|
|
};
|
|
};
|
|
var render = function (v, build, v1, ch1) {
|
|
var v2 = Halogen_VDom_Util.createElement(Data_Nullable.toNullable(v1.value0), v1.value1, v.document);
|
|
var node = Web_DOM_Element.toNode(v2);
|
|
var onChild = function (k, ix, v3) {
|
|
var v4 = build(v3.value1);
|
|
Halogen_VDom_Util.insertChildIx(ix, v4.value0, node);
|
|
return v4;
|
|
};
|
|
var v3 = Halogen_VDom_Util.strMapWithIxE(ch1, Data_Tuple.fst, onChild);
|
|
var v4 = v.buildAttributes(v2)(v1.value2);
|
|
var halt = done(node, v4, v3);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt, node, v4, v1, v3, Data_Array.length(ch1)), halt);
|
|
};
|
|
return render;
|
|
})();
|
|
var buildElem = (function () {
|
|
var done = function (node, attrs, steps) {
|
|
return function __do() {
|
|
var v = Halogen_VDom_Util.parentNode(node);
|
|
Halogen_VDom_Util.removeChild(node, v);
|
|
Effect.foreachE(steps)(Halogen_VDom_Machine.halt)();
|
|
return Halogen_VDom_Machine.halt(attrs)();
|
|
};
|
|
};
|
|
var patch = function (build, halt, node, attrs, v, ch1) {
|
|
return function (v1) {
|
|
if (v1 instanceof Halogen_VDom_Types.Grafted) {
|
|
return patch(build, halt, node, attrs, v, ch1)(Halogen_VDom_Types.runGraft(v1.value0));
|
|
};
|
|
if (v1 instanceof Halogen_VDom_Types.Elem && eqElemSpec(v, v1.value0)) {
|
|
var v2 = Data_Array.length(v1.value1);
|
|
var v3 = Data_Array.length(ch1);
|
|
if (v3 === 0 && v2 === 0) {
|
|
var v4 = Halogen_VDom_Machine.step(attrs)(v1.value0.value2);
|
|
var halt$prime = done(node, v4, ch1);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt$prime, node, v4, v1.value0, ch1), halt$prime);
|
|
};
|
|
var onThis = function (ix, v4) {
|
|
return v4.value2();
|
|
};
|
|
var onThese = function (ix, v4, vdom) {
|
|
var v5 = v4.value1(vdom);
|
|
Halogen_VDom_Util.insertChildIx(ix, v5.value0, node);
|
|
return v5;
|
|
};
|
|
var onThat = function (ix, vdom) {
|
|
var v4 = build(vdom);
|
|
Halogen_VDom_Util.insertChildIx(ix, v4.value0, node);
|
|
return v4;
|
|
};
|
|
var v4 = Halogen_VDom_Util.diffWithIxE(ch1, v1.value1, onThese, onThis, onThat);
|
|
var v5 = Halogen_VDom_Machine.step(attrs)(v1.value0.value2);
|
|
var halt$prime = done(node, v5, v4);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt$prime, node, v5, v1.value0, v4), halt$prime);
|
|
};
|
|
halt();
|
|
return build(v1);
|
|
};
|
|
};
|
|
var render = function (v, build, v1, ch1) {
|
|
var v2 = Halogen_VDom_Util.createElement(Data_Nullable.toNullable(v1.value0), v1.value1, v.document);
|
|
var node = Web_DOM_Element.toNode(v2);
|
|
var onChild = function (ix, child) {
|
|
var v3 = build(child);
|
|
Halogen_VDom_Util.insertChildIx(ix, v3.value0, node);
|
|
return v3;
|
|
};
|
|
var v3 = Halogen_VDom_Util.forE(ch1, onChild);
|
|
var v4 = v.buildAttributes(v2)(v1.value2);
|
|
var halt = done(node, v4, v3);
|
|
return new Halogen_VDom_Machine.Step(node, patch(build, halt, node, v4, v1, v3), halt);
|
|
};
|
|
return render;
|
|
})();
|
|
var buildVDom = function (spec) {
|
|
var build = function (v) {
|
|
if (v instanceof Halogen_VDom_Types.Text) {
|
|
return buildText(spec, build, v.value0);
|
|
};
|
|
if (v instanceof Halogen_VDom_Types.Elem) {
|
|
return buildElem(spec, build, v.value0, v.value1);
|
|
};
|
|
if (v instanceof Halogen_VDom_Types.Keyed) {
|
|
return buildKeyed(spec, build, v.value0, v.value1);
|
|
};
|
|
if (v instanceof Halogen_VDom_Types.Widget) {
|
|
return buildWidget(spec, build, v.value0);
|
|
};
|
|
if (v instanceof Halogen_VDom_Types.Grafted) {
|
|
return build(Halogen_VDom_Types.runGraft(v.value0));
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM (line 58, column 27 - line 63, column 52): " + [ v.constructor.name ]);
|
|
};
|
|
return build;
|
|
};
|
|
exports["buildVDom"] = buildVDom;
|
|
exports["buildText"] = buildText;
|
|
exports["buildElem"] = buildElem;
|
|
exports["buildKeyed"] = buildKeyed;
|
|
exports["buildWidget"] = buildWidget;
|
|
})(PS["Halogen.VDom.DOM"] = PS["Halogen.VDom.DOM"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Category = PS["Control.Category"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"];
|
|
var Data_Maybe = PS["Data.Maybe"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Effect_Ref = PS["Effect.Ref"];
|
|
var Effect_Uncurried = PS["Effect.Uncurried"];
|
|
var Halogen_Aff_Driver = PS["Halogen.Aff.Driver"];
|
|
var Halogen_Aff_Driver_State = PS["Halogen.Aff.Driver.State"];
|
|
var Halogen_Component = PS["Halogen.Component"];
|
|
var Halogen_HTML_Core = PS["Halogen.HTML.Core"];
|
|
var Halogen_Query_InputF = PS["Halogen.Query.InputF"];
|
|
var Halogen_VDom = PS["Halogen.VDom"];
|
|
var Halogen_VDom_DOM = PS["Halogen.VDom.DOM"];
|
|
var Halogen_VDom_DOM_Prop = PS["Halogen.VDom.DOM.Prop"];
|
|
var Halogen_VDom_Machine = PS["Halogen.VDom.Machine"];
|
|
var Prelude = PS["Prelude"];
|
|
var Unsafe_Reference = PS["Unsafe.Reference"];
|
|
var Web_DOM_Document = PS["Web.DOM.Document"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_Node = PS["Web.DOM.Node"];
|
|
var Web_HTML = PS["Web.HTML"];
|
|
var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var Web_HTML_Window = PS["Web.HTML.Window"];
|
|
var substInParent = function (v) {
|
|
return function (v1) {
|
|
return function (v2) {
|
|
if (v1 instanceof Data_Maybe.Just && v2 instanceof Data_Maybe.Just) {
|
|
return Data_Functor["void"](Effect.functorEffect)(Web_DOM_Node.insertBefore(v)(v1.value0)(v2.value0));
|
|
};
|
|
if (v1 instanceof Data_Maybe.Nothing && v2 instanceof Data_Maybe.Just) {
|
|
return Data_Functor["void"](Effect.functorEffect)(Web_DOM_Node.appendChild(v)(v2.value0));
|
|
};
|
|
return Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit);
|
|
};
|
|
};
|
|
};
|
|
var removeChild = function (v) {
|
|
return function __do() {
|
|
var v1 = Web_DOM_Node.parentNode(v.node)();
|
|
return Data_Foldable.traverse_(Effect.applicativeEffect)(Data_Foldable.foldableMaybe)(function (pn) {
|
|
return Web_DOM_Node.removeChild(v.node)(pn);
|
|
})(v1)();
|
|
};
|
|
};
|
|
var mkSpec = function (handler) {
|
|
return function (renderChildRef) {
|
|
return function (document) {
|
|
var getNode = Halogen_Aff_Driver_State.unRenderStateX(function (v) {
|
|
return v.node;
|
|
});
|
|
var done = Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit);
|
|
var patch = function (slot) {
|
|
var v = Effect_Ref.read(renderChildRef)();
|
|
var v1 = v(slot)();
|
|
var node = getNode(v1);
|
|
return new Halogen_VDom_Machine.Step(node, patch, done);
|
|
};
|
|
var buildWidget = function (spec) {
|
|
return function (slot) {
|
|
var v = Effect_Ref.read(renderChildRef)();
|
|
var v1 = v(slot)();
|
|
var node = getNode(v1);
|
|
return new Halogen_VDom_Machine.Step(node, patch, done);
|
|
};
|
|
};
|
|
var buildAttributes = Halogen_VDom_DOM_Prop.buildProp(handler);
|
|
return {
|
|
buildWidget: buildWidget,
|
|
buildAttributes: buildAttributes,
|
|
document: document
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var renderSpec = function (document) {
|
|
return function (container) {
|
|
var render = function (handler) {
|
|
return function (child) {
|
|
return function (v) {
|
|
return function (v1) {
|
|
if (v1 instanceof Data_Maybe.Nothing) {
|
|
return function __do() {
|
|
var v2 = Effect_Ref["new"](child)();
|
|
var spec = mkSpec(handler)(v2)(document);
|
|
var v3 = Halogen_VDom_DOM.buildVDom(spec)(v);
|
|
var node = Halogen_VDom_Machine.extract(v3);
|
|
Data_Functor["void"](Effect.functorEffect)(Web_DOM_Node.appendChild(node)(Web_HTML_HTMLElement.toNode(container)))();
|
|
return {
|
|
machine: v3,
|
|
node: node,
|
|
renderChildRef: v2
|
|
};
|
|
};
|
|
};
|
|
if (v1 instanceof Data_Maybe.Just) {
|
|
return function __do() {
|
|
Effect_Ref.write(child)(v1.value0.renderChildRef)();
|
|
var v2 = Web_DOM_Node.parentNode(v1.value0.node)();
|
|
var v3 = Web_DOM_Node.nextSibling(v1.value0.node)();
|
|
var v4 = Halogen_VDom_Machine.step(v1.value0.machine)(v);
|
|
var newNode = Halogen_VDom_Machine.extract(v4);
|
|
Control_Applicative.when(Effect.applicativeEffect)(Data_HeytingAlgebra.not(Data_HeytingAlgebra.heytingAlgebraFunction(Data_HeytingAlgebra.heytingAlgebraFunction(Data_HeytingAlgebra.heytingAlgebraBoolean)))(Unsafe_Reference.unsafeRefEq)(v1.value0.node)(newNode))(substInParent(newNode)(v3)(v2))();
|
|
return {
|
|
machine: v4,
|
|
node: newNode,
|
|
renderChildRef: v1.value0.renderChildRef
|
|
};
|
|
};
|
|
};
|
|
throw new Error("Failed pattern match at Halogen.VDom.Driver (line 118, column 5 - line 134, column 80): " + [ v1.constructor.name ]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return {
|
|
render: render,
|
|
renderChild: Control_Category.identity(Control_Category.categoryFn),
|
|
removeChild: removeChild
|
|
};
|
|
};
|
|
};
|
|
var runUI = function (component) {
|
|
return function (i) {
|
|
return function (element) {
|
|
return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Data_Functor.map(Effect.functorEffect)(Web_HTML_HTMLDocument.toDocument)(Control_Bind.bindFlipped(Effect.bindEffect)(Web_HTML_Window.document)(Web_HTML.window))))(function (v) {
|
|
return Halogen_Aff_Driver.runUI(renderSpec(v)(element))(component)(i);
|
|
});
|
|
};
|
|
};
|
|
};
|
|
exports["runUI"] = runUI;
|
|
})(PS["Halogen.VDom.Driver"] = PS["Halogen.VDom.Driver"] || {});
|
|
(function(exports) {
|
|
// Generated by purs version 0.12.2
|
|
"use strict";
|
|
var App = PS["App"];
|
|
var Component_AccountSettings = PS["Component.AccountSettings"];
|
|
var Component_Add = PS["Component.Add"];
|
|
var Component_BList = PS["Component.BList"];
|
|
var Component_NList = PS["Component.NList"];
|
|
var Component_NNote = PS["Component.NNote"];
|
|
var Control_Applicative = PS["Control.Applicative"];
|
|
var Control_Bind = PS["Control.Bind"];
|
|
var Control_Semigroupoid = PS["Control.Semigroupoid"];
|
|
var Data_Foldable = PS["Data.Foldable"];
|
|
var Data_Function = PS["Data.Function"];
|
|
var Data_Functor = PS["Data.Functor"];
|
|
var Data_Unit = PS["Data.Unit"];
|
|
var Effect = PS["Effect"];
|
|
var Effect_Aff = PS["Effect.Aff"];
|
|
var Effect_Class = PS["Effect.Class"];
|
|
var Halogen_Aff = PS["Halogen.Aff"];
|
|
var Halogen_Aff_Util = PS["Halogen.Aff.Util"];
|
|
var Halogen_VDom_Driver = PS["Halogen.VDom.Driver"];
|
|
var Model = PS["Model"];
|
|
var Prelude = PS["Prelude"];
|
|
var Web_DOM_Element = PS["Web.DOM.Element"];
|
|
var Web_DOM_ParentNode = PS["Web.DOM.ParentNode"];
|
|
var Web_Event_Event = PS["Web.Event.Event"];
|
|
var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"];
|
|
var showFooter = Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(".user_footer"))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Web_DOM_Element.removeAttribute("hidden")(Web_HTML_HTMLElement.toElement(el)));
|
|
}));
|
|
var renderNotes = function (renderElSelector) {
|
|
return function (notes) {
|
|
return Halogen_Aff_Util.runHalogenAff(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(renderElSelector))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Data_Functor["void"](Effect_Aff.functorAff)(Halogen_VDom_Driver.runUI(Component_NList.nlist(notes))(Data_Unit.unit)(el)))(function () {
|
|
return showFooter;
|
|
});
|
|
})));
|
|
};
|
|
};
|
|
var renderNote = function (renderElSelector) {
|
|
return function (note) {
|
|
return Halogen_Aff_Util.runHalogenAff(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(renderElSelector))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Data_Functor["void"](Effect_Aff.functorAff)(Halogen_VDom_Driver.runUI(Component_NNote.nnote(note))(Data_Unit.unit)(el));
|
|
})));
|
|
};
|
|
};
|
|
var renderBookmarks = function (renderElSelector) {
|
|
return function (bmarks) {
|
|
return Halogen_Aff_Util.runHalogenAff(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(renderElSelector))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Control_Bind.discard(Control_Bind.discardUnit)(Effect_Aff.bindAff)(Data_Functor["void"](Effect_Aff.functorAff)(Halogen_VDom_Driver.runUI(Component_BList.blist(bmarks))(Data_Unit.unit)(el)))(function () {
|
|
return showFooter;
|
|
});
|
|
})));
|
|
};
|
|
};
|
|
var renderAddForm = function (renderElSelector) {
|
|
return function (bmark) {
|
|
return Halogen_Aff_Util.runHalogenAff(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(renderElSelector))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Halogen_VDom_Driver.runUI(Component_Add.addbmark(bmark))(Data_Unit.unit)(el);
|
|
})));
|
|
};
|
|
};
|
|
var renderAccountSettings = function (renderElSelector) {
|
|
return function (accountSettings) {
|
|
return Halogen_Aff_Util.runHalogenAff(Control_Bind.bind(Effect_Aff.bindAff)(Halogen_Aff_Util.selectElement(renderElSelector))(Data_Foldable.traverse_(Effect_Aff.applicativeAff)(Data_Foldable.foldableMaybe)(function (el) {
|
|
return Data_Functor["void"](Effect_Aff.functorAff)(Halogen_VDom_Driver.runUI(Component_AccountSettings.usetting(accountSettings))(Data_Unit.unit)(el));
|
|
})));
|
|
};
|
|
};
|
|
var main = Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit);
|
|
var logoutE = function (e) {
|
|
return Control_Bind.bindFlipped(Effect.bindEffect)(function ($0) {
|
|
return Data_Functor["void"](Effect.functorEffect)(Effect_Aff.launchAff(App.logout($0)));
|
|
})(Web_Event_Event.preventDefault(e));
|
|
};
|
|
exports["main"] = main;
|
|
exports["logoutE"] = logoutE;
|
|
exports["renderBookmarks"] = renderBookmarks;
|
|
exports["renderAddForm"] = renderAddForm;
|
|
exports["renderNotes"] = renderNotes;
|
|
exports["renderNote"] = renderNote;
|
|
exports["renderAccountSettings"] = renderAccountSettings;
|
|
exports["showFooter"] = showFooter;
|
|
})(PS["Main"] = PS["Main"] || {});
|
|
PS["Main"].main(); |