Created
January 23, 2019 02:30
-
-
Save Woody88/562eedb4a6b72736009293dd8aaafc02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(w){ | |
| "use strict"; //Optional because LC on LockerService active runs in strict mode | |
| // Generated by purs bundle 0.12.1 | |
| var PS = {}; | |
| (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.1 | |
| "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; | |
| }; | |
| var composeFlipped = function (dictSemigroupoid) { | |
| return function (f) { | |
| return function (g) { | |
| return compose(dictSemigroupoid)(g)(f); | |
| }; | |
| }; | |
| }; | |
| exports["compose"] = compose; | |
| exports["Semigroupoid"] = Semigroupoid; | |
| exports["composeFlipped"] = composeFlipped; | |
| exports["semigroupoidFn"] = semigroupoidFn; | |
| })(PS["Control.Semigroupoid"] = PS["Control.Semigroupoid"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "use strict"; | |
| var otherwise = true; | |
| exports["otherwise"] = otherwise; | |
| })(PS["Data.Boolean"] = PS["Data.Boolean"] || {}); | |
| (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) { | |
| "use strict"; | |
| exports.unit = {}; | |
| })(PS["Data.Unit"] = PS["Data.Unit"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.showIntImpl = function (n) { | |
| return n.toString(); | |
| }; | |
| exports.showStringImpl = function (s) { | |
| var l = s.length; | |
| return "\"" + s.replace( | |
| /[\0-\x1F\x7F"\\]/g, // eslint-disable-line no-control-regex | |
| function (c, i) { | |
| switch (c) { | |
| case "\"": | |
| case "\\": | |
| return "\\" + c; | |
| case "\x07": return "\\a"; | |
| case "\b": return "\\b"; | |
| case "\f": return "\\f"; | |
| case "\n": return "\\n"; | |
| case "\r": return "\\r"; | |
| case "\t": return "\\t"; | |
| case "\v": return "\\v"; | |
| } | |
| var k = i + 1; | |
| var empty = k < l && s[k] >= "0" && s[k] <= "9" ? "\\&" : ""; | |
| return "\\" + c.charCodeAt(0).toString(10) + empty; | |
| } | |
| ) + "\""; | |
| }; | |
| exports.showArrayImpl = function (f) { | |
| return function (xs) { | |
| var ss = []; | |
| for (var i = 0, l = xs.length; i < l; i++) { | |
| ss[i] = f(xs[i]); | |
| } | |
| return "[" + ss.join(",") + "]"; | |
| }; | |
| }; | |
| exports.join = function (separator) { | |
| return function (xs) { | |
| return xs.join(separator); | |
| }; | |
| }; | |
| })(PS["Data.Show"] = PS["Data.Show"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.unsafeSet = function (label) { | |
| return function (value) { | |
| return function (rec) { | |
| var copy = {}; | |
| for (var key in rec) { | |
| if ({}.hasOwnProperty.call(rec, key)) { | |
| copy[key] = rec[key]; | |
| } | |
| } | |
| copy[label] = value; | |
| return copy; | |
| }; | |
| }; | |
| }; | |
| })(PS["Record.Unsafe"] = PS["Record.Unsafe"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Record.Unsafe"]; | |
| exports["unsafeSet"] = $foreign.unsafeSet; | |
| })(PS["Record.Unsafe"] = PS["Record.Unsafe"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 showString = new Show($foreign.showStringImpl); | |
| var showInt = new Show($foreign.showIntImpl); | |
| var show = function (dict) { | |
| return dict.show; | |
| }; | |
| var showArray = function (dictShow) { | |
| return new Show($foreign.showArrayImpl(show(dictShow))); | |
| }; | |
| exports["Show"] = Show; | |
| exports["show"] = show; | |
| exports["showInt"] = showInt; | |
| exports["showString"] = showString; | |
| exports["showArray"] = showArray; | |
| })(PS["Data.Show"] = PS["Data.Show"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "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; | |
| }; | |
| exports["HeytingAlgebra"] = HeytingAlgebra; | |
| exports["tt"] = tt; | |
| exports["ff"] = ff; | |
| exports["implies"] = implies; | |
| exports["conj"] = conj; | |
| exports["disj"] = disj; | |
| exports["not"] = not; | |
| exports["heytingAlgebraBoolean"] = heytingAlgebraBoolean; | |
| })(PS["Data.HeytingAlgebra"] = PS["Data.HeytingAlgebra"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 eqString = new Eq($foreign.refEq); | |
| var eqInt = new Eq($foreign.refEq); | |
| var eqChar = new Eq($foreign.refEq); | |
| var eqBoolean = new Eq($foreign.refEq); | |
| var eq = function (dict) { | |
| return dict.eq; | |
| }; | |
| var notEq = function (dictEq) { | |
| return function (x) { | |
| return function (y) { | |
| return eq(eqBoolean)(eq(dictEq)(x)(y))(false); | |
| }; | |
| }; | |
| }; | |
| exports["Eq"] = Eq; | |
| exports["eq"] = eq; | |
| exports["notEq"] = notEq; | |
| exports["eqBoolean"] = eqBoolean; | |
| exports["eqInt"] = eqInt; | |
| exports["eqChar"] = eqChar; | |
| exports["eqString"] = eqString; | |
| })(PS["Data.Eq"] = PS["Data.Eq"] || {}); | |
| (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; | |
| }; | |
| }; | |
| })(PS["Data.Semigroup"] = PS["Data.Semigroup"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 append = function (dict) { | |
| return dict.append; | |
| }; | |
| exports["Semigroup"] = Semigroup; | |
| exports["append"] = append; | |
| exports["semigroupString"] = semigroupString; | |
| })(PS["Data.Semigroup"] = PS["Data.Semigroup"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "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.1 | |
| "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.1 | |
| "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.1 | |
| "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 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; | |
| })(PS["Data.Ord"] = PS["Data.Ord"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 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; | |
| })(PS["Data.Function"] = PS["Data.Function"] || {}); | |
| (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.1 | |
| "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.1 | |
| "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 applyFirst = function (dictApply) { | |
| return function (a) { | |
| return function (b) { | |
| return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(Data_Function["const"])(a))(b); | |
| }; | |
| }; | |
| }; | |
| 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); | |
| }; | |
| }; | |
| }; | |
| exports["Apply"] = Apply; | |
| exports["apply"] = apply; | |
| exports["applyFirst"] = applyFirst; | |
| exports["applySecond"] = applySecond; | |
| exports["applyArray"] = applyArray; | |
| })(PS["Control.Apply"] = PS["Control.Apply"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 unless = 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 62, column 1 - line 62, column 65: " + [ 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); | |
| }; | |
| }; | |
| }; | |
| var applicativeArray = new Applicative(function () { | |
| return Control_Apply.applyArray; | |
| }, function (x) { | |
| return [ x ]; | |
| }); | |
| exports["Applicative"] = Applicative; | |
| exports["pure"] = pure; | |
| exports["liftA1"] = liftA1; | |
| exports["unless"] = unless; | |
| exports["applicativeArray"] = applicativeArray; | |
| })(PS["Control.Applicative"] = PS["Control.Applicative"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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) { | |
| // Generated by purs version 0.12.1 | |
| "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) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Alt = PS["Control.Alt"]; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Apply = PS["Control.Apply"]; | |
| var Control_Plus = PS["Control.Plus"]; | |
| var Data_Functor = PS["Data.Functor"]; | |
| var Alternative = function (Applicative0, Plus1) { | |
| this.Applicative0 = Applicative0; | |
| this.Plus1 = Plus1; | |
| }; | |
| exports["Alternative"] = Alternative; | |
| })(PS["Control.Alternative"] = PS["Control.Alternative"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 bind = function (dict) { | |
| return dict.bind; | |
| }; | |
| var bindFlipped = function (dictBind) { | |
| return Data_Function.flip(bind(dictBind)); | |
| }; | |
| var discardUnit = new Discard(function (dictBind) { | |
| return bind(dictBind); | |
| }); | |
| exports["Bind"] = Bind; | |
| exports["bind"] = bind; | |
| exports["bindFlipped"] = bindFlipped; | |
| exports["Discard"] = Discard; | |
| exports["discard"] = discard; | |
| exports["discardUnit"] = discardUnit; | |
| })(PS["Control.Bind"] = PS["Control.Bind"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 liftM1 = function (dictMonad) { | |
| return function (f) { | |
| return function (a) { | |
| return Control_Bind.bind(dictMonad.Bind1())(a)(function (v) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(f(v)); | |
| }); | |
| }; | |
| }; | |
| }; | |
| 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["liftM1"] = liftM1; | |
| exports["ap"] = ap; | |
| })(PS["Control.Monad"] = PS["Control.Monad"] || {}); | |
| (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.1 | |
| "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.1 | |
| "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.1 | |
| "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.1 | |
| "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 mempty = function (dict) { | |
| return dict.mempty; | |
| }; | |
| exports["Monoid"] = Monoid; | |
| exports["mempty"] = mempty; | |
| exports["monoidString"] = monoidString; | |
| })(PS["Data.Monoid"] = PS["Data.Monoid"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 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) { | |
| var $__unused = function (dictPartial1) { | |
| return function ($dollar35) { | |
| return $dollar35; | |
| }; | |
| }; | |
| return $__unused(dictPartial)((function () { | |
| 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 altMaybe = new Control_Alt.Alt(function () { | |
| return functorMaybe; | |
| }, function (v) { | |
| return function (v1) { | |
| if (v instanceof Nothing) { | |
| return v1; | |
| }; | |
| return v; | |
| }; | |
| }); | |
| var plusMaybe = new Control_Plus.Plus(function () { | |
| return altMaybe; | |
| }, Nothing.value); | |
| exports["Nothing"] = Nothing; | |
| exports["Just"] = Just; | |
| exports["maybe"] = maybe; | |
| exports["fromMaybe"] = fromMaybe; | |
| exports["isNothing"] = isNothing; | |
| exports["fromJust"] = fromJust; | |
| exports["functorMaybe"] = functorMaybe; | |
| exports["altMaybe"] = altMaybe; | |
| exports["plusMaybe"] = plusMaybe; | |
| })(PS["Data.Maybe"] = PS["Data.Maybe"] || {}); | |
| (function(exports) { | |
| var Button =require("@salesforce/design-system-react/lib/components/button"); | |
| var Alert =require("@salesforce/design-system-react/lib/components/alert"); | |
| var PageHeader =require("@salesforce/design-system-react/lib/components/page-header"); | |
| var IconSettings =require("@salesforce/design-system-react/lib/components/icon-settings"); | |
| var Icon =require("@salesforce/design-system-react/lib/components/icon"); | |
| var Toast =require("@salesforce/design-system-react/lib/components/toast/index"); | |
| var ToastContainer =require("@salesforce/design-system-react/lib/components/toast/container"); | |
| var Spinner =require("@salesforce/design-system-react/lib/components/spinner"); | |
| var standardIcons =require("@salesforce/design-system-react/lib/icons/standard"); | |
| exports._buttonImpl = Button.default; | |
| exports._pageHeaderImpl = PageHeader.default; | |
| exports._iconSettingsImpl = IconSettings.default; | |
| exports._toastImpl = Toast.default; | |
| exports._toastContainerImpl = ToastContainer.default; | |
| exports._spinnerImpl = Spinner.default; | |
| })(PS["DesignSystem.Components.Internal"] = PS["DesignSystem.Components.Internal"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| var React =require("react"); | |
| exports.createComponent = (function() { | |
| // Begin component prototype functions | |
| // (`this`-dependent, defined outside `createComponent` | |
| // for a slight performance boost) | |
| function toSelf() { | |
| var self = { | |
| props: this.props.$$props, | |
| state: this.state === null ? null : this.state.$$state, | |
| instance_: this | |
| }; | |
| return self; | |
| } | |
| function componentDidMount() { | |
| var didMount = this.$$spec.didMount; | |
| if (didMount !== undefined) { | |
| didMount(this.toSelf())(); | |
| } | |
| } | |
| function shouldComponentUpdate(nextProps, nextState) { | |
| var shouldUpdate = this.$$spec.shouldUpdate; | |
| return shouldUpdate === undefined | |
| ? true | |
| : shouldUpdate(this.toSelf())({ | |
| nextProps: nextProps.$$props, | |
| nextState: nextState === null ? null : nextState.$$state | |
| }); | |
| } | |
| function componentDidUpdate(prevProps, prevState) { | |
| var didUpdate = this.$$spec.didUpdate; | |
| if (didUpdate !== undefined) { | |
| didUpdate(this.toSelf())({ | |
| prevProps: prevProps.$$props, | |
| prevState: prevState === null ? null : prevState.$$state | |
| })(); | |
| } | |
| } | |
| function componentWillUnmount() { | |
| this.$$mounted = false; | |
| var willUnmount = this.$$spec.willUnmount; | |
| if (willUnmount !== undefined) { | |
| willUnmount(this.toSelf())(); | |
| } | |
| } | |
| function render() { | |
| return this.$$spec.render(this.toSelf()); | |
| } | |
| // End component prototype functions | |
| return function(displayName) { | |
| var Component = function constructor(props) { | |
| this.$$mounted = true; | |
| this.$$spec = props.$$spec; | |
| this.state = | |
| // React may optimize components with no state, | |
| // so we leave state null if it was left as | |
| // the default value. | |
| this.$$spec.initialState === undefined | |
| ? null | |
| : { $$state: this.$$spec.initialState }; | |
| return this; | |
| }; | |
| Component.displayName = displayName; | |
| Component.prototype = Object.create(React.Component.prototype); | |
| Component.prototype.constructor = Component; | |
| Component.prototype.toSelf = toSelf; | |
| Component.prototype.shouldComponentUpdate = shouldComponentUpdate; | |
| Component.prototype.componentDidMount = componentDidMount; | |
| Component.prototype.componentDidUpdate = componentDidUpdate; | |
| Component.prototype.componentWillUnmount = componentWillUnmount; | |
| Component.prototype.render = render; | |
| return Component; | |
| }; | |
| })(); | |
| exports.send_ = function(buildStateUpdate) { | |
| return function(self, action) { | |
| if (!self.instance_.$$mounted) { | |
| exports.warningUnmountedComponentAction(self, action); | |
| return; | |
| } | |
| if (self.instance_.$$spec.update === undefined) { | |
| exports.warningDefaultUpdate(self, action); | |
| return; | |
| } | |
| var sideEffects = null; | |
| self.instance_.setState( | |
| function(s) { | |
| var setStateContext = self.instance_.toSelf(); | |
| setStateContext.state = s.$$state; | |
| var updates = buildStateUpdate( | |
| self.instance_.$$spec.update(setStateContext)(action) | |
| ); | |
| if (updates.effects !== null) { | |
| sideEffects = updates.effects; | |
| } | |
| if (updates.state !== null && updates.state !== s.$$state) { | |
| return { $$state: updates.state }; | |
| } else { | |
| return null; | |
| } | |
| }, | |
| function() { | |
| if (sideEffects !== null) { | |
| sideEffects(this.toSelf())(); | |
| } | |
| } | |
| ); | |
| }; | |
| }; | |
| exports.make = function(_unionDict) { | |
| return function($$type) { | |
| return function($$spec) { | |
| var $$specPadded = { | |
| initialState: $$spec.initialState, | |
| update: $$spec.update, | |
| render: $$spec.render, | |
| didMount: $$spec.didMount, | |
| shouldUpdate: $$spec.shouldUpdate, | |
| didUpdate: $$spec.didUpdate, | |
| willUnmount: $$spec.willUnmount | |
| }; | |
| return function($$props) { | |
| var props = { | |
| $$props: $$props, | |
| $$spec: $$specPadded | |
| }; | |
| return React.createElement($$type, props); | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports.empty = null; | |
| exports.element_ = function(component, props) { | |
| return React.createElement.apply( | |
| null, | |
| [component, props].concat((props && props.children) || null) | |
| ); | |
| }; | |
| exports.displayNameFromComponent = function($$type) { | |
| return $$type.displayName || "[unknown]"; | |
| }; | |
| exports.displayNameFromSelf = function(self) { | |
| return exports.displayNameFromComponent(self.instance_.constructor); | |
| }; | |
| exports.warningDefaultUpdate = function(self, action) { | |
| console.error( | |
| "A " + | |
| exports.displayNameFromSelf(self) + | |
| " component received an action but has no `update` function defined. Override the default `update` function to handle this action." | |
| ); | |
| console.error("Self:", self); | |
| console.error("Action:", action); | |
| }; | |
| exports.warningUnmountedComponentAction = function(self, action) { | |
| console.error( | |
| "An unmounted " + | |
| exports.displayNameFromSelf(self) + | |
| " component received the action below. Actions received by unmounted components usually indicate a memory leak. Make sure to unsubscribe from any async work in `willUnmount`." | |
| ); | |
| console.error("Self:", self); | |
| console.error("Action:", action); | |
| }; | |
| })(PS["React.Basic"] = PS["React.Basic"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Category = PS["Control.Category"]; | |
| var Bifunctor = function (bimap) { | |
| this.bimap = bimap; | |
| }; | |
| var bimap = function (dict) { | |
| return dict.bimap; | |
| }; | |
| var lmap = function (dictBifunctor) { | |
| return function (f) { | |
| return bimap(dictBifunctor)(f)(Control_Category.identity(Control_Category.categoryFn)); | |
| }; | |
| }; | |
| exports["bimap"] = bimap; | |
| exports["Bifunctor"] = Bifunctor; | |
| exports["lmap"] = lmap; | |
| })(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.1 | |
| "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 Conj = function (x) { | |
| return x; | |
| }; | |
| var semigroupConj = function (dictHeytingAlgebra) { | |
| return new Data_Semigroup.Semigroup(function (v) { | |
| return function (v1) { | |
| return Data_HeytingAlgebra.conj(dictHeytingAlgebra)(v)(v1); | |
| }; | |
| }); | |
| }; | |
| var monoidConj = function (dictHeytingAlgebra) { | |
| return new Data_Monoid.Monoid(function () { | |
| return semigroupConj(dictHeytingAlgebra); | |
| }, Data_HeytingAlgebra.tt(dictHeytingAlgebra)); | |
| }; | |
| exports["Conj"] = Conj; | |
| exports["semigroupConj"] = semigroupConj; | |
| exports["monoidConj"] = monoidConj; | |
| })(PS["Data.Monoid.Conj"] = PS["Data.Monoid.Conj"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 newtypeConj = new Newtype(function (v) { | |
| return v; | |
| }, Data_Monoid_Conj.Conj); | |
| 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["newtypeConj"] = newtypeConj; | |
| })(PS["Data.Newtype"] = PS["Data.Newtype"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 foldl = function (dict) { | |
| return dict.foldl; | |
| }; | |
| var intercalate = function (dictFoldable) { | |
| return function (dictMonoid) { | |
| return function (sep) { | |
| return function (xs) { | |
| var go = function (v) { | |
| return function (x) { | |
| if (v.init) { | |
| return { | |
| init: false, | |
| acc: x | |
| }; | |
| }; | |
| return { | |
| init: false, | |
| acc: Data_Semigroup.append(dictMonoid.Semigroup0())(v.acc)(Data_Semigroup.append(dictMonoid.Semigroup0())(sep)(x)) | |
| }; | |
| }; | |
| }; | |
| return (foldl(dictFoldable)(go)({ | |
| init: true, | |
| acc: Data_Monoid.mempty(dictMonoid) | |
| })(xs)).acc; | |
| }; | |
| }; | |
| }; | |
| }; | |
| 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 all = function (dictFoldable) { | |
| return function (dictHeytingAlgebra) { | |
| return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Newtype.newtypeConj)(Data_Newtype.newtypeConj)(Data_Monoid_Conj.Conj)(foldMap(dictFoldable)(Data_Monoid_Conj.monoidConj(dictHeytingAlgebra))); | |
| }; | |
| }; | |
| exports["Foldable"] = Foldable; | |
| exports["foldr"] = foldr; | |
| exports["foldl"] = foldl; | |
| exports["foldMap"] = foldMap; | |
| exports["foldMapDefaultR"] = foldMapDefaultR; | |
| exports["traverse_"] = traverse_; | |
| exports["intercalate"] = intercalate; | |
| exports["all"] = all; | |
| exports["foldableArray"] = foldableArray; | |
| })(PS["Data.Foldable"] = PS["Data.Foldable"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 showEither = function (dictShow) { | |
| return function (dictShow1) { | |
| return new Data_Show.Show(function (v) { | |
| if (v instanceof Left) { | |
| return "(Left " + (Data_Show.show(dictShow)(v.value0) + ")"); | |
| }; | |
| if (v instanceof Right) { | |
| return "(Right " + (Data_Show.show(dictShow1)(v.value0) + ")"); | |
| }; | |
| throw new Error("Failed pattern match at Data.Either line 163, column 1 - line 163, column 61: " + [ v.constructor.name ]); | |
| }); | |
| }; | |
| }; | |
| 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 ]); | |
| }; | |
| }); | |
| var applicativeEither = new Control_Applicative.Applicative(function () { | |
| return applyEither; | |
| }, Right.create); | |
| exports["Left"] = Left; | |
| exports["Right"] = Right; | |
| exports["either"] = either; | |
| exports["functorEither"] = functorEither; | |
| exports["bifunctorEither"] = bifunctorEither; | |
| exports["applyEither"] = applyEither; | |
| exports["applicativeEither"] = applicativeEither; | |
| exports["showEither"] = showEither; | |
| })(PS["Data.Either"] = PS["Data.Either"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.runFn2 = function (fn) { | |
| return function (a) { | |
| return function (b) { | |
| return fn(a, b); | |
| }; | |
| }; | |
| }; | |
| })(PS["Data.Function.Uncurried"] = PS["Data.Function.Uncurried"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Data.Function.Uncurried"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| exports["runFn2"] = $foreign.runFn2; | |
| })(PS["Data.Function.Uncurried"] = PS["Data.Function.Uncurried"] || {}); | |
| (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.1 | |
| "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 toMaybe = function (n) { | |
| return $foreign.nullable(n, Data_Maybe.Nothing.value, Data_Maybe.Just.create); | |
| }; | |
| exports["toMaybe"] = toMaybe; | |
| exports["null"] = $foreign["null"]; | |
| exports["notNull"] = $foreign.notNull; | |
| })(PS["Data.Nullable"] = PS["Data.Nullable"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.pureE = function (a) { | |
| return function () { | |
| return a; | |
| }; | |
| }; | |
| exports.bindE = function (a) { | |
| return function (f) { | |
| return function () { | |
| return f(a())(); | |
| }; | |
| }; | |
| }; | |
| })(PS["Effect"] = PS["Effect"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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; | |
| })(PS["Effect"] = PS["Effect"] || {}); | |
| (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._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._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._delay = function () { | |
| function setDelay(n, k) { | |
| if (n === 0 && typeof setImmediate !== "undefined") { | |
| return setImmediate(k); | |
| } else { | |
| return setTimeout(k, n); | |
| } | |
| } | |
| function clearDelay(n, t) { | |
| if (n === 0 && typeof clearImmediate !== "undefined") { | |
| return clearImmediate(t); | |
| } else { | |
| return clearTimeout(t); | |
| } | |
| } | |
| return function (right, ms) { | |
| return Aff.Async(function (cb) { | |
| return function () { | |
| var timer = setDelay(ms, cb(right())); | |
| return function () { | |
| return Aff.Sync(function () { | |
| return right(clearDelay(ms, timer)); | |
| }); | |
| }; | |
| }; | |
| }); | |
| }; | |
| }(); | |
| exports._sequential = Aff.Seq; | |
| })(PS["Effect.Aff"] = PS["Effect.Aff"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Lazy = function (defer) { | |
| this.defer = defer; | |
| }; | |
| var defer = function (dict) { | |
| return dict.defer; | |
| }; | |
| exports["defer"] = defer; | |
| exports["Lazy"] = Lazy; | |
| })(PS["Control.Lazy"] = PS["Control.Lazy"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 throwError = function (dict) { | |
| return dict.throwError; | |
| }; | |
| exports["throwError"] = throwError; | |
| exports["MonadThrow"] = MonadThrow; | |
| })(PS["Control.Monad.Error.Class"] = PS["Control.Monad.Error.Class"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 showTuple = function (dictShow) { | |
| return function (dictShow1) { | |
| return new Data_Show.Show(function (v) { | |
| return "(Tuple " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")"))); | |
| }); | |
| }; | |
| }; | |
| var fst = function (v) { | |
| return v.value0; | |
| }; | |
| exports["Tuple"] = Tuple; | |
| exports["fst"] = fst; | |
| exports["snd"] = snd; | |
| exports["showTuple"] = showTuple; | |
| })(PS["Data.Tuple"] = PS["Data.Tuple"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 gets = function (dictMonadState) { | |
| return function (f) { | |
| return state(dictMonadState)(function (s) { | |
| return new Data_Tuple.Tuple(f(s), s); | |
| }); | |
| }; | |
| }; | |
| exports["state"] = state; | |
| exports["MonadState"] = MonadState; | |
| exports["gets"] = gets; | |
| exports["modify_"] = modify_; | |
| })(PS["Control.Monad.State.Class"] = PS["Control.Monad.State.Class"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "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.1 | |
| "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 monadTransExceptT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) { | |
| return function (m) { | |
| return Control_Bind.bind(dictMonad.Bind1())(m)(function (v) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Right(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 monadStateExceptT = function (dictMonadState) { | |
| return new Control_Monad_State_Class.MonadState(function () { | |
| return monadExceptT(dictMonadState.Monad0()); | |
| }, function (f) { | |
| return Control_Monad_Trans_Class.lift(monadTransExceptT)(dictMonadState.Monad0())(Control_Monad_State_Class.state(dictMonadState)(f)); | |
| }); | |
| }; | |
| 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["monadTransExceptT"] = monadTransExceptT; | |
| exports["monadThrowExceptT"] = monadThrowExceptT; | |
| exports["monadStateExceptT"] = monadStateExceptT; | |
| })(PS["Control.Monad.Except.Trans"] = PS["Control.Monad.Except.Trans"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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_Function = PS["Data.Function"]; | |
| var Data_Functor = PS["Data.Functor"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Newtype = PS["Data.Newtype"]; | |
| var Data_Tuple = PS["Data.Tuple"]; | |
| var Effect_Class = PS["Effect.Class"]; | |
| var Prelude = PS["Prelude"]; | |
| var MaybeT = function (x) { | |
| return x; | |
| }; | |
| var runMaybeT = function (v) { | |
| return v; | |
| }; | |
| var monadTransMaybeT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) { | |
| return function ($75) { | |
| return MaybeT(Control_Monad.liftM1(dictMonad)(Data_Maybe.Just.create)($75)); | |
| }; | |
| }); | |
| var functorMaybeT = function (dictFunctor) { | |
| return new Data_Functor.Functor(function (f) { | |
| return function (v) { | |
| return Data_Functor.map(dictFunctor)(Data_Functor.map(Data_Maybe.functorMaybe)(f))(v); | |
| }; | |
| }); | |
| }; | |
| var monadMaybeT = function (dictMonad) { | |
| return new Control_Monad.Monad(function () { | |
| return applicativeMaybeT(dictMonad); | |
| }, function () { | |
| return bindMaybeT(dictMonad); | |
| }); | |
| }; | |
| var bindMaybeT = function (dictMonad) { | |
| return new Control_Bind.Bind(function () { | |
| return applyMaybeT(dictMonad); | |
| }, function (v) { | |
| return function (f) { | |
| return Control_Bind.bind(dictMonad.Bind1())(v)(function (v1) { | |
| if (v1 instanceof Data_Maybe.Nothing) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(Data_Maybe.Nothing.value); | |
| }; | |
| if (v1 instanceof Data_Maybe.Just) { | |
| var v2 = f(v1.value0); | |
| return v2; | |
| }; | |
| throw new Error("Failed pattern match at Control.Monad.Maybe.Trans line 54, column 11 - line 56, column 42: " + [ v1.constructor.name ]); | |
| }); | |
| }; | |
| }); | |
| }; | |
| var applyMaybeT = function (dictMonad) { | |
| return new Control_Apply.Apply(function () { | |
| return functorMaybeT(((dictMonad.Bind1()).Apply0()).Functor0()); | |
| }, Control_Monad.ap(monadMaybeT(dictMonad))); | |
| }; | |
| var applicativeMaybeT = function (dictMonad) { | |
| return new Control_Applicative.Applicative(function () { | |
| return applyMaybeT(dictMonad); | |
| }, function ($76) { | |
| return MaybeT(Control_Applicative.pure(dictMonad.Applicative0())(Data_Maybe.Just.create($76))); | |
| }); | |
| }; | |
| var monadEffectMaybe = function (dictMonadEffect) { | |
| return new Effect_Class.MonadEffect(function () { | |
| return monadMaybeT(dictMonadEffect.Monad0()); | |
| }, function ($77) { | |
| return Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadEffect.Monad0())(Effect_Class.liftEffect(dictMonadEffect)($77)); | |
| }); | |
| }; | |
| var altMaybeT = function (dictMonad) { | |
| return new Control_Alt.Alt(function () { | |
| return functorMaybeT(((dictMonad.Bind1()).Apply0()).Functor0()); | |
| }, function (v) { | |
| return function (v1) { | |
| return Control_Bind.bind(dictMonad.Bind1())(v)(function (v2) { | |
| if (v2 instanceof Data_Maybe.Nothing) { | |
| return v1; | |
| }; | |
| return Control_Applicative.pure(dictMonad.Applicative0())(v2); | |
| }); | |
| }; | |
| }); | |
| }; | |
| var plusMaybeT = function (dictMonad) { | |
| return new Control_Plus.Plus(function () { | |
| return altMaybeT(dictMonad); | |
| }, Control_Applicative.pure(dictMonad.Applicative0())(Data_Maybe.Nothing.value)); | |
| }; | |
| exports["MaybeT"] = MaybeT; | |
| exports["runMaybeT"] = runMaybeT; | |
| exports["functorMaybeT"] = functorMaybeT; | |
| exports["applyMaybeT"] = applyMaybeT; | |
| exports["applicativeMaybeT"] = applicativeMaybeT; | |
| exports["bindMaybeT"] = bindMaybeT; | |
| exports["monadMaybeT"] = monadMaybeT; | |
| exports["monadTransMaybeT"] = monadTransMaybeT; | |
| exports["altMaybeT"] = altMaybeT; | |
| exports["plusMaybeT"] = plusMaybeT; | |
| exports["monadEffectMaybe"] = monadEffectMaybe; | |
| })(PS["Control.Monad.Maybe.Trans"] = PS["Control.Monad.Maybe.Trans"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "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.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.1 | |
| "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; | |
| })(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.1 | |
| "use strict"; | |
| var $foreign = PS["Effect.Unsafe"]; | |
| var Effect = PS["Effect"]; | |
| exports["unsafePerformEffect"] = $foreign.unsafePerformEffect; | |
| })(PS["Effect.Unsafe"] = PS["Effect.Unsafe"] || {}); | |
| (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.1 | |
| "use strict"; | |
| var $foreign = PS["Partial"]; | |
| exports["crashWith"] = $foreign.crashWith; | |
| })(PS["Partial"] = PS["Partial"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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) { | |
| "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.1 | |
| "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.1 | |
| "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 functorParAff = new Data_Functor.Functor($foreign._parAffMap); | |
| var functorAff = new Data_Functor.Functor($foreign._map); | |
| 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 395, column 21 - line 397, 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 390, column 20 - line 394, 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 385, column 12 - line 387, 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 launchAff_ = function ($49) { | |
| return Data_Functor["void"](Effect.functorEffect)(launchAff($49)); | |
| }; | |
| var delay = function (v) { | |
| return $foreign._delay(Data_Either.Right.create, 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 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 ($53) { | |
| return Control_Parallel_Class.parallel(parallelAff)(Control_Applicative.pure(applicativeAff)($53)); | |
| }); | |
| var semigroupCanceler = new Data_Semigroup.Semigroup(function (v) { | |
| return function (v1) { | |
| return function (err) { | |
| return Control_Parallel.parSequence_(parallelAff)(Data_Foldable.foldableArray)([ v(err), v1(err) ]); | |
| }; | |
| }; | |
| }); | |
| var nonCanceler = Data_Function["const"](Control_Applicative.pure(applicativeAff)(Data_Unit.unit)); | |
| var monoidCanceler = new Data_Monoid.Monoid(function () { | |
| return semigroupCanceler; | |
| }, nonCanceler); | |
| exports["launchAff"] = launchAff; | |
| exports["launchAff_"] = launchAff_; | |
| exports["delay"] = delay; | |
| exports["nonCanceler"] = nonCanceler; | |
| exports["functorAff"] = functorAff; | |
| exports["applyAff"] = applyAff; | |
| exports["applicativeAff"] = applicativeAff; | |
| exports["bindAff"] = bindAff; | |
| exports["monadAff"] = monadAff; | |
| exports["monadEffectAff"] = monadEffectAff; | |
| exports["functorParAff"] = functorParAff; | |
| exports["applyParAff"] = applyParAff; | |
| exports["applicativeParAff"] = applicativeParAff; | |
| exports["parallelAff"] = parallelAff; | |
| exports["semigroupCanceler"] = semigroupCanceler; | |
| exports["monoidCanceler"] = monoidCanceler; | |
| exports["makeAff"] = $foreign.makeAff; | |
| })(PS["Effect.Aff"] = PS["Effect.Aff"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.mkEffectFn1 = function mkEffectFn1(fn) { | |
| return function(x) { | |
| return fn(x)(); | |
| }; | |
| }; | |
| exports.runEffectFn2 = function runEffectFn2(fn) { | |
| return function(a) { | |
| return function(b) { | |
| return function() { | |
| return fn(a, b); | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports.runEffectFn3 = function runEffectFn3(fn) { | |
| return function(a) { | |
| return function(b) { | |
| return function(c) { | |
| return function() { | |
| return fn(a, b, c); | |
| }; | |
| }; | |
| }; | |
| }; | |
| }; | |
| })(PS["Effect.Uncurried"] = PS["Effect.Uncurried"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Effect.Uncurried"]; | |
| var Effect = PS["Effect"]; | |
| exports["mkEffectFn1"] = $foreign.mkEffectFn1; | |
| exports["runEffectFn2"] = $foreign.runEffectFn2; | |
| exports["runEffectFn3"] = $foreign.runEffectFn3; | |
| })(PS["Effect.Uncurried"] = PS["Effect.Uncurried"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Category = PS["Control.Category"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_Symbol = PS["Data.Symbol"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Uncurried = PS["Effect.Uncurried"]; | |
| var Prelude = PS["Prelude"]; | |
| var Record = PS["Record"]; | |
| var Type_Row = PS["Type.Row"]; | |
| var EventFn = function (x) { | |
| return x; | |
| }; | |
| var unsafeEventFn = EventFn; | |
| var semigroupoidBuilder = Control_Semigroupoid.semigroupoidFn; | |
| var handler_ = function ($21) { | |
| return Effect_Uncurried.mkEffectFn1(Data_Function["const"]($21)); | |
| }; | |
| var handler = function (v) { | |
| return function (cb) { | |
| return function ($22) { | |
| return cb(v($22))(); | |
| }; | |
| }; | |
| }; | |
| var categoryBuilder = Control_Category.categoryFn; | |
| exports["unsafeEventFn"] = unsafeEventFn; | |
| exports["handler"] = handler; | |
| exports["handler_"] = handler_; | |
| exports["semigroupoidBuilder"] = semigroupoidBuilder; | |
| exports["categoryBuilder"] = categoryBuilder; | |
| })(PS["React.Basic.Events"] = PS["React.Basic.Events"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Nullable = PS["Data.Nullable"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Unsafe = PS["Effect.Unsafe"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_Event_Internal_Types = PS["Web.Event.Internal.Types"]; | |
| var stopPropagation = React_Basic_Events.unsafeEventFn(function (e) { | |
| return Effect_Unsafe.unsafePerformEffect(function __do() { | |
| var v = e.stopPropagation(); | |
| return e; | |
| }); | |
| }); | |
| var preventDefault = React_Basic_Events.unsafeEventFn(function (e) { | |
| return Effect_Unsafe.unsafePerformEffect(function __do() { | |
| var v = e.preventDefault(); | |
| return e; | |
| }); | |
| }); | |
| var currentTarget = React_Basic_Events.unsafeEventFn(function (e) { | |
| return e.currentTarget; | |
| }); | |
| exports["preventDefault"] = preventDefault; | |
| exports["stopPropagation"] = stopPropagation; | |
| exports["currentTarget"] = currentTarget; | |
| })(PS["React.Basic.DOM.Events"] = PS["React.Basic.DOM.Events"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["React.Basic"]; | |
| var Control_Category = PS["Control.Category"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Either = PS["Data.Either"]; | |
| var Data_Function_Uncurried = PS["Data.Function.Uncurried"]; | |
| var Data_Monoid = PS["Data.Monoid"]; | |
| var Data_Nullable = PS["Data.Nullable"]; | |
| var Data_Semigroup = PS["Data.Semigroup"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Aff = PS["Effect.Aff"]; | |
| var Effect_Uncurried = PS["Effect.Uncurried"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic_DOM_Events = PS["React.Basic.DOM.Events"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var Type_Row = PS["Type.Row"]; | |
| var NoUpdate = (function () { | |
| function NoUpdate() { | |
| }; | |
| NoUpdate.value = new NoUpdate(); | |
| return NoUpdate; | |
| })(); | |
| var Update = (function () { | |
| function Update(value0) { | |
| this.value0 = value0; | |
| }; | |
| Update.create = function (value0) { | |
| return new Update(value0); | |
| }; | |
| return Update; | |
| })(); | |
| var SideEffects = (function () { | |
| function SideEffects(value0) { | |
| this.value0 = value0; | |
| }; | |
| SideEffects.create = function (value0) { | |
| return new SideEffects(value0); | |
| }; | |
| return SideEffects; | |
| })(); | |
| var UpdateAndSideEffects = (function () { | |
| function UpdateAndSideEffects(value0, value1) { | |
| this.value0 = value0; | |
| this.value1 = value1; | |
| }; | |
| UpdateAndSideEffects.create = function (value0) { | |
| return function (value1) { | |
| return new UpdateAndSideEffects(value0, value1); | |
| }; | |
| }; | |
| return UpdateAndSideEffects; | |
| })(); | |
| var makeStateless = function (component) { | |
| return function (render) { | |
| return $foreign.make()(component)({ | |
| initialState: Data_Unit.unit, | |
| render: function (self) { | |
| return render(self.props); | |
| } | |
| }); | |
| }; | |
| }; | |
| var element = Data_Function_Uncurried.runFn2($foreign.element_); | |
| var buildStateUpdate = function (v) { | |
| if (v instanceof NoUpdate) { | |
| return { | |
| state: Data_Nullable["null"], | |
| effects: Data_Nullable["null"] | |
| }; | |
| }; | |
| if (v instanceof Update) { | |
| return { | |
| state: Data_Nullable.notNull(v.value0), | |
| effects: Data_Nullable["null"] | |
| }; | |
| }; | |
| if (v instanceof SideEffects) { | |
| return { | |
| state: Data_Nullable["null"], | |
| effects: Data_Nullable.notNull(v.value0) | |
| }; | |
| }; | |
| if (v instanceof UpdateAndSideEffects) { | |
| return { | |
| state: Data_Nullable.notNull(v.value0), | |
| effects: Data_Nullable.notNull(v.value1) | |
| }; | |
| }; | |
| throw new Error("Failed pattern match at React.Basic line 446, column 20 - line 462, column 6: " + [ v.constructor.name ]); | |
| }; | |
| var send = Effect_Uncurried.runEffectFn2($foreign.send_(buildStateUpdate)); | |
| var monitor = function (self) { | |
| return function (eventFn) { | |
| return function (makeAction) { | |
| return React_Basic_Events.handler(eventFn)(function (a) { | |
| return send(self)(makeAction(a)); | |
| }); | |
| }; | |
| }; | |
| }; | |
| var capture = function (self) { | |
| return function (eventFn) { | |
| return monitor(self)(Control_Semigroupoid.composeFlipped(React_Basic_Events.semigroupoidBuilder)(React_Basic_DOM_Events.preventDefault)(Control_Semigroupoid.composeFlipped(React_Basic_Events.semigroupoidBuilder)(React_Basic_DOM_Events.stopPropagation)(eventFn))); | |
| }; | |
| }; | |
| var capture_ = function (self) { | |
| return function (action) { | |
| return capture(self)(Control_Category.identity(React_Basic_Events.categoryBuilder))(function (v) { | |
| return action; | |
| }); | |
| }; | |
| }; | |
| exports["NoUpdate"] = NoUpdate; | |
| exports["Update"] = Update; | |
| exports["SideEffects"] = SideEffects; | |
| exports["UpdateAndSideEffects"] = UpdateAndSideEffects; | |
| exports["send"] = send; | |
| exports["capture"] = capture; | |
| exports["capture_"] = capture_; | |
| exports["monitor"] = monitor; | |
| exports["makeStateless"] = makeStateless; | |
| exports["element"] = element; | |
| exports["createComponent"] = $foreign.createComponent; | |
| exports["make"] = $foreign.make; | |
| exports["empty"] = $foreign.empty; | |
| })(PS["React.Basic"] = PS["React.Basic"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var unsafeCreateDOMComponent = Unsafe_Coerce.unsafeCoerce; | |
| exports["unsafeCreateDOMComponent"] = unsafeCreateDOMComponent; | |
| })(PS["React.Basic.DOM.Internal"] = PS["React.Basic.DOM.Internal"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["DesignSystem.Components.Internal"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM_Internal = PS["React.Basic.DOM.Internal"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_DOM_Element = PS["Web.DOM.Element"]; | |
| var toastContainer = function (dictUnion) { | |
| return React_Basic.element($foreign._toastContainerImpl); | |
| }; | |
| var toast = function (dictUnion) { | |
| return React_Basic.element($foreign._toastImpl); | |
| }; | |
| var spinner = function (dictUnion) { | |
| return React_Basic.element($foreign._spinnerImpl); | |
| }; | |
| var pageHeader = function (dictUnion) { | |
| return React_Basic.element($foreign._pageHeaderImpl); | |
| }; | |
| var iconSettings = function (dictUnion) { | |
| return React_Basic.element($foreign._iconSettingsImpl); | |
| }; | |
| var button = function (dictUnion) { | |
| return React_Basic.element($foreign._buttonImpl); | |
| }; | |
| exports["button"] = button; | |
| exports["pageHeader"] = pageHeader; | |
| exports["iconSettings"] = iconSettings; | |
| exports["toast"] = toast; | |
| exports["toastContainer"] = toastContainer; | |
| exports["spinner"] = spinner; | |
| })(PS["DesignSystem.Components.Internal"] = PS["DesignSystem.Components.Internal"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| var ReactDOM =require("react-dom"); | |
| exports.render_ = function(jsx, node, callback) { | |
| ReactDOM.render(jsx, node, callback); | |
| }; | |
| })(PS["React.Basic.DOM"] = PS["React.Basic.DOM"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM_Internal = PS["React.Basic.DOM.Internal"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var svg = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("svg")); | |
| }; | |
| var span = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("span")); | |
| }; | |
| var p = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("p")); | |
| }; | |
| var label = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("label")); | |
| }; | |
| var input = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("input")); | |
| }; | |
| var div = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("div")); | |
| }; | |
| exports["div"] = div; | |
| exports["input"] = input; | |
| exports["label"] = label; | |
| exports["p"] = p; | |
| exports["span"] = span; | |
| exports["svg"] = svg; | |
| })(PS["React.Basic.DOM.Generated"] = PS["React.Basic.DOM.Generated"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["React.Basic.DOM"]; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Data_Either = PS["Data.Either"]; | |
| var Data_Function_Uncurried = PS["Data.Function.Uncurried"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Nullable = PS["Data.Nullable"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Exception = PS["Effect.Exception"]; | |
| var Effect_Uncurried = PS["Effect.Uncurried"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM_Generated = PS["React.Basic.DOM.Generated"]; | |
| var React_Basic_DOM_Internal = PS["React.Basic.DOM.Internal"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_DOM = PS["Web.DOM"]; | |
| var text = Unsafe_Coerce.unsafeCoerce; | |
| var render$prime = Effect_Uncurried.runEffectFn3($foreign.render_); | |
| var render = function (jsx) { | |
| return function (node) { | |
| return render$prime(jsx)(node)(Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit)); | |
| }; | |
| }; | |
| exports["render"] = render; | |
| exports["text"] = text; | |
| })(PS["React.Basic.DOM"] = PS["React.Basic.DOM"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Monoid = PS["Data.Monoid"]; | |
| var DesignSystem_Components_Internal = PS["DesignSystem.Components.Internal"]; | |
| var Effect = PS["Effect"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM = PS["React.Basic.DOM"]; | |
| var React_Basic_Events = PS["React.Basic.Events"]; | |
| var Close = (function () { | |
| function Close() { | |
| }; | |
| Close.value = new Close(); | |
| return Close; | |
| })(); | |
| var Open = (function () { | |
| function Open() { | |
| }; | |
| Open.value = new Open(); | |
| return Open; | |
| })(); | |
| var component = React_Basic.createComponent("Alert"); | |
| var alert = React_Basic.makeStateless(component)(function (props) { | |
| if (props.alertAction instanceof Close) { | |
| return React_Basic.empty; | |
| }; | |
| if (props.alertAction instanceof Open) { | |
| return DesignSystem_Components_Internal.iconSettings()({ | |
| iconPath: "/apexpages/slds/latest/assets/icons", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(DesignSystem_Components_Internal.toastContainer()({ | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(DesignSystem_Components_Internal.toast()({ | |
| variant: "error", | |
| onRequestClose: React_Basic_Events.handler_(props.closeAlert), | |
| labels: { | |
| heading: React_Basic_DOM.text(Data_Maybe.fromMaybe(Data_Monoid.mempty(Data_Monoid.monoidString))(props.alertMsg)), | |
| details: React_Basic_DOM.text(Data_Monoid.mempty(Data_Monoid.monoidString)), | |
| headingLink: React_Basic_DOM.text("") | |
| } | |
| })) | |
| })) | |
| }); | |
| }; | |
| throw new Error("Failed pattern match at Component.Alert line 21, column 45 - line 39, column 13: " + [ props.alertAction.constructor.name ]); | |
| }); | |
| exports["Close"] = Close; | |
| exports["Open"] = Open; | |
| exports["component"] = component; | |
| exports["alert"] = alert; | |
| })(PS["Component.Alert"] = PS["Component.Alert"] || {}); | |
| (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.1 | |
| "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.1 | |
| "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) { | |
| // Generated by purs version 0.12.1 | |
| "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)); | |
| }; | |
| }; | |
| var showNonEmpty = function (dictShow) { | |
| return function (dictShow1) { | |
| return new Data_Show.Show(function (v) { | |
| return "(NonEmpty " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")"))); | |
| }); | |
| }; | |
| }; | |
| exports["NonEmpty"] = NonEmpty; | |
| exports["singleton"] = singleton; | |
| exports["showNonEmpty"] = showNonEmpty; | |
| })(PS["Data.NonEmpty"] = PS["Data.NonEmpty"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 showList = function (dictShow) { | |
| return new Data_Show.Show(function (v) { | |
| if (v instanceof Nil) { | |
| return "Nil"; | |
| }; | |
| return "(" + (Data_Foldable.intercalate(foldableList)(Data_Monoid.monoidString)(" : ")(Data_Functor.map(functorList)(Data_Show.show(dictShow))(v)) + " : Nil)"); | |
| }); | |
| }; | |
| var showNonEmptyList = function (dictShow) { | |
| return new Data_Show.Show(function (v) { | |
| return "(NonEmptyList " + (Data_Show.show(Data_NonEmpty.showNonEmpty(dictShow)(showList(dictShow)))(v) + ")"); | |
| }); | |
| }; | |
| 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["showList"] = showList; | |
| exports["semigroupList"] = semigroupList; | |
| exports["functorList"] = functorList; | |
| exports["foldableList"] = foldableList; | |
| exports["altList"] = altList; | |
| exports["plusList"] = plusList; | |
| exports["showNonEmptyList"] = showNonEmptyList; | |
| })(PS["Data.List.Types"] = PS["Data.List.Types"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 singleton = function (a) { | |
| return new Data_List_Types.Cons(a, Data_List_Types.Nil.value); | |
| }; | |
| 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 zipWith = function (f) { | |
| return function (xs) { | |
| return function (ys) { | |
| var go = function ($copy_v) { | |
| return function ($copy_v1) { | |
| return function ($copy_acc) { | |
| var $tco_var_v = $copy_v; | |
| var $tco_var_v1 = $copy_v1; | |
| var $tco_done = false; | |
| var $tco_result; | |
| function $tco_loop(v, v1, acc) { | |
| if (v instanceof Data_List_Types.Nil) { | |
| $tco_done = true; | |
| return acc; | |
| }; | |
| if (v1 instanceof Data_List_Types.Nil) { | |
| $tco_done = true; | |
| return acc; | |
| }; | |
| if (v instanceof Data_List_Types.Cons && v1 instanceof Data_List_Types.Cons) { | |
| $tco_var_v = v.value1; | |
| $tco_var_v1 = v1.value1; | |
| $copy_acc = new Data_List_Types.Cons(f(v.value0)(v1.value0), acc); | |
| return; | |
| }; | |
| throw new Error("Failed pattern match at Data.List line 718, column 3 - line 718, column 21: " + [ v.constructor.name, v1.constructor.name, acc.constructor.name ]); | |
| }; | |
| while (!$tco_done) { | |
| $tco_result = $tco_loop($tco_var_v, $tco_var_v1, $copy_acc); | |
| }; | |
| return $tco_result; | |
| }; | |
| }; | |
| }; | |
| return reverse(go(xs)(ys)(Data_List_Types.Nil.value)); | |
| }; | |
| }; | |
| }; | |
| var zip = zipWith(Data_Tuple.Tuple.create); | |
| var some = function (dictAlternative) { | |
| return function (dictLazy) { | |
| return function (v) { | |
| return Control_Apply.apply((dictAlternative.Applicative0()).Apply0())(Data_Functor.map(((dictAlternative.Plus1()).Alt0()).Functor0())(Data_List_Types.Cons.create)(v))(Control_Lazy.defer(dictLazy)(function (v1) { | |
| return many(dictAlternative)(dictLazy)(v); | |
| })); | |
| }; | |
| }; | |
| }; | |
| var many = function (dictAlternative) { | |
| return function (dictLazy) { | |
| return function (v) { | |
| return Control_Alt.alt((dictAlternative.Plus1()).Alt0())(some(dictAlternative)(dictLazy)(v))(Control_Applicative.pure(dictAlternative.Applicative0())(Data_List_Types.Nil.value)); | |
| }; | |
| }; | |
| }; | |
| exports["singleton"] = singleton; | |
| exports["some"] = some; | |
| exports["many"] = many; | |
| exports["reverse"] = reverse; | |
| exports["zipWith"] = zipWith; | |
| exports["zip"] = zip; | |
| })(PS["Data.List"] = PS["Data.List"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 singleton = function (k) { | |
| return function (v) { | |
| return new Two(Leaf.value, k, v, Leaf.value); | |
| }; | |
| }; | |
| var toUnfoldable = function (dictUnfoldable) { | |
| return function (m) { | |
| var go = function ($copy_v) { | |
| var $tco_done = false; | |
| var $tco_result; | |
| function $tco_loop(v) { | |
| if (v instanceof Data_List_Types.Nil) { | |
| $tco_done = true; | |
| return Data_Maybe.Nothing.value; | |
| }; | |
| if (v instanceof Data_List_Types.Cons) { | |
| if (v.value0 instanceof Leaf) { | |
| $copy_v = v.value1; | |
| return; | |
| }; | |
| if (v.value0 instanceof Two && (v.value0.value0 instanceof Leaf && v.value0.value3 instanceof Leaf)) { | |
| $tco_done = true; | |
| return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), v.value1)); | |
| }; | |
| if (v.value0 instanceof Two && v.value0.value0 instanceof Leaf) { | |
| $tco_done = true; | |
| return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), new Data_List_Types.Cons(v.value0.value3, v.value1))); | |
| }; | |
| if (v.value0 instanceof Two) { | |
| $copy_v = new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(singleton(v.value0.value1)(v.value0.value2), new Data_List_Types.Cons(v.value0.value3, v.value1))); | |
| return; | |
| }; | |
| if (v.value0 instanceof Three) { | |
| $copy_v = new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(singleton(v.value0.value1)(v.value0.value2), new Data_List_Types.Cons(v.value0.value3, new Data_List_Types.Cons(singleton(v.value0.value4)(v.value0.value5), new Data_List_Types.Cons(v.value0.value6, v.value1))))); | |
| return; | |
| }; | |
| throw new Error("Failed pattern match at Data.Map.Internal line 567, column 18 - line 576, column 71: " + [ v.value0.constructor.name ]); | |
| }; | |
| throw new Error("Failed pattern match at Data.Map.Internal line 566, column 3 - line 566, column 19: " + [ v.constructor.name ]); | |
| }; | |
| while (!$tco_done) { | |
| $tco_result = $tco_loop($copy_v); | |
| }; | |
| return $tco_result; | |
| }; | |
| return Data_Unfoldable.unfoldr(dictUnfoldable)(go)(new Data_List_Types.Cons(m, Data_List_Types.Nil.value)); | |
| }; | |
| }; | |
| var toAscArray = toUnfoldable(Data_Unfoldable.unfoldableArray); | |
| var showMap = function (dictShow) { | |
| return function (dictShow1) { | |
| return new Data_Show.Show(function (m) { | |
| return "(fromFoldable " + (Data_Show.show(Data_Show.showArray(Data_Tuple.showTuple(dictShow)(dictShow1)))(toAscArray(m)) + ")"); | |
| }); | |
| }; | |
| }; | |
| 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 empty = Leaf.value; | |
| var fromFoldable = function (dictOrd) { | |
| return function (dictFoldable) { | |
| return Data_Foldable.foldl(dictFoldable)(function (m) { | |
| return function (v) { | |
| return insert(dictOrd)(v.value0)(v.value1)(m); | |
| }; | |
| })(empty); | |
| }; | |
| }; | |
| exports["empty"] = empty; | |
| exports["singleton"] = singleton; | |
| exports["insert"] = insert; | |
| exports["fromFoldable"] = fromFoldable; | |
| exports["toUnfoldable"] = toUnfoldable; | |
| exports["showMap"] = showMap; | |
| })(PS["Data.Map.Internal"] = PS["Data.Map.Internal"] || {}); | |
| (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.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; | |
| }; | |
| })(PS["Data.Array"] = PS["Data.Array"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 some = function (dictAlternative) { | |
| return function (dictLazy) { | |
| return function (v) { | |
| return Control_Apply.apply((dictAlternative.Applicative0()).Apply0())(Data_Functor.map(((dictAlternative.Plus1()).Alt0()).Functor0())($foreign.cons)(v))(Control_Lazy.defer(dictLazy)(function (v1) { | |
| return many(dictAlternative)(dictLazy)(v); | |
| })); | |
| }; | |
| }; | |
| }; | |
| var many = function (dictAlternative) { | |
| return function (dictLazy) { | |
| return function (v) { | |
| return Control_Alt.alt((dictAlternative.Plus1()).Alt0())(some(dictAlternative)(dictLazy)(v))(Control_Applicative.pure(dictAlternative.Applicative0())([ ])); | |
| }; | |
| }; | |
| }; | |
| exports["some"] = some; | |
| exports["many"] = many; | |
| exports["length"] = $foreign.length; | |
| })(PS["Data.Array"] = PS["Data.Array"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.fromCharArray = function (a) { | |
| return a.join(""); | |
| }; | |
| exports.toCharArray = function (s) { | |
| return s.split(""); | |
| }; | |
| exports.singleton = function (c) { | |
| return c; | |
| }; | |
| exports._charAt = function (just) { | |
| return function (nothing) { | |
| return function (i) { | |
| return function (s) { | |
| return i >= 0 && i < s.length ? just(s.charAt(i)) : nothing; | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports.length = function (s) { | |
| return s.length; | |
| }; | |
| exports._indexOf = function (just) { | |
| return function (nothing) { | |
| return function (x) { | |
| return function (s) { | |
| var i = s.indexOf(x); | |
| return i === -1 ? nothing : just(i); | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports.take = function (n) { | |
| return function (s) { | |
| return s.substr(0, n); | |
| }; | |
| }; | |
| exports.drop = function (n) { | |
| return function (s) { | |
| return s.substring(n); | |
| }; | |
| }; | |
| })(PS["Data.String.CodeUnits"] = PS["Data.String.CodeUnits"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 Pattern = function (x) { | |
| return x; | |
| }; | |
| var newtypePattern = new Data_Newtype.Newtype(function (n) { | |
| return n; | |
| }, Pattern); | |
| exports["Pattern"] = Pattern; | |
| exports["newtypePattern"] = newtypePattern; | |
| })(PS["Data.String.Pattern"] = PS["Data.String.Pattern"] || {}); | |
| (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.1 | |
| "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.1 | |
| "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"]; | |
| var uncons = function (v) { | |
| if (v === "") { | |
| return Data_Maybe.Nothing.value; | |
| }; | |
| return new Data_Maybe.Just({ | |
| head: Data_String_Unsafe.charAt(0)(v), | |
| tail: $foreign.drop(1)(v) | |
| }); | |
| }; | |
| var indexOf = $foreign._indexOf(Data_Maybe.Just.create)(Data_Maybe.Nothing.value); | |
| var charAt = $foreign._charAt(Data_Maybe.Just.create)(Data_Maybe.Nothing.value); | |
| exports["charAt"] = charAt; | |
| exports["uncons"] = uncons; | |
| exports["indexOf"] = indexOf; | |
| exports["singleton"] = $foreign.singleton; | |
| exports["fromCharArray"] = $foreign.fromCharArray; | |
| exports["toCharArray"] = $foreign.toCharArray; | |
| exports["length"] = $foreign.length; | |
| exports["take"] = $foreign.take; | |
| exports["drop"] = $foreign.drop; | |
| })(PS["Data.String.CodeUnits"] = PS["Data.String.CodeUnits"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "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_Lazy = PS["Control.Lazy"]; | |
| 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_Function = PS["Data.Function"]; | |
| var Data_Functor = PS["Data.Functor"]; | |
| var Data_Newtype = PS["Data.Newtype"]; | |
| var Data_Tuple = PS["Data.Tuple"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect_Class = PS["Effect.Class"]; | |
| var Prelude = PS["Prelude"]; | |
| var StateT = function (x) { | |
| return x; | |
| }; | |
| var runStateT = function (v) { | |
| return v; | |
| }; | |
| var lazyStateT = new Control_Lazy.Lazy(function (f) { | |
| return function (s) { | |
| var v = f(Data_Unit.unit); | |
| return v(s); | |
| }; | |
| }); | |
| var functorStateT = function (dictFunctor) { | |
| return new Data_Functor.Functor(function (f) { | |
| return function (v) { | |
| return function (s) { | |
| return Data_Functor.map(dictFunctor)(function (v1) { | |
| return new Data_Tuple.Tuple(f(v1.value0), v1.value1); | |
| })(v(s)); | |
| }; | |
| }; | |
| }); | |
| }; | |
| var evalStateT = function (dictFunctor) { | |
| return function (v) { | |
| return function (s) { | |
| return Data_Functor.map(dictFunctor)(Data_Tuple.fst)(v(s)); | |
| }; | |
| }; | |
| }; | |
| var monadStateT = function (dictMonad) { | |
| return new Control_Monad.Monad(function () { | |
| return applicativeStateT(dictMonad); | |
| }, function () { | |
| return bindStateT(dictMonad); | |
| }); | |
| }; | |
| var bindStateT = function (dictMonad) { | |
| return new Control_Bind.Bind(function () { | |
| return applyStateT(dictMonad); | |
| }, function (v) { | |
| return function (f) { | |
| return function (s) { | |
| return Control_Bind.bind(dictMonad.Bind1())(v(s))(function (v1) { | |
| var v3 = f(v1.value0); | |
| return v3(v1.value1); | |
| }); | |
| }; | |
| }; | |
| }); | |
| }; | |
| var applyStateT = function (dictMonad) { | |
| return new Control_Apply.Apply(function () { | |
| return functorStateT(((dictMonad.Bind1()).Apply0()).Functor0()); | |
| }, Control_Monad.ap(monadStateT(dictMonad))); | |
| }; | |
| var applicativeStateT = function (dictMonad) { | |
| return new Control_Applicative.Applicative(function () { | |
| return applyStateT(dictMonad); | |
| }, function (a) { | |
| return function (s) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(a, s)); | |
| }; | |
| }); | |
| }; | |
| var monadStateStateT = function (dictMonad) { | |
| return new Control_Monad_State_Class.MonadState(function () { | |
| return monadStateT(dictMonad); | |
| }, function (f) { | |
| return StateT(function ($111) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(f($111)); | |
| }); | |
| }); | |
| }; | |
| exports["StateT"] = StateT; | |
| exports["runStateT"] = runStateT; | |
| exports["evalStateT"] = evalStateT; | |
| exports["functorStateT"] = functorStateT; | |
| exports["applyStateT"] = applyStateT; | |
| exports["applicativeStateT"] = applicativeStateT; | |
| exports["bindStateT"] = bindStateT; | |
| exports["monadStateT"] = monadStateT; | |
| exports["lazyStateT"] = lazyStateT; | |
| exports["monadStateStateT"] = monadStateStateT; | |
| })(PS["Control.Monad.State.Trans"] = PS["Control.Monad.State.Trans"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.split = function (sep) { | |
| return function (s) { | |
| return s.split(sep); | |
| }; | |
| }; | |
| })(PS["Data.String.Common"] = PS["Data.String.Common"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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["split"] = $foreign.split; | |
| })(PS["Data.String.Common"] = PS["Data.String.Common"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Data_Eq = PS["Data.Eq"]; | |
| var Data_EuclideanRing = PS["Data.EuclideanRing"]; | |
| var Data_Foldable = PS["Data.Foldable"]; | |
| var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"]; | |
| 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_String = PS["Data.String"]; | |
| var Data_String_Common = PS["Data.String.Common"]; | |
| var Data_String_Pattern = PS["Data.String.Pattern"]; | |
| var Prelude = PS["Prelude"]; | |
| var updatePosString = function (pos$prime) { | |
| return function (str) { | |
| var updatePosChar = function (v) { | |
| return function (c) { | |
| if (c === "\x0a") { | |
| return { | |
| line: v.line + 1 | 0, | |
| column: 1 | |
| }; | |
| }; | |
| if (c === "\x0d") { | |
| return { | |
| line: v.line + 1 | 0, | |
| column: 1 | |
| }; | |
| }; | |
| if (c === "\x09") { | |
| return { | |
| line: v.line, | |
| column: (v.column + 8 | 0) - Data_EuclideanRing.mod(Data_EuclideanRing.euclideanRingInt)(v.column - 1 | 0)(8) | 0 | |
| }; | |
| }; | |
| return { | |
| line: v.line, | |
| column: v.column + 1 | 0 | |
| }; | |
| }; | |
| }; | |
| return Data_Foldable.foldl(Data_Foldable.foldableArray)(updatePosChar)(pos$prime)(Data_String_Common.split(Data_Newtype.wrap(Data_String_Pattern.newtypePattern)(""))(str)); | |
| }; | |
| }; | |
| var showPosition = new Data_Show.Show(function (v) { | |
| return "(Position { line: " + (Data_Show.show(Data_Show.showInt)(v.line) + (", column: " + (Data_Show.show(Data_Show.showInt)(v.column) + " })"))); | |
| }); | |
| var initialPos = { | |
| line: 1, | |
| column: 1 | |
| }; | |
| exports["initialPos"] = initialPos; | |
| exports["updatePosString"] = updatePosString; | |
| exports["showPosition"] = showPosition; | |
| })(PS["Text.Parsing.Parser.Pos"] = PS["Text.Parsing.Parser.Pos"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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_Lazy = PS["Control.Lazy"]; | |
| var Control_Monad = PS["Control.Monad"]; | |
| 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_Monad_Rec_Class = PS["Control.Monad.Rec.Class"]; | |
| var Control_Monad_State = PS["Control.Monad.State"]; | |
| var Control_Monad_State_Class = PS["Control.Monad.State.Class"]; | |
| var Control_Monad_State_Trans = PS["Control.Monad.State.Trans"]; | |
| 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_Either = PS["Data.Either"]; | |
| var Data_Eq = PS["Data.Eq"]; | |
| var Data_Functor = PS["Data.Functor"]; | |
| var Data_HeytingAlgebra = PS["Data.HeytingAlgebra"]; | |
| var Data_Identity = PS["Data.Identity"]; | |
| 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_Semigroup = PS["Data.Semigroup"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Data_Tuple = PS["Data.Tuple"]; | |
| var Prelude = PS["Prelude"]; | |
| var Text_Parsing_Parser_Pos = PS["Text.Parsing.Parser.Pos"]; | |
| var ParseState = (function () { | |
| function ParseState(value0, value1, value2) { | |
| this.value0 = value0; | |
| this.value1 = value1; | |
| this.value2 = value2; | |
| }; | |
| ParseState.create = function (value0) { | |
| return function (value1) { | |
| return function (value2) { | |
| return new ParseState(value0, value1, value2); | |
| }; | |
| }; | |
| }; | |
| return ParseState; | |
| })(); | |
| var ParseError = (function () { | |
| function ParseError(value0, value1) { | |
| this.value0 = value0; | |
| this.value1 = value1; | |
| }; | |
| ParseError.create = function (value0) { | |
| return function (value1) { | |
| return new ParseError(value0, value1); | |
| }; | |
| }; | |
| return ParseError; | |
| })(); | |
| var ParserT = function (x) { | |
| return x; | |
| }; | |
| var showParseError = new Data_Show.Show(function (v) { | |
| return "(ParseError " + (Data_Show.show(Data_Show.showString)(v.value0) + (" " + (Data_Show.show(Text_Parsing_Parser_Pos.showPosition)(v.value1) + ")"))); | |
| }); | |
| var newtypeParserT = new Data_Newtype.Newtype(function (n) { | |
| return n; | |
| }, ParserT); | |
| var runParserT = function (dictMonad) { | |
| return function (s) { | |
| return function (p) { | |
| var initialState = new ParseState(s, Text_Parsing_Parser_Pos.initialPos, false); | |
| return Control_Monad_State_Trans.evalStateT(((dictMonad.Bind1()).Apply0()).Functor0())(Control_Monad_Except_Trans.runExceptT(Data_Newtype.unwrap(newtypeParserT)(p)))(initialState); | |
| }; | |
| }; | |
| }; | |
| var runParser = function (s) { | |
| return function ($90) { | |
| return Data_Newtype.unwrap(Data_Identity.newtypeIdentity)(runParserT(Data_Identity.monadIdentity)(s)($90)); | |
| }; | |
| }; | |
| var monadThrowParserT = function (dictMonad) { | |
| return Control_Monad_Except_Trans.monadThrowExceptT(Control_Monad_State_Trans.monadStateT(dictMonad)); | |
| }; | |
| var monadStateParserT = function (dictMonad) { | |
| return Control_Monad_Except_Trans.monadStateExceptT(Control_Monad_State_Trans.monadStateStateT(dictMonad)); | |
| }; | |
| var position = function (dictMonad) { | |
| return Control_Monad_State_Class.gets(monadStateParserT(dictMonad))(function (v) { | |
| return v.value1; | |
| }); | |
| }; | |
| var lazyParserT = new Control_Lazy.Lazy(function (f) { | |
| return Control_Lazy.defer(Control_Monad_State_Trans.lazyStateT)(function ($93) { | |
| return Control_Monad_Except_Trans.runExceptT(Data_Newtype.unwrap(newtypeParserT)(f($93))); | |
| }); | |
| }); | |
| var functorParserT = function (dictFunctor) { | |
| return Control_Monad_Except_Trans.functorExceptT(Control_Monad_State_Trans.functorStateT(dictFunctor)); | |
| }; | |
| var failWithPosition = function (dictMonad) { | |
| return function (message) { | |
| return function (pos) { | |
| return Control_Monad_Error_Class.throwError(monadThrowParserT(dictMonad))(new ParseError(message, pos)); | |
| }; | |
| }; | |
| }; | |
| var bindParserT = function (dictMonad) { | |
| return Control_Monad_Except_Trans.bindExceptT(Control_Monad_State_Trans.monadStateT(dictMonad)); | |
| }; | |
| var fail = function (dictMonad) { | |
| return function (message) { | |
| return Control_Bind.bindFlipped(bindParserT(dictMonad))(failWithPosition(dictMonad)(message))(position(dictMonad)); | |
| }; | |
| }; | |
| var applyParserT = function (dictMonad) { | |
| return Control_Monad_Except_Trans.applyExceptT(Control_Monad_State_Trans.monadStateT(dictMonad)); | |
| }; | |
| var applicativeParserT = function (dictMonad) { | |
| return Control_Monad_Except_Trans.applicativeExceptT(Control_Monad_State_Trans.monadStateT(dictMonad)); | |
| }; | |
| var altParserT = function (dictMonad) { | |
| return new Control_Alt.Alt(function () { | |
| return functorParserT(((dictMonad.Bind1()).Apply0()).Functor0()); | |
| }, function (p1) { | |
| return function (p2) { | |
| return ParserT(Control_Monad_Except_Trans.ExceptT(Control_Monad_State_Trans.StateT(function (v) { | |
| return Control_Bind.bind(dictMonad.Bind1())(Control_Monad_State_Trans.runStateT(Control_Monad_Except_Trans.runExceptT(Data_Newtype.unwrap(newtypeParserT)(p1)))(new ParseState(v.value0, v.value1, false)))(function (v1) { | |
| if (v1.value0 instanceof Data_Either.Left && !v1.value1.value2) { | |
| return Control_Monad_State_Trans.runStateT(Control_Monad_Except_Trans.runExceptT(Data_Newtype.unwrap(newtypeParserT)(p2)))(v); | |
| }; | |
| return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(v1.value0, v1.value1)); | |
| }); | |
| }))); | |
| }; | |
| }); | |
| }; | |
| var plusParserT = function (dictMonad) { | |
| return new Control_Plus.Plus(function () { | |
| return altParserT(dictMonad); | |
| }, fail(dictMonad)("No alternative")); | |
| }; | |
| var alternativeParserT = function (dictMonad) { | |
| return new Control_Alternative.Alternative(function () { | |
| return applicativeParserT(dictMonad); | |
| }, function () { | |
| return plusParserT(dictMonad); | |
| }); | |
| }; | |
| exports["ParseError"] = ParseError; | |
| exports["ParseState"] = ParseState; | |
| exports["ParserT"] = ParserT; | |
| exports["runParser"] = runParser; | |
| exports["runParserT"] = runParserT; | |
| exports["position"] = position; | |
| exports["fail"] = fail; | |
| exports["failWithPosition"] = failWithPosition; | |
| exports["showParseError"] = showParseError; | |
| exports["newtypeParserT"] = newtypeParserT; | |
| exports["lazyParserT"] = lazyParserT; | |
| exports["functorParserT"] = functorParserT; | |
| exports["applyParserT"] = applyParserT; | |
| exports["applicativeParserT"] = applicativeParserT; | |
| exports["bindParserT"] = bindParserT; | |
| exports["monadStateParserT"] = monadStateParserT; | |
| exports["monadThrowParserT"] = monadThrowParserT; | |
| exports["altParserT"] = altParserT; | |
| exports["plusParserT"] = plusParserT; | |
| exports["alternativeParserT"] = alternativeParserT; | |
| })(PS["Text.Parsing.Parser"] = PS["Text.Parsing.Parser"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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_Monad_Except = PS["Control.Monad.Except"]; | |
| var Control_Monad_Except_Trans = PS["Control.Monad.Except.Trans"]; | |
| var Control_Monad_State = PS["Control.Monad.State"]; | |
| var Control_Monad_State_Trans = PS["Control.Monad.State.Trans"]; | |
| 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_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_Semigroup = PS["Data.Semigroup"]; | |
| var Data_Tuple = PS["Data.Tuple"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Prelude = PS["Prelude"]; | |
| var Text_Parsing_Parser = PS["Text.Parsing.Parser"]; | |
| var tryRethrow = function (dictMonad) { | |
| return function (p) { | |
| return Text_Parsing_Parser.ParserT(Control_Monad_Except_Trans.ExceptT(Control_Monad_State_Trans.StateT(function (v) { | |
| return Control_Bind.bind(dictMonad.Bind1())(Control_Monad_State_Trans.runStateT(Control_Monad_Except_Trans.runExceptT(Data_Newtype.unwrap(Text_Parsing_Parser.newtypeParserT)(p)))(v))(function (v1) { | |
| if (v1.value0 instanceof Data_Either.Left) { | |
| return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(new Data_Either.Left(new Text_Parsing_Parser.ParseError(v1.value0.value0.value0, v.value1)), new Text_Parsing_Parser.ParseState(v1.value1.value0, v1.value1.value1, v.value2))); | |
| }; | |
| return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(v1.value0, v1.value1)); | |
| }); | |
| }))); | |
| }; | |
| }; | |
| var sepEndBy1 = function (dictMonad) { | |
| return function (p) { | |
| return function (sep) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(p)(function (v) { | |
| return Control_Alt.alt(Text_Parsing_Parser.altParserT(dictMonad))(Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(sep)(function (v1) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(sepEndBy(dictMonad)(p)(sep))(function (v2) { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(new Data_List_Types.Cons(v, v2)); | |
| }); | |
| }))(Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(Data_List.singleton(v))); | |
| }); | |
| }; | |
| }; | |
| }; | |
| var sepEndBy = function (dictMonad) { | |
| return function (p) { | |
| return function (sep) { | |
| return Control_Alt.alt(Text_Parsing_Parser.altParserT(dictMonad))(sepEndBy1(dictMonad)(p)(sep))(Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(Data_List_Types.Nil.value)); | |
| }; | |
| }; | |
| }; | |
| var sepBy1 = function (dictMonad) { | |
| return function (p) { | |
| return function (sep) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(p)(function (v) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(Data_List.many(Text_Parsing_Parser.alternativeParserT(dictMonad))(Text_Parsing_Parser.lazyParserT)(Control_Apply.applySecond(Text_Parsing_Parser.applyParserT(dictMonad))(sep)(p)))(function (v1) { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(new Data_List_Types.Cons(v, v1)); | |
| }); | |
| }); | |
| }; | |
| }; | |
| }; | |
| var between = function (dictMonad) { | |
| return function (open) { | |
| return function (close) { | |
| return function (p) { | |
| return Control_Apply.applyFirst(Text_Parsing_Parser.applyParserT(dictMonad))(Control_Apply.applySecond(Text_Parsing_Parser.applyParserT(dictMonad))(open)(p))(close); | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports["between"] = between; | |
| exports["tryRethrow"] = tryRethrow; | |
| exports["sepBy1"] = sepBy1; | |
| exports["sepEndBy"] = sepEndBy; | |
| exports["sepEndBy1"] = sepEndBy1; | |
| })(PS["Text.Parsing.Parser.Combinators"] = PS["Text.Parsing.Parser.Combinators"] || {}); | |
| (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) { | |
| "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.1 | |
| "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.1 | |
| "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 indexOf = function (p) { | |
| return function (s) { | |
| return Data_Functor.map(Data_Maybe.functorMaybe)(function (i) { | |
| return length(Data_String_CodeUnits.take(i)(s)); | |
| })(Data_String_CodeUnits.indexOf(p)(s)); | |
| }; | |
| }; | |
| 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["indexOf"] = indexOf; | |
| exports["take"] = take; | |
| exports["drop"] = drop; | |
| })(PS["Data.String.CodePoints"] = PS["Data.String.CodePoints"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Control_Monad_State = PS["Control.Monad.State"]; | |
| var Control_Monad_State_Class = PS["Control.Monad.State.Class"]; | |
| 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_Newtype = PS["Data.Newtype"]; | |
| 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_CodeUnits = PS["Data.String.CodeUnits"]; | |
| var Data_String_Common = PS["Data.String.Common"]; | |
| var Data_String_Pattern = PS["Data.String.Pattern"]; | |
| var Prelude = PS["Prelude"]; | |
| var Text_Parsing_Parser = PS["Text.Parsing.Parser"]; | |
| var Text_Parsing_Parser_Combinators = PS["Text.Parsing.Parser.Combinators"]; | |
| var Text_Parsing_Parser_Pos = PS["Text.Parsing.Parser.Pos"]; | |
| var StringLike = function (drop, indexOf, $$null, uncons) { | |
| this.drop = drop; | |
| this.indexOf = indexOf; | |
| this["null"] = $$null; | |
| this.uncons = uncons; | |
| }; | |
| var uncons = function (dict) { | |
| return dict.uncons; | |
| }; | |
| var stringLikeString = new StringLike(Data_String_CodePoints.drop, Data_String_CodePoints.indexOf, Data_String_Common["null"], Data_String_CodeUnits.uncons); | |
| var $$null = function (dict) { | |
| return dict["null"]; | |
| }; | |
| var indexOf = function (dict) { | |
| return dict.indexOf; | |
| }; | |
| var eof = function (dictStringLike) { | |
| return function (dictMonad) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(Control_Monad_State_Class.gets(Text_Parsing_Parser.monadStateParserT(dictMonad))(function (v) { | |
| return v.value0; | |
| }))(function (v) { | |
| return Control_Applicative.unless(Text_Parsing_Parser.applicativeParserT(dictMonad))($$null(dictStringLike)(v))(Text_Parsing_Parser.fail(dictMonad)("Expected EOF")); | |
| }); | |
| }; | |
| }; | |
| var drop = function (dict) { | |
| return dict.drop; | |
| }; | |
| var string = function (dictStringLike) { | |
| return function (dictMonad) { | |
| return function (str) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(Control_Monad_State_Class.gets(Text_Parsing_Parser.monadStateParserT(dictMonad))(function (v) { | |
| return v.value0; | |
| }))(function (v) { | |
| var v1 = indexOf(dictStringLike)(Data_Newtype.wrap(Data_String_Pattern.newtypePattern)(str))(v); | |
| if (v1 instanceof Data_Maybe.Just && v1.value0 === 0) { | |
| return Control_Bind.discard(Control_Bind.discardUnit)(Text_Parsing_Parser.bindParserT(dictMonad))(Control_Monad_State_Class.modify_(Text_Parsing_Parser.monadStateParserT(dictMonad))(function (v2) { | |
| return new Text_Parsing_Parser.ParseState(drop(dictStringLike)(Data_String_CodePoints.length(str))(v), Text_Parsing_Parser_Pos.updatePosString(v2.value1)(str), true); | |
| }))(function () { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(str); | |
| }); | |
| }; | |
| return Text_Parsing_Parser.fail(dictMonad)("Expected " + Data_Show.show(Data_Show.showString)(str)); | |
| }); | |
| }; | |
| }; | |
| }; | |
| var anyChar = function (dictStringLike) { | |
| return function (dictMonad) { | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(Control_Monad_State_Class.gets(Text_Parsing_Parser.monadStateParserT(dictMonad))(function (v) { | |
| return v.value0; | |
| }))(function (v) { | |
| var v1 = uncons(dictStringLike)(v); | |
| if (v1 instanceof Data_Maybe.Nothing) { | |
| return Text_Parsing_Parser.fail(dictMonad)("Unexpected EOF"); | |
| }; | |
| if (v1 instanceof Data_Maybe.Just) { | |
| return Control_Bind.discard(Control_Bind.discardUnit)(Text_Parsing_Parser.bindParserT(dictMonad))(Control_Monad_State_Class.modify_(Text_Parsing_Parser.monadStateParserT(dictMonad))(function (v2) { | |
| return new Text_Parsing_Parser.ParseState(v1.value0.tail, Text_Parsing_Parser_Pos.updatePosString(v2.value1)(Data_String_CodeUnits.singleton(v1.value0.head)), true); | |
| }))(function () { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(v1.value0.head); | |
| }); | |
| }; | |
| throw new Error("Failed pattern match at Text.Parsing.Parser.String line 56, column 3 - line 63, column 16: " + [ v1.constructor.name ]); | |
| }); | |
| }; | |
| }; | |
| var satisfy = function (dictStringLike) { | |
| return function (dictMonad) { | |
| return function (f) { | |
| return Text_Parsing_Parser_Combinators.tryRethrow(dictMonad)(Control_Bind.bind(Text_Parsing_Parser.bindParserT(dictMonad))(anyChar(dictStringLike)(dictMonad))(function (v) { | |
| var $61 = f(v); | |
| if ($61) { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(dictMonad))(v); | |
| }; | |
| return Text_Parsing_Parser.fail(dictMonad)("Character '" + (Data_String_CodeUnits.singleton(v) + "' did not satisfy predicate")); | |
| })); | |
| }; | |
| }; | |
| }; | |
| exports["drop"] = drop; | |
| exports["indexOf"] = indexOf; | |
| exports["uncons"] = uncons; | |
| exports["StringLike"] = StringLike; | |
| exports["eof"] = eof; | |
| exports["string"] = string; | |
| exports["anyChar"] = anyChar; | |
| exports["satisfy"] = satisfy; | |
| exports["stringLikeString"] = stringLikeString; | |
| })(PS["Text.Parsing.Parser.String"] = PS["Text.Parsing.Parser.String"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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_Category = PS["Control.Category"]; | |
| 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_Identity = PS["Data.Identity"]; | |
| 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_Ord = PS["Data.Ord"]; | |
| var Data_Semigroup = PS["Data.Semigroup"]; | |
| var Data_String_CodeUnits = PS["Data.String.CodeUnits"]; | |
| var Prelude = PS["Prelude"]; | |
| var Text_Parsing_Parser = PS["Text.Parsing.Parser"]; | |
| var Text_Parsing_Parser_Combinators = PS["Text.Parsing.Parser.Combinators"]; | |
| var Text_Parsing_Parser_String = PS["Text.Parsing.Parser.String"]; | |
| var makeRow = function (s) { | |
| return function (f) { | |
| return Text_Parsing_Parser_Combinators.sepBy1(Data_Identity.monadIdentity)(f)(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(s)); | |
| }; | |
| }; | |
| var makeQuoted = function (q) { | |
| return Text_Parsing_Parser_Combinators.between(Data_Identity.monadIdentity)(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(q))(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(q)); | |
| }; | |
| var makeQchars = function (c) { | |
| var qchar = Text_Parsing_Parser_String.satisfy(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(function (c$prime) { | |
| return c$prime !== c; | |
| }); | |
| var escapedQuote = Data_Functor.voidLeft(Text_Parsing_Parser.functorParserT(Data_Identity.functorIdentity))(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(Data_String_CodeUnits.singleton(c) + Data_String_CodeUnits.singleton(c)))(c); | |
| return Data_Functor.map(Text_Parsing_Parser.functorParserT(Data_Identity.functorIdentity))(Data_String_CodeUnits.fromCharArray)(Data_Array.some(Text_Parsing_Parser.alternativeParserT(Data_Identity.monadIdentity))(Text_Parsing_Parser.lazyParserT)(Control_Alt.alt(Text_Parsing_Parser.altParserT(Data_Identity.monadIdentity))(qchar)(escapedQuote))); | |
| }; | |
| var makeFileHeaded = function (file) { | |
| var mkRow = function (header) { | |
| return function (row$prime) { | |
| return Data_Map_Internal.fromFoldable(Data_Ord.ordString)(Data_List_Types.foldableList)(Data_List.zip(header)(row$prime)); | |
| }; | |
| }; | |
| return Control_Bind.bind(Text_Parsing_Parser.bindParserT(Data_Identity.monadIdentity))(file)(function (v) { | |
| return Control_Applicative.pure(Text_Parsing_Parser.applicativeParserT(Data_Identity.monadIdentity))((function () { | |
| if (v instanceof Data_List_Types.Nil) { | |
| return Data_List_Types.Nil.value; | |
| }; | |
| if (v instanceof Data_List_Types.Cons) { | |
| return Data_Functor.map(Data_List_Types.functorList)(mkRow(v.value0))(v.value1); | |
| }; | |
| throw new Error("Failed pattern match at Text.Parsing.CSV line 57, column 10 - line 59, column 46: " + [ v.constructor.name ]); | |
| })()); | |
| }); | |
| }; | |
| var makeFile = function (s) { | |
| return function (r) { | |
| return Control_Apply.applyFirst(Text_Parsing_Parser.applyParserT(Data_Identity.monadIdentity))(Text_Parsing_Parser_Combinators.sepEndBy(Data_Identity.monadIdentity)(r)(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(s)))(Text_Parsing_Parser_String.eof(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)); | |
| }; | |
| }; | |
| var makeField = function (qoutes) { | |
| return function (qoutedChars) { | |
| return function (purechars) { | |
| return Control_Alt.alt(Text_Parsing_Parser.altParserT(Data_Identity.monadIdentity))(Control_Alt.alt(Text_Parsing_Parser.altParserT(Data_Identity.monadIdentity))(qoutes(qoutedChars))(purechars))(Text_Parsing_Parser_String.string(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)("")); | |
| }; | |
| }; | |
| }; | |
| var makeChars = function (xs) { | |
| var terms = function (ys) { | |
| return Data_Functor.map(Data_Functor.functorArray)(Data_Eq.notEq(Data_Eq.eqChar))(Data_String_CodeUnits.toCharArray(ys)); | |
| }; | |
| var excluded = function (ys) { | |
| return function (x) { | |
| return Data_Foldable.all(Data_Foldable.foldableArray)(Data_HeytingAlgebra.heytingAlgebraBoolean)(Control_Category.identity(Control_Category.categoryFn))(Control_Apply.apply(Control_Apply.applyArray)(terms(ys))([ x ])); | |
| }; | |
| }; | |
| var $$char = Text_Parsing_Parser_String.satisfy(Text_Parsing_Parser_String.stringLikeString)(Data_Identity.monadIdentity)(excluded(xs)); | |
| return Data_Functor.map(Text_Parsing_Parser.functorParserT(Data_Identity.functorIdentity))(Data_String_CodeUnits.fromCharArray)(Data_Array.some(Text_Parsing_Parser.alternativeParserT(Data_Identity.monadIdentity))(Text_Parsing_Parser.lazyParserT)($$char)); | |
| }; | |
| var makeParsers = function (quote) { | |
| return function (seperator) { | |
| return function (eol) { | |
| var quoted$prime = makeQuoted(Data_String_CodeUnits.singleton(quote)); | |
| var chars$prime = makeChars(Data_String_CodeUnits.singleton(quote) + (seperator + eol)); | |
| var qchars$prime = makeQchars(quote); | |
| var field$prime = makeField(quoted$prime)(qchars$prime)(chars$prime); | |
| var row$prime = makeRow(seperator)(field$prime); | |
| var file$prime = makeFile(eol)(row$prime); | |
| var fileHeaded$prime = makeFileHeaded(file$prime); | |
| return { | |
| quoted: quoted$prime, | |
| chars: chars$prime, | |
| qchars: qchars$prime, | |
| field: field$prime, | |
| row: row$prime, | |
| file: file$prime, | |
| fileHeaded: fileHeaded$prime | |
| }; | |
| }; | |
| }; | |
| }; | |
| exports["makeQuoted"] = makeQuoted; | |
| exports["makeChars"] = makeChars; | |
| exports["makeQchars"] = makeQchars; | |
| exports["makeField"] = makeField; | |
| exports["makeRow"] = makeRow; | |
| exports["makeFile"] = makeFile; | |
| exports["makeFileHeaded"] = makeFileHeaded; | |
| exports["makeParsers"] = makeParsers; | |
| })(PS["Text.Parsing.CSV"] = PS["Text.Parsing.CSV"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Data_Either = PS["Data.Either"]; | |
| var Data_List = PS["Data.List"]; | |
| var Data_Map = PS["Data.Map"]; | |
| var Text_Parsing_CSV = PS["Text.Parsing.CSV"]; | |
| var Text_Parsing_Parser = PS["Text.Parsing.Parser"]; | |
| var windowsCSVParsers = Text_Parsing_CSV.makeParsers("\"")(",")("\x0d\x0a"); | |
| var parseCSV = function (csv) { | |
| return Text_Parsing_Parser.runParser(csv)(windowsCSVParsers.fileHeaded); | |
| }; | |
| exports["parseCSV"] = parseCSV; | |
| exports["windowsCSVParsers"] = windowsCSVParsers; | |
| })(PS["Data.PCM"] = PS["Data.PCM"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Record_Unsafe = PS["Record.Unsafe"]; | |
| var setAttr = Record_Unsafe.unsafeSet; | |
| exports["setAttr"] = setAttr; | |
| })(PS["React.Util"] = PS["React.Util"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM = PS["React.Basic.DOM"]; | |
| var React_Basic_DOM_Generated = PS["React.Basic.DOM.Generated"]; | |
| var React_Basic_DOM_Internal = PS["React.Basic.DOM.Internal"]; | |
| var React_Util = PS["React.Util"]; | |
| var use = function (dictUnion) { | |
| return React_Basic.element(React_Basic_DOM_Internal.unsafeCreateDOMComponent("use")); | |
| }; | |
| var svgUpload = function (dictUnion) { | |
| return function (dictLacks) { | |
| return function ($7) { | |
| return React_Basic_DOM_Generated.svg(dictUnion)(React_Util.setAttr("aria-hidden")(true)($7)); | |
| }; | |
| }; | |
| }; | |
| var label_ = function (dictUnion) { | |
| return function (dictLacks) { | |
| return function (f) { | |
| return function (r) { | |
| return React_Basic_DOM_Generated.label(dictUnion)(React_Util.setAttr("htmlFor")(f)(React_Util.setAttr("aria-labelledby")("file-selector-primary-label file-selector-secondary-label")(r))); | |
| }; | |
| }; | |
| }; | |
| }; | |
| var input_ = function (dictUnion) { | |
| return function (dictLacks) { | |
| return function ($8) { | |
| return React_Basic_DOM_Generated.input(dictUnion)(React_Util.setAttr("aria-labelledby")("file-selector-primary-label file-selector-secondary-label")($8)); | |
| }; | |
| }; | |
| }; | |
| exports["input_"] = input_; | |
| exports["label_"] = label_; | |
| exports["svgUpload"] = svgUpload; | |
| exports["use"] = use; | |
| })(PS["DesignSystem.DOM"] = PS["DesignSystem.DOM"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.log = function (s) { | |
| return function () { | |
| console.log(s); | |
| return {}; | |
| }; | |
| }; | |
| })(PS["Effect.Console"] = PS["Effect.Console"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Effect.Console"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect = PS["Effect"]; | |
| var logShow = function (dictShow) { | |
| return function (a) { | |
| return $foreign.log(Data_Show.show(dictShow)(a)); | |
| }; | |
| }; | |
| exports["logShow"] = logShow; | |
| exports["log"] = $foreign.log; | |
| })(PS["Effect.Console"] = PS["Effect.Console"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.eventListener = function (fn) { | |
| return function () { | |
| return function (event) { | |
| return fn(event)(); | |
| }; | |
| }; | |
| }; | |
| exports.addEventListener = function (type) { | |
| return function (listener) { | |
| return function (useCapture) { | |
| return function (target) { | |
| return function () { | |
| return target.addEventListener(type, listener, useCapture); | |
| }; | |
| }; | |
| }; | |
| }; | |
| }; | |
| })(PS["Web.Event.EventTarget"] = PS["Web.Event.EventTarget"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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; | |
| exports["addEventListener"] = $foreign.addEventListener; | |
| })(PS["Web.Event.EventTarget"] = PS["Web.Event.EventTarget"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.File.File"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_MediaType = PS["Data.MediaType"]; | |
| var Prelude = PS["Prelude"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_File_Blob = PS["Web.File.Blob"]; | |
| var toBlob = Unsafe_Coerce.unsafeCoerce; | |
| exports["toBlob"] = toBlob; | |
| })(PS["Web.File.File"] = PS["Web.File.File"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports._item = function (index) { | |
| return function (fileList) { | |
| return fileList.item(index); | |
| }; | |
| }; | |
| })(PS["Web.File.FileList"] = PS["Web.File.FileList"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.File.FileList"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Nullable = PS["Data.Nullable"]; | |
| var Prelude = PS["Prelude"]; | |
| var Web_File_File = PS["Web.File.File"]; | |
| var item = function (i) { | |
| return function ($0) { | |
| return Data_Nullable.toMaybe($foreign._item(i)($0)); | |
| }; | |
| }; | |
| exports["item"] = item; | |
| })(PS["Web.File.FileList"] = PS["Web.File.FileList"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.unsafeFromForeign = function (value) { | |
| return 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.1 | |
| "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)); | |
| }; | |
| exports["singleton"] = singleton; | |
| })(PS["Data.List.NonEmpty"] = PS["Data.List.NonEmpty"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 ErrorAtIndex = (function () { | |
| function ErrorAtIndex(value0, value1) { | |
| this.value0 = value0; | |
| this.value1 = value1; | |
| }; | |
| ErrorAtIndex.create = function (value0) { | |
| return function (value1) { | |
| return new ErrorAtIndex(value0, value1); | |
| }; | |
| }; | |
| return ErrorAtIndex; | |
| })(); | |
| var ErrorAtProperty = (function () { | |
| function ErrorAtProperty(value0, value1) { | |
| this.value0 = value0; | |
| this.value1 = value1; | |
| }; | |
| ErrorAtProperty.create = function (value0) { | |
| return function (value1) { | |
| return new ErrorAtProperty(value0, value1); | |
| }; | |
| }; | |
| return ErrorAtProperty; | |
| })(); | |
| var showForeignError = new Data_Show.Show(function (v) { | |
| if (v instanceof ForeignError) { | |
| return "(ForeignError " + (Data_Show.show(Data_Show.showString)(v.value0) + ")"); | |
| }; | |
| if (v instanceof ErrorAtIndex) { | |
| return "(ErrorAtIndex " + (Data_Show.show(Data_Show.showInt)(v.value0) + (" " + (Data_Show.show(showForeignError)(v.value1) + ")"))); | |
| }; | |
| if (v instanceof ErrorAtProperty) { | |
| return "(ErrorAtProperty " + (Data_Show.show(Data_Show.showString)(v.value0) + (" " + (Data_Show.show(showForeignError)(v.value1) + ")"))); | |
| }; | |
| if (v instanceof TypeMismatch) { | |
| return "(TypeMismatch " + (Data_Show.show(Data_Show.showString)(v.value0) + (" " + (Data_Show.show(Data_Show.showString)(v.value1) + ")"))); | |
| }; | |
| throw new Error("Failed pattern match at Foreign line 63, column 1 - line 63, column 47: " + [ v.constructor.name ]); | |
| }); | |
| 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 readString = unsafeReadTagged("String"); | |
| exports["ForeignError"] = ForeignError; | |
| exports["TypeMismatch"] = TypeMismatch; | |
| exports["ErrorAtIndex"] = ErrorAtIndex; | |
| exports["ErrorAtProperty"] = ErrorAtProperty; | |
| exports["unsafeReadTagged"] = unsafeReadTagged; | |
| exports["readString"] = readString; | |
| exports["fail"] = fail; | |
| exports["showForeignError"] = showForeignError; | |
| })(PS["Foreign"] = PS["Foreign"] || {}); | |
| (function(exports) { | |
| /* global FileReader */ | |
| "use strict"; | |
| exports.fileReader = function () { return new FileReader(); }; | |
| exports.readyStateImpl = function (fr) { return function () { return fr.readyState; }; }; | |
| exports.result = function (fr) { return function () { return fr.result; }; }; | |
| exports.readAsText = function (blob) { | |
| return function (fr) { | |
| return function () { | |
| fr.readAsText(blob); | |
| }; | |
| }; | |
| }; | |
| })(PS["Web.File.FileReader"] = PS["Web.File.FileReader"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Data_Bounded = PS["Data.Bounded"]; | |
| var Data_Enum = PS["Data.Enum"]; | |
| var Data_Eq = PS["Data.Eq"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Ord = PS["Data.Ord"]; | |
| var Data_Ordering = PS["Data.Ordering"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Prelude = PS["Prelude"]; | |
| var EMPTY = (function () { | |
| function EMPTY() { | |
| }; | |
| EMPTY.value = new EMPTY(); | |
| return EMPTY; | |
| })(); | |
| var LOADING = (function () { | |
| function LOADING() { | |
| }; | |
| LOADING.value = new LOADING(); | |
| return LOADING; | |
| })(); | |
| var DONE = (function () { | |
| function DONE() { | |
| }; | |
| DONE.value = new DONE(); | |
| return DONE; | |
| })(); | |
| var toEnumReadyState = function (v) { | |
| if (v === 0) { | |
| return new Data_Maybe.Just(EMPTY.value); | |
| }; | |
| if (v === 1) { | |
| return new Data_Maybe.Just(LOADING.value); | |
| }; | |
| if (v === 2) { | |
| return new Data_Maybe.Just(DONE.value); | |
| }; | |
| return Data_Maybe.Nothing.value; | |
| }; | |
| var showReadyState = new Data_Show.Show(function (v) { | |
| if (v instanceof EMPTY) { | |
| return "EMPTY"; | |
| }; | |
| if (v instanceof LOADING) { | |
| return "LOADING"; | |
| }; | |
| if (v instanceof DONE) { | |
| return "DONE"; | |
| }; | |
| throw new Error("Failed pattern match at Web.File.FileReader.ReadyState line 28, column 1 - line 28, column 43: " + [ v.constructor.name ]); | |
| }); | |
| exports["EMPTY"] = EMPTY; | |
| exports["LOADING"] = LOADING; | |
| exports["DONE"] = DONE; | |
| exports["toEnumReadyState"] = toEnumReadyState; | |
| exports["showReadyState"] = showReadyState; | |
| })(PS["Web.File.FileReader.ReadyState"] = PS["Web.File.FileReader.ReadyState"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports._unsafeReadProtoTagged = function (nothing, just, name, value) { | |
| var ty = window[name]; | |
| if (ty != null && value instanceof ty) { | |
| return just(value); | |
| } | |
| return nothing; | |
| }; | |
| })(PS["Web.Internal.FFI"] = PS["Web.Internal.FFI"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.Internal.FFI"]; | |
| var Data_Function_Uncurried = PS["Data.Function.Uncurried"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var unsafeReadProtoTagged = function (name) { | |
| return function (value) { | |
| return $foreign._unsafeReadProtoTagged(Data_Maybe.Nothing.value, Data_Maybe.Just.create, name, value); | |
| }; | |
| }; | |
| exports["unsafeReadProtoTagged"] = unsafeReadProtoTagged; | |
| })(PS["Web.Internal.FFI"] = PS["Web.Internal.FFI"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.File.FileReader"]; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Effect = PS["Effect"]; | |
| var Foreign = PS["Foreign"]; | |
| var Partial_Unsafe = PS["Partial.Unsafe"]; | |
| var Prelude = PS["Prelude"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_Event_EventTarget = PS["Web.Event.EventTarget"]; | |
| var Web_File_Blob = PS["Web.File.Blob"]; | |
| var Web_File_FileReader_ReadyState = PS["Web.File.FileReader.ReadyState"]; | |
| var Web_Internal_FFI = PS["Web.Internal.FFI"]; | |
| var toEventTarget = Unsafe_Coerce.unsafeCoerce; | |
| var readyState = function (fr) { | |
| return function __do() { | |
| var v = $foreign.readyStateImpl(fr)(); | |
| return Data_Maybe.fromJust()(Web_File_FileReader_ReadyState.toEnumReadyState(v)); | |
| }; | |
| }; | |
| exports["toEventTarget"] = toEventTarget; | |
| exports["readyState"] = readyState; | |
| exports["fileReader"] = $foreign.fileReader; | |
| exports["result"] = $foreign.result; | |
| exports["readAsText"] = $foreign.readAsText; | |
| })(PS["Web.File.FileReader"] = PS["Web.File.FileReader"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Web_Event_Event = PS["Web.Event.Event"]; | |
| var load = "load"; | |
| var error = "error"; | |
| exports["error"] = error; | |
| exports["load"] = load; | |
| })(PS["Web.HTML.Event.EventTypes"] = PS["Web.HTML.Event.EventTypes"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Control_Monad_Except = PS["Control.Monad.Except"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_ArrayBuffer_Types = PS["Data.ArrayBuffer.Types"]; | |
| var Data_Either = PS["Data.Either"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_List_Types = PS["Data.List.Types"]; | |
| var Data_Monoid = PS["Data.Monoid"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Aff = PS["Effect.Aff"]; | |
| var Effect_Exception = PS["Effect.Exception"]; | |
| var Foreign = PS["Foreign"]; | |
| var Prelude = PS["Prelude"]; | |
| var Web_Event_EventTarget = PS["Web.Event.EventTarget"]; | |
| var Web_File_Blob = PS["Web.File.Blob"]; | |
| var Web_File_FileReader = PS["Web.File.FileReader"]; | |
| var Web_File_FileReader_ReadyState = PS["Web.File.FileReader.ReadyState"]; | |
| var Web_HTML_Event_EventTypes = PS["Web.HTML.Event.EventTypes"]; | |
| var readAs = function (readMethod) { | |
| return function (getResult) { | |
| return function (sendReadyState) { | |
| return function (blob) { | |
| return Effect_Aff.makeAff(function (fun) { | |
| var succ = function ($13) { | |
| return fun(Data_Either.Right.create($13)); | |
| }; | |
| var err = function ($14) { | |
| return fun(Data_Either.Left.create($14)); | |
| }; | |
| return function __do() { | |
| var v = Web_File_FileReader.fileReader(); | |
| var v1 = Control_Bind.bindFlipped(Effect.bindEffect)(sendReadyState)(Web_File_FileReader.readyState(v))(); | |
| var et = Web_File_FileReader.toEventTarget(v); | |
| var v2 = Web_Event_EventTarget.eventListener(function (v2) { | |
| return err(Effect_Exception.error("error")); | |
| })(); | |
| var v3 = Web_Event_EventTarget.eventListener(function (v3) { | |
| return function __do() { | |
| var v4 = Control_Bind.bindFlipped(Effect.bindEffect)(sendReadyState)(Web_File_FileReader.readyState(v))(); | |
| var v5 = Web_File_FileReader.result(v)(); | |
| return Data_Either.either(function (errs) { | |
| return err(Effect_Exception.error(Data_Show.show(Data_List_Types.showNonEmptyList(Foreign.showForeignError))(errs))); | |
| })(succ)(Control_Monad_Except.runExcept(readMethod(v5)))(); | |
| }; | |
| })(); | |
| Web_Event_EventTarget.addEventListener(Web_HTML_Event_EventTypes.error)(v2)(false)(et)(); | |
| Web_Event_EventTarget.addEventListener(Web_HTML_Event_EventTypes.load)(v3)(false)(et)(); | |
| getResult(blob)(v)(); | |
| var v4 = Control_Bind.bindFlipped(Effect.bindEffect)(sendReadyState)(Web_File_FileReader.readyState(v))(); | |
| return Data_Monoid.mempty(Effect_Aff.monoidCanceler); | |
| }; | |
| }); | |
| }; | |
| }; | |
| }; | |
| }; | |
| var readAsText = readAs(Foreign.readString)(Web_File_FileReader.readAsText)(Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit))); | |
| var readAsText_ = readAs(Foreign.readString)(Web_File_FileReader.readAsText); | |
| exports["readAsText"] = readAsText; | |
| exports["readAsText_"] = readAsText_; | |
| })(PS["Web.File.FileReader.Aff"] = PS["Web.File.FileReader.Aff"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| // ---------------------------------------------------------------------------- | |
| exports._files = function (input) { | |
| return function () { | |
| return input.files; | |
| }; | |
| }; | |
| })(PS["Web.HTML.HTMLInputElement"] = PS["Web.HTML.HTMLInputElement"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.HTML.HTMLInputElement"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Functor = PS["Data.Functor"]; | |
| var Data_JSDate = PS["Data.JSDate"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Nullable = PS["Data.Nullable"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Uncurried = PS["Effect.Uncurried"]; | |
| var Prelude = PS["Prelude"]; | |
| var Unsafe_Coerce = PS["Unsafe.Coerce"]; | |
| var Web_DOM = PS["Web.DOM"]; | |
| var Web_DOM_NodeList = PS["Web.DOM.NodeList"]; | |
| var Web_Event_EventTarget = PS["Web.Event.EventTarget"]; | |
| var Web_File_FileList = PS["Web.File.FileList"]; | |
| var Web_HTML_HTMLElement = PS["Web.HTML.HTMLElement"]; | |
| var Web_HTML_HTMLFormElement = PS["Web.HTML.HTMLFormElement"]; | |
| var Web_HTML_SelectionMode = PS["Web.HTML.SelectionMode"]; | |
| var Web_HTML_ValidityState = PS["Web.HTML.ValidityState"]; | |
| var Web_Internal_FFI = PS["Web.Internal.FFI"]; | |
| var fromEventTarget = Web_Internal_FFI.unsafeReadProtoTagged("HTMLInputElement"); | |
| var files = function ($2) { | |
| return Data_Functor.map(Effect.functorEffect)(Data_Nullable.toMaybe)($foreign._files($2)); | |
| }; | |
| exports["fromEventTarget"] = fromEventTarget; | |
| exports["files"] = files; | |
| })(PS["Web.HTML.HTMLInputElement"] = PS["Web.HTML.HTMLInputElement"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Apply = PS["Control.Apply"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Control_Monad_Maybe_Trans = PS["Control.Monad.Maybe.Trans"]; | |
| var Control_Plus = PS["Control.Plus"]; | |
| 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_List_Types = PS["Data.List.Types"]; | |
| var Data_Map_Internal = PS["Data.Map.Internal"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_PCM = PS["Data.PCM"]; | |
| var Data_Semigroup = PS["Data.Semigroup"]; | |
| var Data_Show = PS["Data.Show"]; | |
| var Data_Time_Duration = PS["Data.Time.Duration"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var DesignSystem_Components = PS["DesignSystem.Components"]; | |
| var DesignSystem_Components_Internal = PS["DesignSystem.Components.Internal"]; | |
| var DesignSystem_DOM = PS["DesignSystem.DOM"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Aff = PS["Effect.Aff"]; | |
| var Effect_Class = PS["Effect.Class"]; | |
| var Effect_Console = PS["Effect.Console"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM = PS["React.Basic.DOM"]; | |
| var React_Basic_DOM_Events = PS["React.Basic.DOM.Events"]; | |
| var React_Basic_DOM_Generated = PS["React.Basic.DOM.Generated"]; | |
| var Text_Parsing_Parser = PS["Text.Parsing.Parser"]; | |
| var Web_Event_EventTarget = PS["Web.Event.EventTarget"]; | |
| var Web_File_File = PS["Web.File.File"]; | |
| var Web_File_FileList = PS["Web.File.FileList"]; | |
| var Web_File_FileReader_Aff = PS["Web.File.FileReader.Aff"]; | |
| var Web_File_FileReader_ReadyState = PS["Web.File.FileReader.ReadyState"]; | |
| var Web_HTML_HTMLInputElement = PS["Web.HTML.HTMLInputElement"]; | |
| var CancelFileInput = (function () { | |
| function CancelFileInput() { | |
| }; | |
| CancelFileInput.value = new CancelFileInput(); | |
| return CancelFileInput; | |
| })(); | |
| var FileReady = (function () { | |
| function FileReady() { | |
| }; | |
| FileReady.value = new FileReady(); | |
| return FileReady; | |
| })(); | |
| var FileInput = (function () { | |
| function FileInput(value0) { | |
| this.value0 = value0; | |
| }; | |
| FileInput.create = function (value0) { | |
| return new FileInput(value0); | |
| }; | |
| return FileInput; | |
| })(); | |
| var FileState = (function () { | |
| function FileState(value0) { | |
| this.value0 = value0; | |
| }; | |
| FileState.create = function (value0) { | |
| return new FileState(value0); | |
| }; | |
| return FileState; | |
| })(); | |
| var PCMRecords = (function () { | |
| function PCMRecords(value0) { | |
| this.value0 = value0; | |
| }; | |
| PCMRecords.create = function (value0) { | |
| return new PCMRecords(value0); | |
| }; | |
| return PCMRecords; | |
| })(); | |
| var ProcessFile = (function () { | |
| function ProcessFile(value0) { | |
| this.value0 = value0; | |
| }; | |
| ProcessFile.create = function (value0) { | |
| return new ProcessFile(value0); | |
| }; | |
| return ProcessFile; | |
| })(); | |
| var processFile = function (sendAction) { | |
| return function (file) { | |
| return Effect_Aff.launchAff_((function () { | |
| var blob = Web_File_File.toBlob(file); | |
| return Control_Bind.bind(Effect_Aff.bindAff)(Web_File_FileReader_Aff.readAsText_(function ($38) { | |
| return sendAction(FileState.create($38)); | |
| })(blob))(function (v) { | |
| return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(sendAction(PCMRecords.create(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Show.show(Text_Parsing_Parser.showParseError))(Data_PCM.parseCSV(v))))))(function (v1) { | |
| return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Effect_Console.logShow(Data_Either.showEither(Text_Parsing_Parser.showParseError)(Data_List_Types.showList(Data_Map_Internal.showMap(Data_Show.showString)(Data_Show.showString))))(Data_PCM.parseCSV(v))); | |
| }); | |
| }); | |
| })()); | |
| }; | |
| }; | |
| var onFileChange = function (sendFile) { | |
| return function (currentTarget) { | |
| return Effect_Aff.launchAff_(Control_Monad_Maybe_Trans.runMaybeT(Control_Bind.bind(Control_Monad_Maybe_Trans.bindMaybeT(Effect_Aff.monadAff))(Data_Maybe.maybe(Control_Plus.empty(Control_Monad_Maybe_Trans.plusMaybeT(Effect_Aff.monadAff)))(function ($39) { | |
| return Control_Monad_Maybe_Trans.MaybeT(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Web_HTML_HTMLInputElement.files($39))); | |
| })(Web_HTML_HTMLInputElement.fromEventTarget(currentTarget)))(function (v) { | |
| var mFile = Web_File_FileList.item(0)(v); | |
| return Effect_Class.liftEffect(Control_Monad_Maybe_Trans.monadEffectMaybe(Effect_Aff.monadEffectAff))(sendFile(mFile)); | |
| }))); | |
| }; | |
| }; | |
| var component = React_Basic.createComponent("FileUploader"); | |
| var fileUploader = (function () { | |
| var update = function (self) { | |
| return function (v) { | |
| if (v instanceof PCMRecords) { | |
| return new React_Basic.Update((function () { | |
| var $17 = {}; | |
| for (var $18 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $18)) { | |
| $17[$18] = self["state"][$18]; | |
| }; | |
| }; | |
| $17.pcmRecords = v.value0; | |
| return $17; | |
| })()); | |
| }; | |
| if (v instanceof CancelFileInput) { | |
| return new React_Basic.Update((function () { | |
| var $21 = {}; | |
| for (var $22 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $22)) { | |
| $21[$22] = self["state"][$22]; | |
| }; | |
| }; | |
| $21.fileReadyState = Web_File_FileReader_ReadyState.EMPTY.value; | |
| $21.file = Data_Maybe.Nothing.value; | |
| return $21; | |
| })()); | |
| }; | |
| if (v instanceof FileReady) { | |
| return React_Basic.UpdateAndSideEffects.create((function () { | |
| var $24 = {}; | |
| for (var $25 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $25)) { | |
| $24[$25] = self["state"][$25]; | |
| }; | |
| }; | |
| $24.fileReadyState = Web_File_FileReader_ReadyState.DONE.value; | |
| return $24; | |
| })())(function (v1) { | |
| return Data_Either.either(function (e) { | |
| return Control_Apply.applySecond(Effect.applyEffect)(self.props.onError(Data_Show.show(Data_Show.showString)(e)))(React_Basic.send(self)(CancelFileInput.value)); | |
| })(Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit)))(self.state.pcmRecords); | |
| }); | |
| }; | |
| if (v instanceof FileState) { | |
| if (v.value0 instanceof Web_File_FileReader_ReadyState.DONE) { | |
| return new React_Basic.SideEffects(function (v1) { | |
| return Effect_Aff.launchAff_(Control_Apply.applySecond(Effect_Aff.applyAff)(Effect_Aff.delay(2000.0))(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(React_Basic.send(self)(FileReady.value)))); | |
| }); | |
| }; | |
| return React_Basic.UpdateAndSideEffects.create((function () { | |
| var $28 = {}; | |
| for (var $29 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $29)) { | |
| $28[$29] = self["state"][$29]; | |
| }; | |
| }; | |
| $28.fileReadyState = v.value0; | |
| return $28; | |
| })())(function (v1) { | |
| return Effect_Console.log("ReadyState: " + Data_Show.show(Web_File_FileReader_ReadyState.showReadyState)(v.value0)); | |
| }); | |
| }; | |
| if (v instanceof FileInput) { | |
| return React_Basic.SideEffects.create(function (v1) { | |
| return onFileChange(function ($40) { | |
| return React_Basic.send(self)(ProcessFile.create($40)); | |
| })(v.value0); | |
| }); | |
| }; | |
| if (v instanceof ProcessFile) { | |
| var setFileState = function (b) { | |
| return function (f) { | |
| var $33 = {}; | |
| for (var $34 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $34)) { | |
| $33[$34] = self["state"][$34]; | |
| }; | |
| }; | |
| $33.file = f; | |
| return $33; | |
| }; | |
| }; | |
| var fileReadSuccess = function (f) { | |
| return React_Basic.UpdateAndSideEffects.create(setFileState(true)(v.value0))(function (v1) { | |
| return processFile(React_Basic.send(self))(f); | |
| }); | |
| }; | |
| var fileReadError = React_Basic.Update.create(setFileState(false)(Control_Plus.empty(Data_Maybe.plusMaybe))); | |
| return Data_Maybe.maybe(fileReadError)(fileReadSuccess)(v.value0); | |
| }; | |
| throw new Error("Failed pattern match at Component.FileUploader line 73, column 19 - line 100, column 52: " + [ v.constructor.name ]); | |
| }; | |
| }; | |
| var render = function (self) { | |
| if (self.state.fileReadyState instanceof Web_File_FileReader_ReadyState.LOADING) { | |
| return DesignSystem_Components_Internal.spinner()({ | |
| assistiveText: { | |
| label: "Loading..." | |
| }, | |
| variant: "brand", | |
| size: "large" | |
| }); | |
| }; | |
| if (self.state.fileReadyState instanceof Web_File_FileReader_ReadyState.DONE) { | |
| return React_Basic_DOM_Generated.div()({ | |
| children: [ React_Basic_DOM_Generated.p()({ | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM.text("12 records found")) | |
| }), DesignSystem_Components_Internal.button()({ | |
| label: "Create PCM Records", | |
| variant: "brand" | |
| }), DesignSystem_Components_Internal.button()({ | |
| label: "Cancel", | |
| onClick: React_Basic.capture_(self)(CancelFileInput.value) | |
| }) ] | |
| }); | |
| }; | |
| if (self.state.fileReadyState instanceof Web_File_FileReader_ReadyState.EMPTY) { | |
| return React_Basic_DOM_Generated.div()({ | |
| className: "slds-form-element", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM_Generated.div()({ | |
| className: "slds-form-element__control", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM_Generated.div()({ | |
| className: "slds-file-selector slds-file-selector_files", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM_Generated.div()({ | |
| className: "slds-file-selector__dropzone", | |
| children: [ DesignSystem_DOM.input_()()({ | |
| className: "slds-file-selector__input slds-assistive-text", | |
| accept: self.props.accept, | |
| type: self.props.type, | |
| id: self.props.id, | |
| onChange: React_Basic.capture(self)(React_Basic_DOM_Events.currentTarget)(FileInput.create) | |
| }), DesignSystem_DOM.label_()()("file-upload-input-01")({ | |
| className: "slds-file-selector__body", | |
| id: "file-selector-secondary-label", | |
| children: [ React_Basic_DOM_Generated.span()({ | |
| className: "slds-file-selector__button slds-button slds-button_neutral", | |
| children: [ DesignSystem_DOM.svgUpload()()({ | |
| className: "slds-button__icon slds-button__icon_left", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(DesignSystem_DOM.use()({ | |
| xlink: "http://www.w3.org/1999/xlink", | |
| xlinkHref: "/icons/utility-sprite/svg/symbols.svg#upload" | |
| })) | |
| }), React_Basic_DOM.text("Upload File") ] | |
| }), React_Basic_DOM_Generated.span()({ | |
| className: "slds-file-selector__text slds-medium-show", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM.text("Upload here")) | |
| }) ] | |
| }) ] | |
| })) | |
| })) | |
| })) | |
| }); | |
| }; | |
| throw new Error("Failed pattern match at Component.FileUploader line 102, column 20 - line 155, column 9: " + [ self.state.fileReadyState.constructor.name ]); | |
| }; | |
| var initialState = { | |
| inputLabel: "hello", | |
| file: Data_Maybe.Nothing.value, | |
| fileReadyState: Web_File_FileReader_ReadyState.EMPTY.value, | |
| pcmRecords: Control_Applicative.pure(Data_Either.applicativeEither)(Control_Plus.empty(Data_List_Types.plusList)) | |
| }; | |
| return React_Basic.make()(component)({ | |
| initialState: initialState, | |
| update: update, | |
| render: render | |
| }); | |
| })(); | |
| exports["component"] = component; | |
| exports["CancelFileInput"] = CancelFileInput; | |
| exports["FileReady"] = FileReady; | |
| exports["FileInput"] = FileInput; | |
| exports["FileState"] = FileState; | |
| exports["PCMRecords"] = PCMRecords; | |
| exports["ProcessFile"] = ProcessFile; | |
| exports["onFileChange"] = onFileChange; | |
| exports["processFile"] = processFile; | |
| exports["fileUploader"] = fileUploader; | |
| })(PS["Component.FileUploader"] = PS["Component.FileUploader"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var Component_Alert = PS["Component.Alert"]; | |
| var Component_FileUploader = PS["Component.FileUploader"]; | |
| var Control_Applicative = PS["Control.Applicative"]; | |
| var Control_Semigroupoid = PS["Control.Semigroupoid"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var DesignSystem_Components = PS["DesignSystem.Components"]; | |
| var DesignSystem_Components_Internal = PS["DesignSystem.Components.Internal"]; | |
| var Effect = PS["Effect"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic = PS["React.Basic"]; | |
| var React_Basic_DOM = PS["React.Basic.DOM"]; | |
| var React_Basic_DOM_Generated = PS["React.Basic.DOM.Generated"]; | |
| var DispatchAlert = (function () { | |
| function DispatchAlert(value0) { | |
| this.value0 = value0; | |
| }; | |
| DispatchAlert.create = function (value0) { | |
| return new DispatchAlert(value0); | |
| }; | |
| return DispatchAlert; | |
| })(); | |
| var CloseAlert = (function () { | |
| function CloseAlert() { | |
| }; | |
| CloseAlert.value = new CloseAlert(); | |
| return CloseAlert; | |
| })(); | |
| var pageHeader = DesignSystem_Components_Internal.iconSettings()({ | |
| iconPath: "/apexpages/slds/latest/assets/icons", | |
| children: [ DesignSystem_Components_Internal.pageHeader()({ | |
| iconAssistiveText: "Opportunity", | |
| iconCategory: "standard", | |
| iconName: "opportunity", | |
| label: React_Basic_DOM.text("PCM APP"), | |
| title: React_Basic_DOM.text("PCM Mass Uploader"), | |
| variant: "objectHome" | |
| }) ] | |
| }); | |
| var mainComtainer = function (onError) { | |
| return React_Basic_DOM_Generated.div()({ | |
| className: "main-container", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(React_Basic_DOM_Generated.div()({ | |
| className: "", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(Component_FileUploader.fileUploader({ | |
| type: "file", | |
| accept: ".csv", | |
| id: "file-upload-input-01", | |
| onError: onError | |
| })) | |
| })) | |
| }); | |
| }; | |
| var component = React_Basic.createComponent("AppContainer"); | |
| var app = (function () { | |
| var update = function (self) { | |
| return function (v) { | |
| if (v instanceof DispatchAlert) { | |
| return new React_Basic.Update((function () { | |
| var $4 = {}; | |
| for (var $5 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $5)) { | |
| $4[$5] = self["state"][$5]; | |
| }; | |
| }; | |
| $4.alertMsg = new Data_Maybe.Just(v.value0); | |
| $4.alertAction = Component_Alert.Open.value; | |
| $4.closeAlert = React_Basic.send(self)(CloseAlert.value); | |
| return $4; | |
| })()); | |
| }; | |
| if (v instanceof CloseAlert) { | |
| return new React_Basic.Update((function () { | |
| var $8 = {}; | |
| for (var $9 in self.state) { | |
| if ({}.hasOwnProperty.call(self.state, $9)) { | |
| $8[$9] = self["state"][$9]; | |
| }; | |
| }; | |
| $8.alertAction = Component_Alert.Close.value; | |
| return $8; | |
| })()); | |
| }; | |
| throw new Error("Failed pattern match at Component.App line 28, column 23 - line 31, column 73: " + [ v.constructor.name ]); | |
| }; | |
| }; | |
| var render = function (self) { | |
| return React_Basic_DOM_Generated.div()({ | |
| className: "slds-grid slds-grid_vertical", | |
| children: [ Component_Alert.alert(self.state), React_Basic_DOM_Generated.div()({ | |
| className: "slds-col", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(pageHeader) | |
| }), React_Basic_DOM_Generated.div()({ | |
| className: "slds-col", | |
| children: Control_Applicative.pure(Control_Applicative.applicativeArray)(mainComtainer(function ($11) { | |
| return React_Basic.send(self)(DispatchAlert.create($11)); | |
| })) | |
| }) ] | |
| }); | |
| }; | |
| var initialState = { | |
| alertMsg: Data_Maybe.Nothing.value, | |
| alertAction: Component_Alert.Close.value, | |
| closeAlert: Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit) | |
| }; | |
| return React_Basic.make()(component)({ | |
| initialState: initialState, | |
| update: update, | |
| render: render | |
| }); | |
| })(); | |
| exports["DispatchAlert"] = DispatchAlert; | |
| exports["CloseAlert"] = CloseAlert; | |
| exports["component"] = component; | |
| exports["app"] = app; | |
| exports["pageHeader"] = pageHeader; | |
| exports["mainComtainer"] = mainComtainer; | |
| })(PS["Component.App"] = PS["Component.App"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports._getElementById = function (id) { | |
| return function (node) { | |
| return function () { | |
| return node.getElementById(id); | |
| }; | |
| }; | |
| }; | |
| })(PS["Web.DOM.NonElementParentNode"] = PS["Web.DOM.NonElementParentNode"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "use strict"; | |
| var $foreign = PS["Web.DOM.NonElementParentNode"]; | |
| 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 Web_DOM_Element = PS["Web.DOM.Element"]; | |
| var getElementById = function (eid) { | |
| return function ($0) { | |
| return Data_Functor.map(Effect.functorEffect)(Data_Nullable.toMaybe)($foreign._getElementById(eid)($0)); | |
| }; | |
| }; | |
| exports["getElementById"] = getElementById; | |
| })(PS["Web.DOM.NonElementParentNode"] = PS["Web.DOM.NonElementParentNode"] || {}); | |
| (function(exports) { | |
| /* global window */ | |
| "use strict"; | |
| exports.window = function () { | |
| return window; | |
| }; | |
| })(PS["Web.HTML"] = PS["Web.HTML"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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 toNonElementParentNode = Unsafe_Coerce.unsafeCoerce; | |
| exports["toNonElementParentNode"] = toNonElementParentNode; | |
| })(PS["Web.HTML.HTMLDocument"] = PS["Web.HTML.HTMLDocument"] || {}); | |
| (function(exports) { | |
| "use strict"; | |
| exports.document = function (window) { | |
| return function () { | |
| return window.document; | |
| }; | |
| }; | |
| })(PS["Web.HTML.Window"] = PS["Web.HTML.Window"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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; | |
| })(PS["Web.HTML.Window"] = PS["Web.HTML.Window"] || {}); | |
| (function(exports) { | |
| // Generated by purs version 0.12.1 | |
| "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.1 | |
| "use strict"; | |
| var Component_App = PS["Component.App"]; | |
| var Control_Bind = PS["Control.Bind"]; | |
| var Data_Function = PS["Data.Function"]; | |
| var Data_Maybe = PS["Data.Maybe"]; | |
| var Data_Unit = PS["Data.Unit"]; | |
| var Effect = PS["Effect"]; | |
| var Effect_Exception = PS["Effect.Exception"]; | |
| var Prelude = PS["Prelude"]; | |
| var React_Basic_DOM = PS["React.Basic.DOM"]; | |
| var Web_DOM_NonElementParentNode = PS["Web.DOM.NonElementParentNode"]; | |
| var Web_HTML = PS["Web.HTML"]; | |
| var Web_HTML_HTMLDocument = PS["Web.HTML.HTMLDocument"]; | |
| var Web_HTML_Window = PS["Web.HTML.Window"]; | |
| var main = function __do() { | |
| var v = Control_Bind.bindFlipped(Effect.bindEffect)(Web_HTML_Window.document)(Web_HTML.window)(); | |
| var v1 = Web_DOM_NonElementParentNode.getElementById("root")(Web_HTML_HTMLDocument.toNonElementParentNode(v))(); | |
| if (v1 instanceof Data_Maybe.Nothing) { | |
| return Effect_Exception["throw"]("Error, container not found!")(); | |
| }; | |
| if (v1 instanceof Data_Maybe.Just) { | |
| return React_Basic_DOM.render(Component_App.app(Data_Unit.unit))(v1.value0)(); | |
| }; | |
| throw new Error("Failed pattern match at Main line 18, column 3 - line 20, column 34: " + [ v1.constructor.name ]); | |
| }; | |
| exports["main"] = main; | |
| })(PS["Main"] = PS["Main"] || {}); | |
| w.PS = PS; | |
| })(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment