UNPKG

purs-pkg-deps

Version:

Query package dependencies in PureScript package-sets

937 lines (936 loc) 84.2 kB
// Generated by purs version 0.14.3 "use strict"; var Control_Alt = require("../Control.Alt/index.js"); var Control_Applicative = require("../Control.Applicative/index.js"); var Control_Apply = require("../Control.Apply/index.js"); var Control_Bind = require("../Control.Bind/index.js"); var Control_Category = require("../Control.Category/index.js"); var Control_Plus = require("../Control.Plus/index.js"); var Data_Eq = require("../Data.Eq/index.js"); var Data_Foldable = require("../Data.Foldable/index.js"); var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js"); var Data_Function = require("../Data.Function/index.js"); var Data_Functor = require("../Data.Functor/index.js"); var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js"); var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js"); var Data_List = require("../Data.List/index.js"); var Data_List_Lazy = require("../Data.List.Lazy/index.js"); var Data_List_Lazy_Types = require("../Data.List.Lazy.Types/index.js"); var Data_List_Types = require("../Data.List.Types/index.js"); var Data_Maybe = require("../Data.Maybe/index.js"); var Data_Monoid = require("../Data.Monoid/index.js"); var Data_Ord = require("../Data.Ord/index.js"); var Data_Ordering = require("../Data.Ordering/index.js"); var Data_Semigroup = require("../Data.Semigroup/index.js"); var Data_Show = require("../Data.Show/index.js"); var Data_Traversable = require("../Data.Traversable/index.js"); var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js"); var Data_Tuple = require("../Data.Tuple/index.js"); var Data_Unfoldable = require("../Data.Unfoldable/index.js"); var Leaf = (function () { function Leaf() { }; Leaf.value = new Leaf(); return Leaf; })(); var Two = (function () { function Two(value0, value1, value2, value3) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; }; Two.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return new Two(value0, value1, value2, value3); }; }; }; }; return Two; })(); var Three = (function () { function Three(value0, value1, value2, value3, value4, value5, value6) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; this.value4 = value4; this.value5 = value5; this.value6 = value6; }; Three.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return function (value4) { return function (value5) { return function (value6) { return new Three(value0, value1, value2, value3, value4, value5, value6); }; }; }; }; }; }; }; return Three; })(); var TwoLeft = (function () { function TwoLeft(value0, value1, value2) { this.value0 = value0; this.value1 = value1; this.value2 = value2; }; TwoLeft.create = function (value0) { return function (value1) { return function (value2) { return new TwoLeft(value0, value1, value2); }; }; }; return TwoLeft; })(); var TwoRight = (function () { function TwoRight(value0, value1, value2) { this.value0 = value0; this.value1 = value1; this.value2 = value2; }; TwoRight.create = function (value0) { return function (value1) { return function (value2) { return new TwoRight(value0, value1, value2); }; }; }; return TwoRight; })(); var ThreeLeft = (function () { function ThreeLeft(value0, value1, value2, value3, value4, value5) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; this.value4 = value4; this.value5 = value5; }; ThreeLeft.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return function (value4) { return function (value5) { return new ThreeLeft(value0, value1, value2, value3, value4, value5); }; }; }; }; }; }; return ThreeLeft; })(); var ThreeMiddle = (function () { function ThreeMiddle(value0, value1, value2, value3, value4, value5) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; this.value4 = value4; this.value5 = value5; }; ThreeMiddle.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return function (value4) { return function (value5) { return new ThreeMiddle(value0, value1, value2, value3, value4, value5); }; }; }; }; }; }; return ThreeMiddle; })(); var ThreeRight = (function () { function ThreeRight(value0, value1, value2, value3, value4, value5) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; this.value4 = value4; this.value5 = value5; }; ThreeRight.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return function (value4) { return function (value5) { return new ThreeRight(value0, value1, value2, value3, value4, value5); }; }; }; }; }; }; return ThreeRight; })(); var KickUp = (function () { function KickUp(value0, value1, value2, value3) { this.value0 = value0; this.value1 = value1; this.value2 = value2; this.value3 = value3; }; KickUp.create = function (value0) { return function (value1) { return function (value2) { return function (value3) { return new KickUp(value0, value1, value2, value3); }; }; }; }; return KickUp; })(); var values = function (v) { if (v instanceof Leaf) { return Data_List_Types.Nil.value; }; if (v instanceof Two) { return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(values(v.value3))); }; if (v instanceof Three) { return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value5))(values(v.value6))))); }; throw new Error("Failed pattern match at Data.Map.Internal (line 626, column 1 - line 626, column 40): " + [ v.constructor.name ]); }; var size = function (v) { if (v instanceof Leaf) { return 0; }; if (v instanceof Two) { return (1 + size(v.value0) | 0) + size(v.value3) | 0; }; if (v instanceof Three) { return ((2 + size(v.value0) | 0) + size(v.value3) | 0) + size(v.value6) | 0; }; throw new Error("Failed pattern match at Data.Map.Internal (line 676, column 1 - line 676, column 35): " + [ v.constructor.name ]); }; 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 591, column 18 - line 600, column 71): " + [ v.value0.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 590, column 3 - line 590, 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 toUnfoldableUnordered = 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) { $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.value0, new Data_List_Types.Cons(v.value0.value3, v.value1)))); }; if (v.value0 instanceof Three) { $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(singleton(v.value0.value4)(v.value0.value5), new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(v.value0.value3, new Data_List_Types.Cons(v.value0.value6, v.value1)))))); }; throw new Error("Failed pattern match at Data.Map.Internal (line 612, column 18 - line 617, column 77): " + [ v.value0.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 611, column 3 - line 611, 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 showTree = function (dictShow) { return function (dictShow1) { return function (v) { if (v instanceof Leaf) { return "Leaf"; }; if (v instanceof Two) { return "Two (" + (showTree(dictShow)(dictShow1)(v.value0) + (") (" + (Data_Show.show(dictShow)(v.value1) + (") (" + (Data_Show.show(dictShow1)(v.value2) + (") (" + (showTree(dictShow)(dictShow1)(v.value3) + ")"))))))); }; if (v instanceof Three) { return "Three (" + (showTree(dictShow)(dictShow1)(v.value0) + (") (" + (Data_Show.show(dictShow)(v.value1) + (") (" + (Data_Show.show(dictShow1)(v.value2) + (") (" + (showTree(dictShow)(dictShow1)(v.value3) + (") (" + (Data_Show.show(dictShow)(v.value4) + (") (" + (Data_Show.show(dictShow1)(v.value5) + (") (" + (showTree(dictShow)(dictShow1)(v.value6) + ")"))))))))))))); }; throw new Error("Failed pattern match at Data.Map.Internal (line 164, column 1 - line 164, column 62): " + [ v.constructor.name ]); }; }; }; 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 lookupLE = function (dictOrd) { return function (k) { var comp = Data_Ord.compare(dictOrd); var go = function (v) { if (v instanceof Leaf) { return Data_Maybe.Nothing.value; }; if (v instanceof Two) { var v2 = comp(k)(v.value1); if (v2 instanceof Data_Ordering.EQ) { return new Data_Maybe.Just({ key: v.value1, value: v.value2 }); }; if (v2 instanceof Data_Ordering.GT) { return Data_Maybe.Just.create(Data_Maybe.fromMaybe({ key: v.value1, value: v.value2 })(go(v.value3))); }; if (v2 instanceof Data_Ordering.LT) { return go(v.value0); }; throw new Error("Failed pattern match at Data.Map.Internal (line 236, column 33 - line 239, column 20): " + [ v2.constructor.name ]); }; if (v instanceof Three) { var v3 = comp(k)(v.value4); if (v3 instanceof Data_Ordering.EQ) { return new Data_Maybe.Just({ key: v.value4, value: v.value5 }); }; if (v3 instanceof Data_Ordering.GT) { return Data_Maybe.Just.create(Data_Maybe.fromMaybe({ key: v.value4, value: v.value5 })(go(v.value6))); }; if (v3 instanceof Data_Ordering.LT) { return go(new Two(v.value0, v.value1, v.value2, v.value3)); }; throw new Error("Failed pattern match at Data.Map.Internal (line 240, column 45 - line 243, column 36): " + [ v3.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 235, column 5 - line 235, column 22): " + [ v.constructor.name ]); }; return go; }; }; var lookupGE = function (dictOrd) { return function (k) { var comp = Data_Ord.compare(dictOrd); var go = function (v) { if (v instanceof Leaf) { return Data_Maybe.Nothing.value; }; if (v instanceof Two) { var v2 = comp(k)(v.value1); if (v2 instanceof Data_Ordering.EQ) { return new Data_Maybe.Just({ key: v.value1, value: v.value2 }); }; if (v2 instanceof Data_Ordering.LT) { return Data_Maybe.Just.create(Data_Maybe.fromMaybe({ key: v.value1, value: v.value2 })(go(v.value0))); }; if (v2 instanceof Data_Ordering.GT) { return go(v.value3); }; throw new Error("Failed pattern match at Data.Map.Internal (line 270, column 33 - line 273, column 21): " + [ v2.constructor.name ]); }; if (v instanceof Three) { var v3 = comp(k)(v.value1); if (v3 instanceof Data_Ordering.EQ) { return new Data_Maybe.Just({ key: v.value1, value: v.value2 }); }; if (v3 instanceof Data_Ordering.LT) { return Data_Maybe.Just.create(Data_Maybe.fromMaybe({ key: v.value1, value: v.value2 })(go(v.value0))); }; if (v3 instanceof Data_Ordering.GT) { return go(new Two(v.value3, v.value4, v.value5, v.value6)); }; throw new Error("Failed pattern match at Data.Map.Internal (line 274, column 45 - line 277, column 37): " + [ v3.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 269, column 5 - line 269, column 22): " + [ v.constructor.name ]); }; return go; }; }; var lookup = function (dictOrd) { return function (k) { var comp = Data_Ord.compare(dictOrd); var go = function ($copy_v) { var $tco_done = false; var $tco_result; function $tco_loop(v) { if (v instanceof Leaf) { $tco_done = true; return Data_Maybe.Nothing.value; }; if (v instanceof Two) { var v2 = comp(k)(v.value1); if (v2 instanceof Data_Ordering.EQ) { $tco_done = true; return new Data_Maybe.Just(v.value2); }; if (v2 instanceof Data_Ordering.LT) { $copy_v = v.value0; return; }; $copy_v = v.value3; return; }; if (v instanceof Three) { var v3 = comp(k)(v.value1); if (v3 instanceof Data_Ordering.EQ) { $tco_done = true; return new Data_Maybe.Just(v.value2); }; var v4 = comp(k)(v.value4); if (v4 instanceof Data_Ordering.EQ) { $tco_done = true; return new Data_Maybe.Just(v.value5); }; if (v3 instanceof Data_Ordering.LT) { $copy_v = v.value0; return; }; if (v4 instanceof Data_Ordering.GT) { $copy_v = v.value6; return; }; $copy_v = v.value3; return; }; throw new Error("Failed pattern match at Data.Map.Internal (line 211, column 5 - line 211, column 22): " + [ v.constructor.name ]); }; while (!$tco_done) { $tco_result = $tco_loop($copy_v); }; return $tco_result; }; return go; }; }; var member = function (dictOrd) { return function (k) { return function (m) { return Data_Maybe.isJust(lookup(dictOrd)(k)(m)); }; }; }; var keys = function (v) { if (v instanceof Leaf) { return Data_List_Types.Nil.value; }; if (v instanceof Two) { return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(keys(v.value3))); }; if (v instanceof Three) { return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value4))(keys(v.value6))))); }; throw new Error("Failed pattern match at Data.Map.Internal (line 620, column 1 - line 620, column 38): " + [ v.constructor.name ]); }; var isSubmap = function (dictOrd) { return function (dictEq) { return function (m1) { return function (m2) { var f = function (v) { return Data_Eq.eq(Data_Maybe.eqMaybe(dictEq))(lookup(dictOrd)(v.value0)(m2))(new Data_Maybe.Just(v.value1)); }; return Data_Foldable.all(Data_List_Lazy_Types.foldableList)(Data_HeytingAlgebra.heytingAlgebraBoolean)(f)(toUnfoldable(Data_List_Lazy_Types.unfoldableList)(m1)); }; }; }; }; var isEmpty = function (v) { if (v instanceof Leaf) { return true; }; return false; }; var functorMap = new Data_Functor.Functor(function (v) { return function (v1) { if (v1 instanceof Leaf) { return Leaf.value; }; if (v1 instanceof Two) { return new Two(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3)); }; if (v1 instanceof Three) { return new Three(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3), v1.value4, v(v1.value5), Data_Functor.map(functorMap)(v)(v1.value6)); }; throw new Error("Failed pattern match at Data.Map.Internal (line 101, column 1 - line 104, column 110): " + [ v.constructor.name, v1.constructor.name ]); }; }); var functorWithIndexMap = new Data_FunctorWithIndex.FunctorWithIndex(function () { return functorMap; }, function (v) { return function (v1) { if (v1 instanceof Leaf) { return Leaf.value; }; if (v1 instanceof Two) { return new Two(Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value0), v1.value1, v(v1.value1)(v1.value2), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value3)); }; if (v1 instanceof Three) { return new Three(Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value0), v1.value1, v(v1.value1)(v1.value2), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value3), v1.value4, v(v1.value4)(v1.value5), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value6)); }; throw new Error("Failed pattern match at Data.Map.Internal (line 106, column 1 - line 109, column 152): " + [ v.constructor.name, v1.constructor.name ]); }; }); var fromZipper = function ($copy_dictOrd) { return function ($copy_v) { return function ($copy_tree) { var $tco_var_dictOrd = $copy_dictOrd; var $tco_var_v = $copy_v; var $tco_done = false; var $tco_result; function $tco_loop(dictOrd, v, tree) { if (v instanceof Data_List_Types.Nil) { $tco_done = true; return tree; }; if (v instanceof Data_List_Types.Cons) { if (v.value0 instanceof TwoLeft) { $tco_var_dictOrd = dictOrd; $tco_var_v = v.value1; $copy_tree = new Two(tree, v.value0.value0, v.value0.value1, v.value0.value2); return; }; if (v.value0 instanceof TwoRight) { $tco_var_dictOrd = dictOrd; $tco_var_v = v.value1; $copy_tree = new Two(v.value0.value0, v.value0.value1, v.value0.value2, tree); return; }; if (v.value0 instanceof ThreeLeft) { $tco_var_dictOrd = dictOrd; $tco_var_v = v.value1; $copy_tree = new Three(tree, v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5); return; }; if (v.value0 instanceof ThreeMiddle) { $tco_var_dictOrd = dictOrd; $tco_var_v = v.value1; $copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, tree, v.value0.value3, v.value0.value4, v.value0.value5); return; }; if (v.value0 instanceof ThreeRight) { $tco_var_dictOrd = dictOrd; $tco_var_v = v.value1; $copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5, tree); return; }; throw new Error("Failed pattern match at Data.Map.Internal (line 432, column 3 - line 437, column 88): " + [ v.value0.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 429, column 1 - line 429, 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 468, column 5 - line 473, column 108): " + [ v1.value0.constructor.name, v2.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 465, column 3 - line 465, 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_done1 = false; var $tco_result; function $tco_loop(ctx, v1) { if (v1 instanceof Leaf) { $tco_done1 = 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_done1 = 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_done1 = 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_done1 = 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 448, column 3 - line 448, column 55): " + [ ctx.constructor.name, v1.constructor.name ]); }; while (!$tco_done1) { $tco_result = $tco_loop($tco_var_ctx, $copy_v1); }; return $tco_result; }; }; return down(Data_List_Types.Nil.value); }; }; }; var pop = function (dictOrd) { return function (k) { var up = function ($copy_ctxs) { return function ($copy_tree) { var $tco_var_ctxs = $copy_ctxs; var $tco_done = false; var $tco_result; function $tco_loop(ctxs, tree) { if (ctxs instanceof Data_List_Types.Nil) { $tco_done = true; return tree; }; if (ctxs instanceof Data_List_Types.Cons) { if (ctxs.value0 instanceof TwoLeft && (ctxs.value0.value2 instanceof Leaf && tree instanceof Leaf)) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value)); }; if (ctxs.value0 instanceof TwoRight && (ctxs.value0.value0 instanceof Leaf && tree instanceof Leaf)) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value)); }; if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Two) { $tco_var_ctxs = ctxs.value1; $copy_tree = new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3); return; }; if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Two) { $tco_var_ctxs = ctxs.value1; $copy_tree = new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree); return; }; if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6))); }; if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree))); }; if (ctxs.value0 instanceof ThreeLeft && (ctxs.value0.value2 instanceof Leaf && (ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf))) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value)); }; if (ctxs.value0 instanceof ThreeMiddle && (ctxs.value0.value0 instanceof Leaf && (ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf))) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value)); }; if (ctxs.value0 instanceof ThreeRight && (ctxs.value0.value0 instanceof Leaf && (ctxs.value0.value3 instanceof Leaf && tree instanceof Leaf))) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value4, ctxs.value0.value5, Leaf.value)); }; if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Two) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5)); }; if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Two) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5)); }; if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Two) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0, ctxs.value0.value5.value1, ctxs.value0.value5.value2, ctxs.value0.value5.value3))); }; if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Two) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3, ctxs.value0.value4, ctxs.value0.value5, tree))); }; if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5)); }; if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5)); }; if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0), ctxs.value0.value5.value1, ctxs.value0.value5.value2, new Two(ctxs.value0.value5.value3, ctxs.value0.value5.value4, ctxs.value0.value5.value5, ctxs.value0.value5.value6))); }; if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Three) { $tco_done = true; return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3), ctxs.value0.value3.value4, ctxs.value0.value3.value5, new Two(ctxs.value0.value3.value6, ctxs.value0.value4, ctxs.value0.value5, tree))); }; throw new Error("Failed pattern match at Data.Map.Internal (line 525, column 9 - line 542, column 136): " + [ ctxs.value0.constructor.name, tree.constructor.name ]); }; throw new Error("Failed pattern match at Data.Map.Internal (line 522, column 5 - line 542, column 136): " + [ ctxs.constructor.name ]); }; while (!$tco_done) { $tco_result = $tco_loop($tco_var_ctxs, $copy_tree); }; return $tco_result; }; }; var removeMaxNode = function ($copy_ctx) { return function ($copy_m) { var $tco_var_ctx = $copy_ctx; var $tco_done1 = false; var $tco_result; function $tco_loop(ctx, m) { if (m instanceof Two && (m.value0 instanceof Leaf && m.value3 instanceof Leaf)) { $tco_done1 = true; return up(ctx)(Leaf.value); }; if (m instanceof Two) { $tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx); $copy_m = m.value3; return; }; if (m instanceof Three && (m.value0 instanceof Leaf && (m.value3 instanceof Leaf && m.value6 instanceof Leaf))) { $tco_done1 = true; return up(new Data_List_Types.Cons(new TwoRight(Leaf.value, m.value1, m.value2), ctx))(Leaf.value); }; if (m instanceof Three) { $tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(m.value0, m.value1, m.value2, m.value3, m.value4, m.value5), ctx); $copy_m = m.value6; return; }; throw new Error("Failed pattern match at Data.Map.Internal (line 554, column 5 - line 558, column 107): " + [ m.constructor.name ]); }; while (!$tco_done1) { $tco_result = $tco_loop($tco_var_ctx, $copy_m); }; return $tco_result; }; }; var maxNode = function ($copy_m) { var $tco_done2 = false; var $tco_result; function $tco_loop(m) { if (m instanceof Two && m.value3 instanceof Leaf) { $tco_done2 = true; return { key: m.value1, value: m.value2 }; }; if (m instanceof Two) { $copy_m = m.value3; return; }; if (m instanceof Three && m.value6 instanceof Leaf) { $tco_done2 = true; return { key: m.value4, value: m.value5 }; }; if (m instanceof Three) { $copy_m = m.value6; return; }; throw new Error("Failed pattern match at Data.Map.Internal (line 545, column 33 - line 549, column 45): " + [ m.constructor.name ]); }; while (!$tco_done2) { $tco_result = $tco_loop($copy_m); }; return $tco_result; }; var comp = Data_Ord.compare(dictOrd); var down = function ($copy_ctx) { return function ($copy_m) { var $tco_var_ctx = $copy_ctx; var $tco_done3 = false; var $tco_result; function $tco_loop(ctx, m) { if (m instanceof Leaf) { $tco_done3 = true; return Data_Maybe.Nothing.value; }; if (m instanceof Two) { var v = comp(k)(m.value1); if (m.value3 instanceof Leaf && v instanceof Data_Ordering.EQ) { $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, up(ctx)(Leaf.value))); }; if (v instanceof Data_Ordering.EQ) { var max = maxNode(m.value0); $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new TwoLeft(max.key, max.value, m.value3), ctx))(m.value0))); }; if (v instanceof Data_Ordering.LT) { $tco_var_ctx = new Data_List_Types.Cons(new TwoLeft(m.value1, m.value2, m.value3), ctx); $copy_m = m.value0; return; }; $tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx); $copy_m = m.value3; return; }; if (m instanceof Three) { var leaves = (function () { if (m.value0 instanceof Leaf && (m.value3 instanceof Leaf && m.value6 instanceof Leaf)) { return true; }; return false; })(); var v = comp(k)(m.value4); var v3 = comp(k)(m.value1); if (leaves && v3 instanceof Data_Ordering.EQ) { $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value4, m.value5, Leaf.value)))); }; if (leaves && v instanceof Data_Ordering.EQ) { $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value1, m.value2, Leaf.value)))); }; if (v3 instanceof Data_Ordering.EQ) { var max = maxNode(m.value0); $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new ThreeLeft(max.key, max.value, m.value3, m.value4, m.value5, m.value6), ctx))(m.value0))); }; if (v instanceof Data_Ordering.EQ) { var max = maxNode(m.value3); $tco_done3 = true; return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, removeMaxNode(new Data_List_Types.Cons(new ThreeMiddle(m.value0, m.value1, m.value2, max.key, max.value, m.value6), ctx))(m.value3))); }; if (v3 instanceof Data_Ordering.LT) { $tco_var_ctx = new Data_List_Types.Cons(new ThreeLeft(m.value1, m.value2, m.value3, m.value4, m.value5