on master help sign in
Update Automaton, Dict, and Set libraries.
commit17232487cdfc7824c427273b1d2fb04c7a38300f authorevancz <info@elm-lang.org> dateFri 19 Oct 2012, 00:13 (14 years ago) parentaab53b2
7 files changed+1540−181
core-elm/Automaton.elm+1−3 core-elm/Dict.elm+67−51 core-elm/Set.elm+3−2 core-js/Automaton.js+189−13 core-js/Dict.js+503−47 core-js/Set.js+43−3 elm/elm-runtime-0.5.0.js+734−62
core-elm/Automaton.elm+1−3
@@ -1,8 +1,6 @@
11
22module Automaton where
33
4−import Data.List (unzip)
5−
64data Automaton a b = Automaton (a -> (b, Automaton a b))
75
86
@@ -41,7 +39,7 @@ draggable :: Form -> Automaton (Bool,(Int,Int)) Form
4139run (Automaton m0) input =
4240 lift fst $ foldp' (\a (b, Automaton m) -> m a) m0 input
4341
44−step a (Automaton m) = m a
42+step (Automaton m) a = m a
4543
4644
4745--a1 >>> a2 =
core-elm/Dict.elm+67−51
@@ -2,7 +2,7 @@
22module Dict (empty,singleton,insert
33 ,lookup,find,findWithDefault
44 ,remove,member
5− ,fold,map
5+ ,foldl,foldr,map
66 ,union,intersect,diff
77 ,keys,values
88 ,toList,fromList
@@ -16,7 +16,9 @@ data RBTree k v = RBNode NColor k v (RBTree k v) (RBTree k v) | RBEmpty
1616
1717empty = RBEmpty
1818
19−-- Helpers for checking invariants
19+raise = console.log
20+
21+{-- Helpers for checking invariants
2022
2123-- Check that the tree has an equal number of black nodes on each path
2224equal_pathLen t =
@@ -92,21 +94,24 @@ invariants_hold t =
9294 equal_pathLen t && leftLeaning t
9395
9496--** End invariant helpers *****
97+--}
9598
9699
97100min t =
98101 case t of
99102 { RBNode _ k v RBEmpty _ -> (k,v)
100103 ; RBNode _ _ _ l _ -> min l
101− ; RBEmpty -> throw "(min RBEmpty) is not defined"
104+ ; RBEmpty -> raise "(min RBEmpty) is not defined"
102105 }
103106
107+{--
104108max t =
105109 case t of
106110 { RBNode _ k v _ RBEmpty -> (k,v)
107111 ; RBNode _ _ _ _ r -> max r
108− ; RBEmpty -> throw "(max RBEmpty) is not defined"
112+ ; RBEmpty -> raise "(max RBEmpty) is not defined"
109113 }
114+--}
110115
111116lookup k t =
112117 case t of
@@ -130,7 +135,7 @@ findWithDefault base k t =
130135
131136find k t =
132137 case t of
133− { RBEmpty -> throw "Key was not found in dictionary!"
138+ { RBEmpty -> raise "Key was not found in dictionary!"
134139 ; RBNode _ k' v l r ->
135140 case compare k k' of
136141 { LT -> find k l
@@ -144,14 +149,14 @@ member k t = isJust $ lookup k t
144149rotateLeft t =
145150 case t of
146151 { RBNode cy ky vy a (RBNode cz kz vz b c) -> RBNode cy kz vz (RBNode Red ky vy a b) c
147− ; _ -> throw "rotateLeft of a node without enough children" }
152+ ; _ -> raise "rotateLeft of a node without enough children" }
148153
149154-- rotateRight -- the reverse, and
150155-- makes Y have Z's color, and makes Z Red.
151156rotateRight t =
152157 case t of
153158 { RBNode cz kz vz (RBNode cy ky vy a b) c -> RBNode cz ky vy a (RBNode Red kz vz b c)
154− ; _ -> throw "rotateRight of a node without enough children" }
159+ ; _ -> raise "rotateRight of a node without enough children" }
155160
156161rotateLeftIfNeeded t =
157162 case t of
@@ -171,7 +176,7 @@ color_flip t =
171176 RBNode (otherColor c1) bk bv
172177 (RBNode (otherColor c2) ak av la ra)
173178 (RBNode (otherColor c3) ck cv lc rc)
174− ; _ -> throw "color_flip called on a RBEmpty or RBNode with a RBEmpty child" }
179+ ; _ -> raise "color_flip called on a RBEmpty or RBNode with a RBEmpty child" }
175180
176181color_flipIfNeeded t =
177182 case t of
@@ -197,12 +202,15 @@ insert k v t =
197202 ; EQ -> RBNode c k' v l r -- replace
198203 ; GT -> RBNode c k' v' l (ins r) }
199204 in fixUp h }
200− in if not (invariants_hold t) then
201− throw "invariants broken before insert"
205+ in ensureBlackRoot (ins t)
206+{--
207+ if not (invariants_hold t) then
208+ raise "invariants broken before insert"
202209 else (let new_t = ensureBlackRoot (ins t) in
203210 if not (invariants_hold new_t) then
204− throw "invariants broken after insert"
211+ raise "invariants broken after insert"
205212 else new_t)
213+--}
206214
207215singleton k v = insert k v RBEmpty
208216
@@ -268,6 +276,7 @@ deleteMin t =
268276 }
269277 in ensureBlackRoot (del t)
270278
279+{--
271280deleteMax t =
272281 let del t =
273282 let t' = if isRedLeft t then rotateRight t else t in
@@ -278,41 +287,42 @@ deleteMax t =
278287 { RBNode c k v l r -> fixUp (RBNode c k v l (del r))
279288 ; RBEmpty -> RBEmpty } }
280289 in ensureBlackRoot (del t)
290+--}
281291
282292remove k t =
283− let {
284− eq_and_noRightNode t = case t of { RBNode _ k' _ _ RBEmpty -> k == k' ; _ -> False }
285− ; eq t = case t of { RBNode _ k' _ _ _ -> k == k' ; _ -> False }
286− ; delLT t =
287− let t' = moveRedLeftIfNeeded t in
288− case t' of
289− { RBNode c k' v l r -> fixUp (RBNode c k' v (del l) r)
290− ; RBEmpty -> throw "delLT on RBEmpty" }
291− ; delEQ t =
292− case t of -- Replace with successor
293− { RBNode c _ _ l r ->
294− let (k',v') = min r in
295− fixUp (RBNode c k' v' l (deleteMin r))
296− ; RBEmpty -> throw "delEQ called on a RBEmpty" }
297− ; delGT t =
298− case t of
299− { RBNode c k' v l r -> fixUp (RBNode c k' v l (del r))
300− ; RBEmpty -> throw "delGT called on a RBEmpty" }
301− ; del t =
302− case t of
303− { RBEmpty -> RBEmpty
304− ; RBNode _ k' _ _ _ ->
305− if k < k' then delLT t
306− else (let t' = if isRedLeft t then rotateRight t else t in
307− if eq_and_noRightNode t' then RBEmpty
308− else (let t = moveRedRightIfNeeded t in
309− if eq t then delEQ t else delGT t)) }
310− }
311− in if not (invariants_hold t) then
312− throw "invariants broken before remove"
293+ let eq_and_noRightNode t = case t of { RBNode _ k' _ _ RBEmpty -> k == k' ; _ -> False } in
294+ let eq t = case t of { RBNode _ k' _ _ _ -> k == k' ; _ -> False } in
295+ let delLT t = let t' = moveRedLeftIfNeeded t in
296+ case t' of
297+ { RBNode c k' v l r -> fixUp (RBNode c k' v (del l) r)
298+ ; RBEmpty -> raise "delLT on RBEmpty" }
299+ in
300+ let delEQ t = case t of -- Replace with successor
301+ { RBNode c _ _ l r ->
302+ let (k',v') = min r in
303+ fixUp (RBNode c k' v' l (deleteMin r))
304+ ; RBEmpty -> raise "delEQ called on a RBEmpty" }
305+ in
306+ let delGT t = case t of
307+ { RBNode c k' v l r -> fixUp (RBNode c k' v l (del r))
308+ ; RBEmpty -> raise "delGT called on a RBEmpty" }
309+ in
310+ let del t = case t of
311+ { RBEmpty -> RBEmpty
312+ ; RBNode _ k' _ _ _ ->
313+ if k < k' then delLT t
314+ else (let t' = if isRedLeft t then rotateRight t else t in
315+ if eq_and_noRightNode t' then RBEmpty
316+ else (let t = moveRedRightIfNeeded t in
317+ if eq t then delEQ t else delGT t)) }
318+ in ensureBlackRoot (del t)
319+{--
320+ if not (invariants_hold t) then
321+ raise "invariants broken before remove"
313322 else (let t' = ensureBlackRoot (del t) in
314323 if invariants_hold t' then t' else
315− throw "invariants broken after remove")
324+ raise "invariants broken after remove")
325+--}
316326
317327map f t =
318328 case t of
@@ -320,18 +330,24 @@ map f t =
320330 ; RBNode c k v l r -> RBNode c k (f v) (map f l) (map f r)
321331 }
322332
323−fold f acc t =
333+foldl f acc t =
334+ case t of
335+ { RBEmpty -> acc
336+ ; RBNode _ k v l r -> foldl f (f k v (foldl f acc l)) r
337+ }
338+
339+foldr f acc t =
324340 case t of
325341 { RBEmpty -> acc
326− ; RBNode _ k v l r -> fold f (f k v (fold f acc l)) r
342+ ; RBNode _ k v l r -> foldr f (f k v (foldr f acc r)) l
327343 }
328344
329−union t1 t2 = fold insert t2 t1
330−intersect t1 t2 = fold (\k v t -> if k `member` t2 then insert k v t else t) empty t1
331−diff t1 t2 = fold (\k _ t -> remove k t) t1 t2
345+union t1 t2 = foldl insert t2 t1
346+intersect t1 t2 = foldl (\k v t -> if k `member` t2 then insert k v t else t) empty t1
347+diff t1 t2 = foldl (\k _ t -> remove k t) t1 t2
332348
333−keys t = fold (\k _ acc -> k : acc) [] t
334−values t = fold (\_ -> (:)) [] t
349+keys t = foldl (\k _ acc -> k : acc) [] t
350+values t = foldl (\_ -> (:)) [] t
335351
336−toList t = fold (\k v acc -> (k,v) : acc) [] t
337−fromList assocs = List.foldl (\(k,v) t -> insert k v t) empty assocs
352+toList t = foldl (\k v acc -> (k,v) : acc) [] t
353+fromList assocs = List.foldl (uncurry insert) empty assocs
core-elm/Set.elm+3−2
@@ -1,7 +1,7 @@
11
22module Set (empty,singleton,insert,remove
33 ,member
4− ,fold,map
4+ ,foldl,foldr,map
55 ,union,intersect,diff
66 ,toList,fromList
77 ) where
@@ -19,5 +19,6 @@ diff = Dict.diff
1919toList = Dict.keys
2020fromList = List.foldl (\k t -> Dict.insert k () t) empty
2121
22−fold f = Dict.fold (\k v b -> f k b)
22+foldl f = Dict.foldl (\k v b -> f k b)
23+foldr f = Dict.foldr (\k v b -> f k b)
2324map f t = fromList . List.map f $ toList t
core-js/Automaton.js+189−13
@@ -1,13 +1,189 @@
1−try{if(Elm.Automaton)throw "Module name collision, 'Automaton' is already defined.";Elm.Automaton=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Data.List instanceof Object))throw 'module not found'}catch(e){throw "Module 'Data.List' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var unzip=Elm.Data.List.unzip
2−function Automaton_0(a1){return ["Automaton",a1]};var Listen_9=["Listen"],Ignore_10=["Ignore"]
3−function DragFrom_11(a1){return ["DragFrom",a1]};var count_8=init_6(0)(function(__75){return function(c_76){return(1+c_76)}})
4−function run_1(Automaton$m0_15){return function(input_16){return function(){switch(Automaton$m0_15[0]){case"Automaton":return lift(fst)(foldp_(function(a_18){return function(Tuple2$bAutomaton$m_19){return function(){switch(Tuple2$bAutomaton$m_19[0]){case"Tuple2":switch(Tuple2$bAutomaton$m_19[2][0]){case"Automaton":return Tuple2$bAutomaton$m_19[2][1](a_18)};break};throw "Non-exhaustive pattern match in case"}()}})(Automaton$m0_15[1])(input_16))};throw "Non-exhaustive pattern match in case"}()}}
5−function step_2(a_22){return function(Automaton$m_23){return function(){switch(Automaton$m_23[0]){case"Automaton":return Automaton$m_23[1](a_22)};throw "Non-exhaustive pattern match in case"}()}}
6−function composeAuto_3(a1_25){return function(a2_26){return function(){var Automaton$m1_27=a1_25,m1_28=function(){switch(Automaton$m1_27[0]){case"Automaton":return Automaton$m1_27[1]};throw "Non-exhaustive pattern match in case"}(),Automaton$m2_29=a2_26,m2_30=function(){switch(Automaton$m2_29[0]){case"Automaton":return Automaton$m2_29[1]};throw "Non-exhaustive pattern match in case"}();return Automaton_0(function(a_33){return function(){var Tuple2$bm1__34=m1_28(a_33),b_35=function(){switch(Tuple2$bm1__34[0]){case"Tuple2":return Tuple2$bm1__34[1]};throw "Non-exhaustive pattern match in case"}(),m1__36=function(){switch(Tuple2$bm1__34[0]){case"Tuple2":return Tuple2$bm1__34[2]};throw "Non-exhaustive pattern match in case"}();return function(){var Tuple2$cm2__41=m2_30(b_35),c_42=function(){switch(Tuple2$cm2__41[0]){case"Tuple2":return Tuple2$cm2__41[1]};throw "Non-exhaustive pattern match in case"}(),m2__43=function(){switch(Tuple2$cm2__41[0]){case"Tuple2":return Tuple2$cm2__41[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",c_42,composeAuto_3(m1__36)(m2__43)]}()}()})}()}}
7−function combine_4(autos_48){return Automaton_0(function(a_49){return function(){var Tuple2$bsautos__50=unzip(map(function(Automaton$m_53){return function(){switch(Automaton$m_53[0]){case"Automaton":return Automaton$m_53[1](a_49)};throw "Non-exhaustive pattern match in case"}()})(autos_48)),bs_51=function(){switch(Tuple2$bsautos__50[0]){case"Tuple2":return Tuple2$bsautos__50[1]};throw "Non-exhaustive pattern match in case"}(),autos__52=function(){switch(Tuple2$bsautos__50[0]){case"Tuple2":return Tuple2$bsautos__50[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",bs_51,combine_4(autos__52)]}()})}
8−function pure_5(f_59){return Automaton_0(function(x_60){return ["Tuple2",f_59(x_60),pure_5(f_59)]})}
9−function init_6(s_61){return function(step_62){return Automaton_0(function(a_63){return function(){var s__64=step_62(a_63)(s_61);return ["Tuple2",s__64,init_6(s__64)(step_62)]}()})}}
10−function init__7(s_65){return function(step_66){return Automaton_0(function(a_67){return function(){var Tuple2$bs__68=step_66(a_67)(s_65),b_69=function(){switch(Tuple2$bs__68[0]){case"Tuple2":return Tuple2$bs__68[1]};throw "Non-exhaustive pattern match in case"}(),s__70=function(){switch(Tuple2$bs__68[0]){case"Tuple2":return Tuple2$bs__68[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",b_69,init__7(s__70)(step_66)]}()})}}
11−function vecSub_12(Tuple2$x1y1_77){return function(Tuple2$x2y2_78){return function(){switch(Tuple2$x1y1_77[0]){case"Tuple2":return function(){switch(Tuple2$x2y2_78[0]){case"Tuple2":return ["Tuple2",(Tuple2$x1y1_77[1]-Tuple2$x2y2_78[1]),(Tuple2$x1y1_77[2]-Tuple2$x2y2_78[2])]};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
12−function stepDrag_13(Tuple2$presspos_83){return function(Tuple2$dsform_84){return function(){switch(Tuple2$presspos_83[0]){case"Tuple2":return function(){switch(Tuple2$dsform_84[0]){case"Tuple2":return function(){function wrap_89(ds__90){return ["Tuple2",Tuple2$dsform_84[2],["Tuple2",ds__90,Tuple2$dsform_84[2]]]};return function(){switch(Tuple2$dsform_84[1][0]){case"DragFrom":return(Tuple2$presspos_83[1]?["Tuple2",uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]),["Tuple2",DragFrom_11(Tuple2$dsform_84[1][1]),Tuple2$dsform_84[2]]]:function(){var form__92=uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]);return ["Tuple2",form__92,["Tuple2",Listen_9,form__92]]}());case"Ignore":return wrap_89((Tuple2$presspos_83[1]?Ignore_10:Listen_9));case"Listen":return wrap_89((not(Tuple2$presspos_83[1])?Listen_9:(isWithin(Tuple2$presspos_83[2])(Tuple2$dsform_84[2])?DragFrom_11(Tuple2$presspos_83[2]):Ignore_10)))};throw "Non-exhaustive pattern match in case"}()}()};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
13−function dragForm_14(form_93){return init__7(["Tuple2",Listen_9,form_93])(stepDrag_13)};return {Automaton:Automaton_0,run:run_1,step:step_2,composeAuto:composeAuto_3,combine:combine_4,pure:pure_5,init:init_6,init_:init__7,count:count_8,Listen:Listen_9,Ignore:Ignore_10,DragFrom:DragFrom_11,vecSub:vecSub_12,stepDrag:stepDrag_13,dragForm:dragForm_14}}();Elm.main=function(){return Elm.Automaton.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Automaton module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>fst, unzip</span>');document.body.innerHTML=Text.monospace(msg);throw e}}
1+
2+try{
3+
4+for(var i in Elm) { this[i] = Elm[i]; }
5+if (Elm.Automaton) throw "Module name collision, 'Automaton' is already defined.";
6+Elm.Automaton=function(){
7+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
8+ var hiddenVars=[];
9+ for(var i in Elm.Prelude){
10+ if (hiddenVars.indexOf(i) >= 0) continue;
11+ this[i]=Elm.Prelude[i];}
12+ function Automaton_0(a1){
13+ return ["Automaton",a1];};
14+ var Listen_9=["Listen"];
15+ var Ignore_10=["Ignore"];
16+ function DragFrom_11(a1){
17+ return ["DragFrom",a1];};
18+ var count_8=init_6(0)(function(__75){
19+ return function(c_76){
20+ return (1+c_76);};});
21+ function run_1(Automaton$m0_15){
22+ return function(input_16){
23+ return function(){
24+ switch(Automaton$m0_15[0]){
25+ case "Automaton":
26+ return lift(fst)(foldp_(function(a_18){
27+ return function(Tuple2$bAutomaton$m_19){
28+ return function(){
29+ switch(Tuple2$bAutomaton$m_19[0]){
30+ case "Tuple2":
31+ switch(Tuple2$bAutomaton$m_19[2][0]){
32+ case "Automaton":
33+ return Tuple2$bAutomaton$m_19[2][1](a_18);
34+ }break;
35+ }
36+ throw "Non-exhaustive pattern match in case";}();};})(Automaton$m0_15[1])(input_16));
37+ }
38+ throw "Non-exhaustive pattern match in case";}();};};
39+ function step_2(Automaton$m_22){
40+ return function(a_23){
41+ return function(){
42+ switch(Automaton$m_22[0]){
43+ case "Automaton":
44+ return Automaton$m_22[1](a_23);
45+ }
46+ throw "Non-exhaustive pattern match in case";}();};};
47+ function composeAuto_3(a1_25){
48+ return function(a2_26){
49+ return function(){
50+ var Automaton$m1_27=a1_25;
51+ var m1_28=function(){
52+ switch(Automaton$m1_27[0]){
53+ case "Automaton":
54+ return Automaton$m1_27[1];
55+ }
56+ throw "Non-exhaustive pattern match in case";}();
57+ var Automaton$m2_29=a2_26;
58+ var m2_30=function(){
59+ switch(Automaton$m2_29[0]){
60+ case "Automaton":
61+ return Automaton$m2_29[1];
62+ }
63+ throw "Non-exhaustive pattern match in case";}();
64+ return Automaton_0(function(a_33){
65+ return function(){
66+ var Tuple2$bm1__34=m1_28(a_33);
67+ var b_35=function(){
68+ switch(Tuple2$bm1__34[0]){
69+ case "Tuple2":
70+ return Tuple2$bm1__34[1];
71+ }
72+ throw "Non-exhaustive pattern match in case";}();
73+ var m1__36=function(){
74+ switch(Tuple2$bm1__34[0]){
75+ case "Tuple2":
76+ return Tuple2$bm1__34[2];
77+ }
78+ throw "Non-exhaustive pattern match in case";}();
79+ return function(){
80+ var Tuple2$cm2__41=m2_30(b_35);
81+ var c_42=function(){
82+ switch(Tuple2$cm2__41[0]){
83+ case "Tuple2":
84+ return Tuple2$cm2__41[1];
85+ }
86+ throw "Non-exhaustive pattern match in case";}();
87+ var m2__43=function(){
88+ switch(Tuple2$cm2__41[0]){
89+ case "Tuple2":
90+ return Tuple2$cm2__41[2];
91+ }
92+ throw "Non-exhaustive pattern match in case";}();
93+ return ["Tuple2",c_42,composeAuto_3(m1__36)(m2__43)];}();}();});}();};};
94+ function combine_4(autos_48){
95+ return Automaton_0(function(a_49){
96+ return function(){
97+ var Tuple2$bsautos__50=unzip(map(function(Automaton$m_53){
98+ return function(){
99+ switch(Automaton$m_53[0]){
100+ case "Automaton":
101+ return Automaton$m_53[1](a_49);
102+ }
103+ throw "Non-exhaustive pattern match in case";}();})(autos_48));
104+ var bs_51=function(){
105+ switch(Tuple2$bsautos__50[0]){
106+ case "Tuple2":
107+ return Tuple2$bsautos__50[1];
108+ }
109+ throw "Non-exhaustive pattern match in case";}();
110+ var autos__52=function(){
111+ switch(Tuple2$bsautos__50[0]){
112+ case "Tuple2":
113+ return Tuple2$bsautos__50[2];
114+ }
115+ throw "Non-exhaustive pattern match in case";}();
116+ return ["Tuple2",bs_51,combine_4(autos__52)];}();});};
117+ function pure_5(f_59){
118+ return Automaton_0(function(x_60){
119+ return ["Tuple2",f_59(x_60),pure_5(f_59)];});};
120+ function init_6(s_61){
121+ return function(step_62){
122+ return Automaton_0(function(a_63){
123+ return function(){
124+ var s__64=step_62(a_63)(s_61);
125+ return ["Tuple2",s__64,init_6(s__64)(step_62)];}();});};};
126+ function init__7(s_65){
127+ return function(step_66){
128+ return Automaton_0(function(a_67){
129+ return function(){
130+ var Tuple2$bs__68=step_66(a_67)(s_65);
131+ var b_69=function(){
132+ switch(Tuple2$bs__68[0]){
133+ case "Tuple2":
134+ return Tuple2$bs__68[1];
135+ }
136+ throw "Non-exhaustive pattern match in case";}();
137+ var s__70=function(){
138+ switch(Tuple2$bs__68[0]){
139+ case "Tuple2":
140+ return Tuple2$bs__68[2];
141+ }
142+ throw "Non-exhaustive pattern match in case";}();
143+ return ["Tuple2",b_69,init__7(s__70)(step_66)];}();});};};
144+ function vecSub_12(Tuple2$x1y1_77){
145+ return function(Tuple2$x2y2_78){
146+ return function(){
147+ switch(Tuple2$x1y1_77[0]){
148+ case "Tuple2":
149+ return function(){
150+ switch(Tuple2$x2y2_78[0]){
151+ case "Tuple2":
152+ return ["Tuple2",(Tuple2$x1y1_77[1]-Tuple2$x2y2_78[1]),(Tuple2$x1y1_77[2]-Tuple2$x2y2_78[2])];
153+ }
154+ throw "Non-exhaustive pattern match in case";}();
155+ }
156+ throw "Non-exhaustive pattern match in case";}();};};
157+ function stepDrag_13(Tuple2$presspos_83){
158+ return function(Tuple2$dsform_84){
159+ return function(){
160+ switch(Tuple2$presspos_83[0]){
161+ case "Tuple2":
162+ return function(){
163+ switch(Tuple2$dsform_84[0]){
164+ case "Tuple2":
165+ return function(){
166+ function wrap_89(ds__90){
167+ return ["Tuple2",Tuple2$dsform_84[2],["Tuple2",ds__90,Tuple2$dsform_84[2]]];};
168+ return function(){
169+ switch(Tuple2$dsform_84[1][0]){
170+ case "DragFrom":
171+ return (Tuple2$presspos_83[1]?["Tuple2",uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]),["Tuple2",DragFrom_11(Tuple2$dsform_84[1][1]),Tuple2$dsform_84[2]]]:function(){
172+ var form__92=uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]);
173+ return ["Tuple2",form__92,["Tuple2",Listen_9,form__92]];}());
174+ case "Ignore":
175+ return wrap_89((Tuple2$presspos_83[1]?Ignore_10:Listen_9));
176+ case "Listen":
177+ return wrap_89((not(Tuple2$presspos_83[1])?Listen_9:(isWithin(Tuple2$presspos_83[2])(Tuple2$dsform_84[2])?DragFrom_11(Tuple2$presspos_83[2]):Ignore_10)));
178+ }
179+ throw "Non-exhaustive pattern match in case";}();}();
180+ }
181+ throw "Non-exhaustive pattern match in case";}();
182+ }
183+ throw "Non-exhaustive pattern match in case";}();};};
184+ function dragForm_14(form_93){
185+ return init__7(["Tuple2",Listen_9,form_93])(stepDrag_13);};
186+ return {Automaton:Automaton_0,run:run_1,step:step_2,composeAuto:composeAuto_3,combine:combine_4,pure:pure_5,init:init_6,init_:init__7,count:count_8,Listen:Listen_9,Ignore:Ignore_10,DragFrom:DragFrom_11,vecSub:vecSub_12,stepDrag:stepDrag_13,dragForm:dragForm_14};}();
187+Elm.main=function(){
188+ return Elm.Automaton.main;};
189+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Automaton module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}
core-js/Dict.js+503−47
@@ -1,47 +1,503 @@
1−try{if(Elm.Dict)throw "Module name collision, 'Dict' is already defined.";Elm.Dict=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Data.Maybe instanceof Object))throw 'module not found'}catch(e){throw "Module 'Data.Maybe' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var isJust=Elm.Data.Maybe.isJust,Red_0=["Red"],Black_1=["Black"]
2−function RBNode_2(a1){return function(a2){return function(a3){return function(a4){return function(a5){return ["RBNode",a1,a2,a3,a4,a5]}}}}};var RBEmpty_3=["RBEmpty"],raise_4=console.log,empty_5=RBEmpty_3
3−function equal_pathLen_6(t_46){return function(){function path_numBlacks_47(t_48){return function(){switch(t_48[0]){case"RBEmpty":return 1;case"RBNode":return function(){var bl_52=path_numBlacks_47(t_48[4]),br_53=path_numBlacks_47(t_48[5]);return((not(eq(bl_52,br_53))||(eq(bl_52,-1)||eq(br_53,-1)))?-1:(bl_52+(eq(t_48[1],Red_0)?0:1)))}()};throw "Non-exhaustive pattern match in case"}()};return not(eq(-1,path_numBlacks_47(t_46)))}()}
4−function rootBlack_7(t_54){return function(){switch(t_54[0]){case"RBEmpty":return true;case"RBNode":switch(t_54[1][0]){case"Black":return true};break};return false}()}
5−function redBlack_children_8(t_55){return function(){switch(t_55[0]){case"RBEmpty":return true;case"RBNode":switch(t_55[1][0]){case"Red":switch(t_55[4][0]){case"RBNode":switch(t_55[4][1][0]){case"Red":return false};break};switch(t_55[5][0]){case"RBNode":switch(t_55[5][1][0]){case"Red":return false};break};break};return(redBlack_children_8(t_55[4])&&redBlack_children_8(t_55[5]))};throw "Non-exhaustive pattern match in case"}()}
6−function findExtreme_9(f_58){return function(t_59){return function(){switch(t_59[0]){case"RBEmpty":return Nothing;case"RBNode":return function(){var case6=findExtreme_9(f_58)(f_58(["Tuple2",t_59[4],t_59[5]]));switch(case6[0]){case"Just":return Just(case6[1]);case"Nothing":return Just(t_59[2])};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
7−function findminRbt_10(t_65){return findExtreme_9(fst)(t_65)}
8−function findmaxRbt_11(t_66){return findExtreme_9(snd)(t_66)}
9−function optionRelation_12(f_67){return function(u_68){return function(xo_69){return function(yo_70){return function(){var case0=["Tuple2",xo_69,yo_70];switch(case0[0]){case"Tuple2":switch(case0[1][0]){case"Nothing":return u_68};switch(case0[2][0]){case"Nothing":return u_68};switch(case0[1][0]){case"Just":switch(case0[2][0]){case"Just":return f_67(case0[1][1])(case0[2][1])};break};break};throw "Non-exhaustive pattern match in case"}()}}}}
10−function olt_13(xo_73){return function(yo_74){return optionRelation_12(function(x_75){return function(y_76){return(compare(x_75)(y_76)[0]==='LT')}})(true)(xo_73)(yo_74)}}
11−function olte_14(xo_77){return function(yo_78){return optionRelation_12(function(x_79){return function(y_80){return function(){var ord=compare(x_79)(y_80)[0];return ord==='LT'||ord==='EQ'}()}})(true)(xo_77)(yo_78)}}
12−function ordered_15(t_81){return function(){switch(t_81[0]){case"RBEmpty":return true;case"RBNode":return function(){var Tuple2$lmaxrmin_87=["Tuple2",findmaxRbt_11(t_81[4]),findminRbt_10(t_81[5])],lmax_88=function(){switch(Tuple2$lmaxrmin_87[0]){case"Tuple2":return Tuple2$lmaxrmin_87[1]};throw "Non-exhaustive pattern match in case"}(),rmin_89=function(){switch(Tuple2$lmaxrmin_87[0]){case"Tuple2":return Tuple2$lmaxrmin_87[2]};throw "Non-exhaustive pattern match in case"}();return(olte_14(lmax_88)(Just(t_81[2]))&&(olte_14(Just(t_81[2]))(rmin_89)&&(ordered_15(t_81[4])&&ordered_15(t_81[5]))))}()};throw "Non-exhaustive pattern match in case"}()}
13−function leftLeaning_16(t_94){return function(){switch(t_94[0]){case"RBEmpty":return true;case"RBNode":switch(t_94[4][0]){case"RBEmpty":switch(t_94[5][0]){case"RBNode":switch(t_94[5][1][0]){case"Red":return false};break};break;case"RBNode":switch(t_94[4][1][0]){case"Black":switch(t_94[5][0]){case"RBNode":switch(t_94[5][1][0]){case"Red":return false};break};break};break};return(leftLeaning_16(t_94[4])&&leftLeaning_16(t_94[5]))};throw "Non-exhaustive pattern match in case"}()}
14−function invariants_hold_17(t_97){return(ordered_15(t_97)&&(rootBlack_7(t_97)&&(redBlack_children_8(t_97)&&(equal_pathLen_6(t_97)&&leftLeaning_16(t_97)))))}
15−function min_18(t_98){return function(){switch(t_98[0]){case"RBEmpty":return console.log(Value.str("(min RBEmpty) is not defined"));case"RBNode":switch(t_98[4][0]){case"RBEmpty":return ["Tuple2",t_98[2],t_98[3]]};return min_18(t_98[4])};throw "Non-exhaustive pattern match in case"}()}
16−function max_19(t_102){return function(){switch(t_102[0]){case"RBEmpty":return console.log(Value.str("(max RBEmpty) is not defined"));case"RBNode":switch(t_102[5][0]){case"RBEmpty":return ["Tuple2",t_102[2],t_102[3]]};return max_19(t_102[5])};throw "Non-exhaustive pattern match in case"}()}
17−function lookup_20(k_106){return function(t_107){return function(){switch(t_107[0]){case"RBEmpty":return Nothing;case"RBNode":return function(){var case6=compare(k_106)(t_107[2]);switch(case6[0]){case"EQ":return Just(t_107[3]);case"GT":return lookup_20(k_106)(t_107[5]);case"LT":return lookup_20(k_106)(t_107[4])};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
18−function member_21(k_112){return function(t_113){return isJust(lookup_20(k_112)(t_113))}}
19−function rotateLeft_22(t_114){return function(){switch(t_114[0]){case"RBNode":switch(t_114[5][0]){case"RBNode":return RBNode_2(t_114[1])(t_114[5][2])(t_114[5][3])(RBNode_2(Red_0)(t_114[2])(t_114[3])(t_114[4])(t_114[5][4]))(t_114[5][5])};break};return raise_4(Value.str("rotateLeft of a node without enough children"))}()}
20−function rotateRight_23(t_124){return function(){switch(t_124[0]){case"RBNode":switch(t_124[4][0]){case"RBNode":return RBNode_2(t_124[1])(t_124[4][2])(t_124[4][3])(t_124[4][4])(RBNode_2(Red_0)(t_124[2])(t_124[3])(t_124[4][5])(t_124[5]))};break};return raise_4(Value.str("rotateRight of a node without enough children"))}()}
21−function rotateLeftIfNeeded_24(t_134){return function(){switch(t_134[0]){case"RBNode":switch(t_134[5][0]){case"RBNode":switch(t_134[5][1][0]){case"Red":return rotateLeft_22(t_134)};break};break};return t_134}()}
22−function rotateRightIfNeeded_25(t_135){return function(){switch(t_135[0]){case"RBNode":switch(t_135[4][0]){case"RBNode":switch(t_135[4][1][0]){case"Red":switch(t_135[4][4][0]){case"RBNode":switch(t_135[4][4][1][0]){case"Red":return rotateRight_23(t_135)};break};break};break};break};return t_135}()}
23−function otherColor_26(c_136){return function(){switch(c_136[0]){case"Black":return Red_0;case"Red":return Black_1};throw "Non-exhaustive pattern match in case"}()}
24−function color_flip_27(t_137){return function(){switch(t_137[0]){case"RBNode":switch(t_137[4][0]){case"RBNode":switch(t_137[5][0]){case"RBNode":return RBNode_2(otherColor_26(t_137[1]))(t_137[2])(t_137[3])(RBNode_2(otherColor_26(t_137[4][1]))(t_137[4][2])(t_137[4][3])(t_137[4][4])(t_137[4][5]))(RBNode_2(otherColor_26(t_137[5][1]))(t_137[5][2])(t_137[5][3])(t_137[5][4])(t_137[5][5]))};break};break};return raise_4(Value.str("color_flip called on a RBEmpty or RBNode with a RBEmpty child"))}()}
25−function color_flipIfNeeded_28(t_151){return function(){switch(t_151[0]){case"RBNode":switch(t_151[4][0]){case"RBNode":switch(t_151[4][1][0]){case"Red":switch(t_151[5][0]){case"RBNode":switch(t_151[5][1][0]){case"Red":return color_flip_27(t_151)};break};break};break};break};return t_151}()}
26−function fixUp_29(t_152){return color_flipIfNeeded_28(rotateRightIfNeeded_25(rotateLeftIfNeeded_24(t_152)))}
27−function ensureBlackRoot_30(t_153){return function(){switch(t_153[0]){case"RBNode":switch(t_153[1][0]){case"Red":return RBNode_2(Black_1)(t_153[2])(t_153[3])(t_153[4])(t_153[5])};break};return t_153}()}
28−function insert_31(k_158){return function(v_159){return function(t_160){return function(){function ins_161(t_162){return function(){switch(t_162[0]){case"RBEmpty":return RBNode_2(Red_0)(k_158)(v_159)(RBEmpty_3)(RBEmpty_3);case"RBNode":return function(){var h_168=function(){var case6=compare(k_158)(t_162[2]);switch(case6[0]){case"EQ":return RBNode_2(t_162[1])(t_162[2])(v_159)(t_162[4])(t_162[5]);case"GT":return RBNode_2(t_162[1])(t_162[2])(t_162[3])(t_162[4])(ins_161(t_162[5]));case"LT":return RBNode_2(t_162[1])(t_162[2])(t_162[3])(ins_161(t_162[4]))(t_162[5])};throw "Non-exhaustive pattern match in case"}();return fixUp_29(h_168)}()};throw "Non-exhaustive pattern match in case"}()};return(not(invariants_hold_17(t_160))?raise_4(Value.str("invariants broken before insert")):function(){var new_t_169=ensureBlackRoot_30(ins_161(t_160));return(not(invariants_hold_17(new_t_169))?raise_4(Value.str("invariants broken after insert")):new_t_169)}())}()}}}
29−function singleton_32(k_170){return function(v_171){return insert_31(k_170)(v_171)(RBEmpty_3)}}
30−function isRed_33(t_172){return function(){switch(t_172[0]){case"RBNode":switch(t_172[1][0]){case"Red":return true};break};return false}()}
31−function isRedLeft_34(t_173){return function(){switch(t_173[0]){case"RBNode":switch(t_173[4][0]){case"RBNode":switch(t_173[4][1][0]){case"Red":return true};break};break};return false}()}
32−function isRedLeftLeft_35(t_174){return function(){switch(t_174[0]){case"RBNode":switch(t_174[4][0]){case"RBNode":switch(t_174[4][4][0]){case"RBNode":switch(t_174[4][4][1][0]){case"Red":return true};break};break};break};return false}()}
33−function isRedRight_36(t_175){return function(){switch(t_175[0]){case"RBNode":switch(t_175[5][0]){case"RBNode":switch(t_175[5][1][0]){case"Red":return true};break};break};return false}()}
34−function isRedRightLeft_37(t_176){return function(){switch(t_176[0]){case"RBNode":switch(t_176[5][0]){case"RBNode":switch(t_176[5][4][0]){case"RBNode":switch(t_176[5][4][1][0]){case"Red":return true};break};break};break};return false}()}
35−function moveRedLeft_38(t_177){return function(){var t__178=color_flip_27(t_177);return function(){switch(t__178[0]){case"RBNode":return function(){switch(t__178[5][0]){case"RBNode":switch(t__178[5][4][0]){case"RBNode":switch(t__178[5][4][1][0]){case"Red":return color_flip_27(rotateLeft_22(RBNode_2(t__178[1])(t__178[2])(t__178[3])(t__178[4])(rotateRight_23(t__178[5]))))};break};break};return t__178}()};return t__178}()}()}
36−function moveRedRight_39(t_184){return function(){var t__185=color_flip_27(t_184);return(isRedLeftLeft_35(t__185)?color_flip_27(rotateRight_23(t__185)):t__185)}()}
37−function moveRedLeftIfNeeded_40(t_186){return((not(isRedLeft_34(t_186))&&not(isRedLeftLeft_35(t_186)))?moveRedLeft_38(t_186):t_186)}
38−function moveRedRightIfNeeded_41(t_187){return((not(isRedRight_36(t_187))&&not(isRedRightLeft_37(t_187)))?moveRedRight_39(t_187):t_187)}
39−function deleteMin_42(t_188){return function(){function del_189(t_190){return function(){switch(t_190[0]){case"RBNode":switch(t_190[4][0]){case"RBEmpty":return RBEmpty_3};break};return function(){var t__191=moveRedLeftIfNeeded_40(t_190);return function(){switch(t__191[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return fixUp_29(RBNode_2(t__191[1])(t__191[2])(t__191[3])(del_189(t__191[4]))(t__191[5]))};throw "Non-exhaustive pattern match in case"}()}()}()};return ensureBlackRoot_30(del_189(t_188))}()}
40−function deleteMax_43(t_197){return function(){function del_198(t_199){return function(){var t__200=(isRedLeft_34(t_199)?rotateRight_23(t_199):t_199);return function(){switch(t__200[0]){case"RBNode":switch(t__200[5][0]){case"RBEmpty":return RBEmpty_3};break};return function(){var t___201=moveRedRightIfNeeded_41(t__200);return function(){switch(t___201[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return fixUp_29(RBNode_2(t___201[1])(t___201[2])(t___201[3])(t___201[4])(del_198(t___201[5])))};throw "Non-exhaustive pattern match in case"}()}()}()}()};return ensureBlackRoot_30(del_198(t_197))}()}
41−function remove_44(k_207){return function(t_208){return function(){function eq_and_noRightNode_209(t_215){return function(){switch(t_215[0]){case"RBNode":switch(t_215[5][0]){case"RBEmpty":return eq(k_207,t_215[2])};break};return false}()}
42−function eq_210(t_217){return function(){switch(t_217[0]){case"RBNode":return eq(k_207,t_217[2])};return false}()}
43−function delLT_211(t_219){return function(){var t__220=moveRedLeftIfNeeded_40(t_219);return function(){switch(t__220[0]){case"RBEmpty":return raise_4(Value.str("delLT on RBEmpty"));case"RBNode":return fixUp_29(RBNode_2(t__220[1])(t__220[2])(t__220[3])(del_214(t__220[4]))(t__220[5]))};throw "Non-exhaustive pattern match in case"}()}()}
44−function delEQ_212(t_226){return function(){switch(t_226[0]){case"RBEmpty":return raise_4(Value.str("delEQ called on a RBEmpty"));case"RBNode":return function(){var Tuple2$k_v__230=min_18(t_226[5]),k__231=function(){switch(Tuple2$k_v__230[0]){case"Tuple2":return Tuple2$k_v__230[1]};throw "Non-exhaustive pattern match in case"}(),v__232=function(){switch(Tuple2$k_v__230[0]){case"Tuple2":return Tuple2$k_v__230[2]};throw "Non-exhaustive pattern match in case"}();return fixUp_29(RBNode_2(t_226[1])(k__231)(v__232)(t_226[4])(deleteMin_42(t_226[5])))}()};throw "Non-exhaustive pattern match in case"}()}
45−function delGT_213(t_237){return function(){switch(t_237[0]){case"RBEmpty":return raise_4(Value.str("delGT called on a RBEmpty"));case"RBNode":return fixUp_29(RBNode_2(t_237[1])(t_237[2])(t_237[3])(t_237[4])(del_214(t_237[5])))};throw "Non-exhaustive pattern match in case"}()}
46−function del_214(t_243){return function(){switch(t_243[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return((compare(k_207)(t_243[2])[0]==='LT')?delLT_211(t_243):function(){var t__245=(isRedLeft_34(t_243)?rotateRight_23(t_243):t_243);return(eq_and_noRightNode_209(t__245)?RBEmpty_3:function(){var t_246=moveRedRightIfNeeded_41(t_246);return(eq_210(t_246)?delEQ_212(t_246):delGT_213(t_246))}())}())};throw "Non-exhaustive pattern match in case"}()};return(not(invariants_hold_17(t_208))?raise_4(Value.str("invariants broken before remove")):function(){var t__247=ensureBlackRoot_30(del_214(t_208));return(invariants_hold_17(t__247)?t__247:raise_4(Value.str("invariants broken after remove")))}())}()}}
47−function fold_45(f_248){return function(acc_249){return function(t_250){return function(){switch(t_250[0]){case"RBEmpty":return acc_249;case"RBNode":return fold_45(f_248)(f_248(t_250[2])(t_250[3])(fold_45(f_248)(acc_249)(t_250[4])))(t_250[5])};throw "Non-exhaustive pattern match in case"}()}}};return {empty:empty_5,lookup:lookup_20,member:member_21,insert:insert_31,singleton:singleton_32,remove:remove_44,fold:fold_45}}();Elm.main=function(){return Elm.Dict.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Dict module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>EQ, GT, LT, console.log, fst, snd</span>');document.body.innerHTML=Text.monospace(msg);throw e}}
1+
2+try{
3+
4+for(var i in Elm) { this[i] = Elm[i]; }
5+if (Elm.Dict) throw "Module name collision, 'Dict' is already defined.";
6+Elm.Dict=function(){
7+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
8+ var hiddenVars=[];
9+ for(var i in Elm.Prelude){
10+ if (hiddenVars.indexOf(i) >= 0) continue;
11+ this[i]=Elm.Prelude[i];}
12+ try{if (!(Elm.Maybe instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Maybe' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
13+ var isJust=Elm.Maybe.isJust;
14+ var Red_0=["Red"];
15+ var Black_1=["Black"];
16+ function RBNode_2(a1){
17+ return function(a2){
18+ return function(a3){
19+ return function(a4){
20+ return function(a5){
21+ return ["RBNode",a1,a2,a3,a4,a5];};};};};};
22+ var RBEmpty_3=["RBEmpty"];
23+ var empty_4=RBEmpty_3;
24+ var raise_5=console.log;
25+ function min_6(t_43){
26+ return function(){
27+ switch(t_43[0]){
28+ case "RBEmpty":
29+ return raise_5(Value.str("(min RBEmpty) is not defined"));
30+ case "RBNode":
31+ switch(t_43[4][0]){
32+ case "RBEmpty":
33+ return ["Tuple2",t_43[2],t_43[3]];
34+ }
35+ return min_6(t_43[4]);
36+ }
37+ throw "Non-exhaustive pattern match in case";}();};
38+ function lookup_7(k_47){
39+ return function(t_48){
40+ return function(){
41+ switch(t_48[0]){
42+ case "RBEmpty":
43+ return Nothing;
44+ case "RBNode":
45+ return function(){
46+ var case6=compare(k_47)(t_48[2]);
47+ switch(case6[0]){
48+ case "EQ":
49+ return Just(t_48[3]);
50+ case "GT":
51+ return lookup_7(k_47)(t_48[5]);
52+ case "LT":
53+ return lookup_7(k_47)(t_48[4]);
54+ }
55+ throw "Non-exhaustive pattern match in case";}();
56+ }
57+ throw "Non-exhaustive pattern match in case";}();};};
58+ function findWithDefault_8(base_53){
59+ return function(k_54){
60+ return function(t_55){
61+ return function(){
62+ switch(t_55[0]){
63+ case "RBEmpty":
64+ return base_53;
65+ case "RBNode":
66+ return function(){
67+ var case6=compare(k_54)(t_55[2]);
68+ switch(case6[0]){
69+ case "EQ":
70+ return t_55[3];
71+ case "GT":
72+ return findWithDefault_8(base_53)(k_54)(t_55[5]);
73+ case "LT":
74+ return findWithDefault_8(base_53)(k_54)(t_55[4]);
75+ }
76+ throw "Non-exhaustive pattern match in case";}();
77+ }
78+ throw "Non-exhaustive pattern match in case";}();};};};
79+ function find_9(k_60){
80+ return function(t_61){
81+ return function(){
82+ switch(t_61[0]){
83+ case "RBEmpty":
84+ return raise_5(Value.str("Key was not found in dictionary!"));
85+ case "RBNode":
86+ return function(){
87+ var case6=compare(k_60)(t_61[2]);
88+ switch(case6[0]){
89+ case "EQ":
90+ return t_61[3];
91+ case "GT":
92+ return find_9(k_60)(t_61[5]);
93+ case "LT":
94+ return find_9(k_60)(t_61[4]);
95+ }
96+ throw "Non-exhaustive pattern match in case";}();
97+ }
98+ throw "Non-exhaustive pattern match in case";}();};};
99+ function member_10(k_66){
100+ return function(t_67){
101+ return isJust(lookup_7(k_66)(t_67));};};
102+ function rotateLeft_11(t_68){
103+ return function(){
104+ switch(t_68[0]){
105+ case "RBNode":
106+ switch(t_68[5][0]){
107+ case "RBNode":
108+ return RBNode_2(t_68[1])(t_68[5][2])(t_68[5][3])(RBNode_2(Red_0)(t_68[2])(t_68[3])(t_68[4])(t_68[5][4]))(t_68[5][5]);
109+ }break;
110+ }
111+ return raise_5(Value.str("rotateLeft of a node without enough children"));}();};
112+ function rotateRight_12(t_78){
113+ return function(){
114+ switch(t_78[0]){
115+ case "RBNode":
116+ switch(t_78[4][0]){
117+ case "RBNode":
118+ return RBNode_2(t_78[1])(t_78[4][2])(t_78[4][3])(t_78[4][4])(RBNode_2(Red_0)(t_78[2])(t_78[3])(t_78[4][5])(t_78[5]));
119+ }break;
120+ }
121+ return raise_5(Value.str("rotateRight of a node without enough children"));}();};
122+ function rotateLeftIfNeeded_13(t_88){
123+ return function(){
124+ switch(t_88[0]){
125+ case "RBNode":
126+ switch(t_88[5][0]){
127+ case "RBNode":
128+ switch(t_88[5][1][0]){
129+ case "Red":
130+ return rotateLeft_11(t_88);
131+ }break;
132+ }break;
133+ }
134+ return t_88;}();};
135+ function rotateRightIfNeeded_14(t_89){
136+ return function(){
137+ switch(t_89[0]){
138+ case "RBNode":
139+ switch(t_89[4][0]){
140+ case "RBNode":
141+ switch(t_89[4][1][0]){
142+ case "Red":
143+ switch(t_89[4][4][0]){
144+ case "RBNode":
145+ switch(t_89[4][4][1][0]){
146+ case "Red":
147+ return rotateRight_12(t_89);
148+ }break;
149+ }break;
150+ }break;
151+ }break;
152+ }
153+ return t_89;}();};
154+ function otherColor_15(c_90){
155+ return function(){
156+ switch(c_90[0]){
157+ case "Black":
158+ return Red_0;
159+ case "Red":
160+ return Black_1;
161+ }
162+ throw "Non-exhaustive pattern match in case";}();};
163+ function color_flip_16(t_91){
164+ return function(){
165+ switch(t_91[0]){
166+ case "RBNode":
167+ switch(t_91[4][0]){
168+ case "RBNode":
169+ switch(t_91[5][0]){
170+ case "RBNode":
171+ return RBNode_2(otherColor_15(t_91[1]))(t_91[2])(t_91[3])(RBNode_2(otherColor_15(t_91[4][1]))(t_91[4][2])(t_91[4][3])(t_91[4][4])(t_91[4][5]))(RBNode_2(otherColor_15(t_91[5][1]))(t_91[5][2])(t_91[5][3])(t_91[5][4])(t_91[5][5]));
172+ }break;
173+ }break;
174+ }
175+ return raise_5(Value.str("color_flip called on a RBEmpty or RBNode with a RBEmpty child"));}();};
176+ function color_flipIfNeeded_17(t_105){
177+ return function(){
178+ switch(t_105[0]){
179+ case "RBNode":
180+ switch(t_105[4][0]){
181+ case "RBNode":
182+ switch(t_105[4][1][0]){
183+ case "Red":
184+ switch(t_105[5][0]){
185+ case "RBNode":
186+ switch(t_105[5][1][0]){
187+ case "Red":
188+ return color_flip_16(t_105);
189+ }break;
190+ }break;
191+ }break;
192+ }break;
193+ }
194+ return t_105;}();};
195+ function fixUp_18(t_106){
196+ return color_flipIfNeeded_17(rotateRightIfNeeded_14(rotateLeftIfNeeded_13(t_106)));};
197+ function ensureBlackRoot_19(t_107){
198+ return function(){
199+ switch(t_107[0]){
200+ case "RBNode":
201+ switch(t_107[1][0]){
202+ case "Red":
203+ return RBNode_2(Black_1)(t_107[2])(t_107[3])(t_107[4])(t_107[5]);
204+ }break;
205+ }
206+ return t_107;}();};
207+ function insert_20(k_112){
208+ return function(v_113){
209+ return function(t_114){
210+ return function(){
211+ function ins_115(t_116){
212+ return function(){
213+ switch(t_116[0]){
214+ case "RBEmpty":
215+ return RBNode_2(Red_0)(k_112)(v_113)(RBEmpty_3)(RBEmpty_3);
216+ case "RBNode":
217+ return function(){
218+ var h_122=function(){
219+ var case6=compare(k_112)(t_116[2]);
220+ switch(case6[0]){
221+ case "EQ":
222+ return RBNode_2(t_116[1])(t_116[2])(v_113)(t_116[4])(t_116[5]);
223+ case "GT":
224+ return RBNode_2(t_116[1])(t_116[2])(t_116[3])(t_116[4])(ins_115(t_116[5]));
225+ case "LT":
226+ return RBNode_2(t_116[1])(t_116[2])(t_116[3])(ins_115(t_116[4]))(t_116[5]);
227+ }
228+ throw "Non-exhaustive pattern match in case";}();
229+ return fixUp_18(h_122);}();
230+ }
231+ throw "Non-exhaustive pattern match in case";}();};
232+ return ensureBlackRoot_19(ins_115(t_114));}();};};};
233+ function singleton_21(k_123){
234+ return function(v_124){
235+ return insert_20(k_123)(v_124)(RBEmpty_3);};};
236+ function isRed_22(t_125){
237+ return function(){
238+ switch(t_125[0]){
239+ case "RBNode":
240+ switch(t_125[1][0]){
241+ case "Red":
242+ return true;
243+ }break;
244+ }
245+ return false;}();};
246+ function isRedLeft_23(t_126){
247+ return function(){
248+ switch(t_126[0]){
249+ case "RBNode":
250+ switch(t_126[4][0]){
251+ case "RBNode":
252+ switch(t_126[4][1][0]){
253+ case "Red":
254+ return true;
255+ }break;
256+ }break;
257+ }
258+ return false;}();};
259+ function isRedLeftLeft_24(t_127){
260+ return function(){
261+ switch(t_127[0]){
262+ case "RBNode":
263+ switch(t_127[4][0]){
264+ case "RBNode":
265+ switch(t_127[4][4][0]){
266+ case "RBNode":
267+ switch(t_127[4][4][1][0]){
268+ case "Red":
269+ return true;
270+ }break;
271+ }break;
272+ }break;
273+ }
274+ return false;}();};
275+ function isRedRight_25(t_128){
276+ return function(){
277+ switch(t_128[0]){
278+ case "RBNode":
279+ switch(t_128[5][0]){
280+ case "RBNode":
281+ switch(t_128[5][1][0]){
282+ case "Red":
283+ return true;
284+ }break;
285+ }break;
286+ }
287+ return false;}();};
288+ function isRedRightLeft_26(t_129){
289+ return function(){
290+ switch(t_129[0]){
291+ case "RBNode":
292+ switch(t_129[5][0]){
293+ case "RBNode":
294+ switch(t_129[5][4][0]){
295+ case "RBNode":
296+ switch(t_129[5][4][1][0]){
297+ case "Red":
298+ return true;
299+ }break;
300+ }break;
301+ }break;
302+ }
303+ return false;}();};
304+ function moveRedLeft_27(t_130){
305+ return function(){
306+ var t__131=color_flip_16(t_130);
307+ return function(){
308+ switch(t__131[0]){
309+ case "RBNode":
310+ return function(){
311+ switch(t__131[5][0]){
312+ case "RBNode":
313+ switch(t__131[5][4][0]){
314+ case "RBNode":
315+ switch(t__131[5][4][1][0]){
316+ case "Red":
317+ return color_flip_16(rotateLeft_11(RBNode_2(t__131[1])(t__131[2])(t__131[3])(t__131[4])(rotateRight_12(t__131[5]))));
318+ }break;
319+ }break;
320+ }
321+ return t__131;}();
322+ }
323+ return t__131;}();}();};
324+ function moveRedRight_28(t_137){
325+ return function(){
326+ var t__138=color_flip_16(t_137);
327+ return (isRedLeftLeft_24(t__138)?color_flip_16(rotateRight_12(t__138)):t__138);}();};
328+ function moveRedLeftIfNeeded_29(t_139){
329+ return ((not(isRedLeft_23(t_139))&&not(isRedLeftLeft_24(t_139)))?moveRedLeft_27(t_139):t_139);};
330+ function moveRedRightIfNeeded_30(t_140){
331+ return ((not(isRedRight_25(t_140))&&not(isRedRightLeft_26(t_140)))?moveRedRight_28(t_140):t_140);};
332+ function deleteMin_31(t_141){
333+ return function(){
334+ function del_142(t_143){
335+ return function(){
336+ switch(t_143[0]){
337+ case "RBNode":
338+ switch(t_143[4][0]){
339+ case "RBEmpty":
340+ return RBEmpty_3;
341+ }break;
342+ }
343+ return function(){
344+ var t__144=moveRedLeftIfNeeded_29(t_143);
345+ return function(){
346+ switch(t__144[0]){
347+ case "RBEmpty":
348+ return RBEmpty_3;
349+ case "RBNode":
350+ return fixUp_18(RBNode_2(t__144[1])(t__144[2])(t__144[3])(del_142(t__144[4]))(t__144[5]));
351+ }
352+ throw "Non-exhaustive pattern match in case";}();}();}();};
353+ return ensureBlackRoot_19(del_142(t_141));}();};
354+ function remove_32(k_150){
355+ return function(t_151){
356+ return function(){
357+ function eq_and_noRightNode_152(t_153){
358+ return function(){
359+ switch(t_153[0]){
360+ case "RBNode":
361+ switch(t_153[5][0]){
362+ case "RBEmpty":
363+ return eq(k_150,t_153[2]);
364+ }break;
365+ }
366+ return false;}();};
367+ return function(){
368+ function eq_155(t_156){
369+ return function(){
370+ switch(t_156[0]){
371+ case "RBNode":
372+ return eq(k_150,t_156[2]);
373+ }
374+ return false;}();};
375+ return function(){
376+ function delLT_158(t_159){
377+ return function(){
378+ var t__160=moveRedLeftIfNeeded_29(t_159);
379+ return function(){
380+ switch(t__160[0]){
381+ case "RBEmpty":
382+ return raise_5(Value.str("delLT on RBEmpty"));
383+ case "RBNode":
384+ return fixUp_18(RBNode_2(t__160[1])(t__160[2])(t__160[3])(del(t__160[4]))(t__160[5]));
385+ }
386+ throw "Non-exhaustive pattern match in case";}();}();};
387+ return function(){
388+ function delEQ_166(t_167){
389+ return function(){
390+ switch(t_167[0]){
391+ case "RBEmpty":
392+ return raise_5(Value.str("delEQ called on a RBEmpty"));
393+ case "RBNode":
394+ return function(){
395+ var Tuple2$k_v__171=min_6(t_167[5]);
396+ var k__172=function(){
397+ switch(Tuple2$k_v__171[0]){
398+ case "Tuple2":
399+ return Tuple2$k_v__171[1];
400+ }
401+ throw "Non-exhaustive pattern match in case";}();
402+ var v__173=function(){
403+ switch(Tuple2$k_v__171[0]){
404+ case "Tuple2":
405+ return Tuple2$k_v__171[2];
406+ }
407+ throw "Non-exhaustive pattern match in case";}();
408+ return fixUp_18(RBNode_2(t_167[1])(k__172)(v__173)(t_167[4])(deleteMin_31(t_167[5])));}();
409+ }
410+ throw "Non-exhaustive pattern match in case";}();};
411+ return function(){
412+ function delGT_178(t_179){
413+ return function(){
414+ switch(t_179[0]){
415+ case "RBEmpty":
416+ return raise_5(Value.str("delGT called on a RBEmpty"));
417+ case "RBNode":
418+ return fixUp_18(RBNode_2(t_179[1])(t_179[2])(t_179[3])(t_179[4])(del(t_179[5])));
419+ }
420+ throw "Non-exhaustive pattern match in case";}();};
421+ return function(){
422+ function del_185(t_186){
423+ return function(){
424+ switch(t_186[0]){
425+ case "RBEmpty":
426+ return RBEmpty_3;
427+ case "RBNode":
428+ return ((compare(k_150)(t_186[2])[0] === 'LT')?delLT_158(t_186):function(){
429+ var t__188=(isRedLeft_23(t_186)?rotateRight_12(t_186):t_186);
430+ return (eq_and_noRightNode_152(t__188)?RBEmpty_3:function(){
431+ var t_189=moveRedRightIfNeeded_30(t_189);
432+ return (eq_155(t_189)?delEQ_166(t_189):delGT_178(t_189));}());}());
433+ }
434+ throw "Non-exhaustive pattern match in case";}();};
435+ return ensureBlackRoot_19(del_185(t_151));}();}();}();}();}();}();};};
436+ function map_33(f_190){
437+ return function(t_191){
438+ return function(){
439+ switch(t_191[0]){
440+ case "RBEmpty":
441+ return RBEmpty_3;
442+ case "RBNode":
443+ return RBNode_2(t_191[1])(t_191[2])(f_190(t_191[3]))(map_33(f_190)(t_191[4]))(map_33(f_190)(t_191[5]));
444+ }
445+ throw "Non-exhaustive pattern match in case";}();};};
446+ function foldl_34(f_197){
447+ return function(acc_198){
448+ return function(t_199){
449+ return function(){
450+ switch(t_199[0]){
451+ case "RBEmpty":
452+ return acc_198;
453+ case "RBNode":
454+ return foldl_34(f_197)(f_197(t_199[2])(t_199[3])(foldl_34(f_197)(acc_198)(t_199[4])))(t_199[5]);
455+ }
456+ throw "Non-exhaustive pattern match in case";}();};};};
457+ function foldr_35(f_204){
458+ return function(acc_205){
459+ return function(t_206){
460+ return function(){
461+ switch(t_206[0]){
462+ case "RBEmpty":
463+ return acc_205;
464+ case "RBNode":
465+ return foldr_35(f_204)(f_204(t_206[2])(t_206[3])(foldr_35(f_204)(acc_205)(t_206[5])))(t_206[4]);
466+ }
467+ throw "Non-exhaustive pattern match in case";}();};};};
468+ function union_36(t1_211){
469+ return function(t2_212){
470+ return foldl_34(insert_20)(t2_212)(t1_211);};};
471+ function intersect_37(t1_213){
472+ return function(t2_214){
473+ return foldl_34(function(k_215){
474+ return function(v_216){
475+ return function(t_217){
476+ return (member_10(k_215)(t2_214)?insert_20(k_215)(v_216)(t_217):t_217);};};})(empty_4)(t1_213);};};
477+ function diff_38(t1_218){
478+ return function(t2_219){
479+ return foldl_34(function(k_220){
480+ return function(__221){
481+ return function(t_222){
482+ return remove_32(k_220)(t_222);};};})(t1_218)(t2_219);};};
483+ function keys_39(t_223){
484+ return foldl_34(function(k_224){
485+ return function(__225){
486+ return function(acc_226){
487+ return ["Cons",k_224,acc_226];};};})(["Nil"])(t_223);};
488+ function values_40(t_227){
489+ return foldl_34(function(__228){
490+ return function(x_229){
491+ return function(y_230){
492+ return ["Cons",x_229,y_230];};};})(["Nil"])(t_227);};
493+ function toList_41(t_231){
494+ return foldl_34(function(k_232){
495+ return function(v_233){
496+ return function(acc_234){
497+ return ["Cons",["Tuple2",k_232,v_233],acc_234];};};})(["Nil"])(t_231);};
498+ function fromList_42(assocs_235){
499+ return List.foldl(uncurry(insert_20))(empty_4)(assocs_235);};
500+ return {empty:empty_4,lookup:lookup_7,findWithDefault:findWithDefault_8,find:find_9,member:member_10,insert:insert_20,singleton:singleton_21,remove:remove_32,map:map_33,foldl:foldl_34,foldr:foldr_35,union:union_36,intersect:intersect_37,diff:diff_38,keys:keys_39,values:values_40,toList:toList_41,fromList:fromList_42};}();
501+Elm.main=function(){
502+ return Elm.Dict.main;};
503+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Dict module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}
core-js/Set.js+43−3
@@ -1,3 +1,43 @@
1−try{if(Elm.Set)throw "Module name collision, 'Set' is already defined.";Elm.Set=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Dict instanceof Object))throw 'module not found'}catch(e){throw "Module 'Dict' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var Dict=Elm.Dict,empty_0=Dict.empty,remove_3=Dict.remove,member_4=Dict.member
2−function singleton_1(k_5){return Dict.singleton(k_5)(["Tuple0"])}
3−function insert_2(k_6){return Dict.insert(k_6)(["Tuple0"])};return {empty:empty_0,singleton:singleton_1,insert:insert_2,remove:remove_3,member:member_4}}();Elm.main=function(){return Elm.Set.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Set module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>Dict.empty, Dict.insert, Dict.member, Dict.remove, Dict.singleton</span>');document.body.innerHTML=Text.monospace(msg);throw e}}
1+
2+try{
3+
4+for(var i in Elm) { this[i] = Elm[i]; }
5+if (Elm.Set) throw "Module name collision, 'Set' is already defined.";
6+Elm.Set=function(){
7+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
8+ var hiddenVars=[];
9+ for(var i in Elm.Prelude){
10+ if (hiddenVars.indexOf(i) >= 0) continue;
11+ this[i]=Elm.Prelude[i];}
12+ var empty_0=Dict.empty;
13+ var remove_3=Dict.remove;
14+ var member_4=Dict.member;
15+ var union_5=Dict.union;
16+ var intersect_6=Dict.intersect;
17+ var diff_7=Dict.diff;
18+ var toList_8=Dict.keys;
19+ var fromList_9=List.foldl(function(k_15){
20+ return function(t_16){
21+ return Dict.insert(k_15)(["Tuple0"])(t_16);};})(empty_0);
22+ function singleton_1(k_13){
23+ return Dict.singleton(k_13)(["Tuple0"]);};
24+ function insert_2(k_14){
25+ return Dict.insert(k_14)(["Tuple0"]);};
26+ function foldl_10(f_17){
27+ return Dict.foldl(function(k_18){
28+ return function(v_19){
29+ return function(b_20){
30+ return f_17(k_18)(b_20);};};});};
31+ function foldr_11(f_21){
32+ return Dict.foldr(function(k_22){
33+ return function(v_23){
34+ return function(b_24){
35+ return f_21(k_22)(b_24);};};});};
36+ function map_12(f_25){
37+ return function(t_26){
38+ return function(x){
39+ return fromList_9(List.map(f_25)(x));}(toList_8(t_26));};};
40+ return {empty:empty_0,singleton:singleton_1,insert:insert_2,remove:remove_3,member:member_4,union:union_5,intersect:intersect_6,diff:diff_7,toList:toList_8,fromList:fromList_9,foldl:foldl_10,foldr:foldr_11,map:map_12};}();
41+Elm.main=function(){
42+ return Elm.Set.main;};
43+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Set module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}
elm/elm-runtime-0.5.0.js+734−62
@@ -955,55 +955,551 @@ Elm.List = function() {
955955 sort:sort,
956956 take:take,
957957 drop:drop};
958−}();try{if(Elm.Dict)throw "Module name collision, 'Dict' is already defined.";Elm.Dict=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Data.Maybe instanceof Object))throw 'module not found'}catch(e){throw "Module 'Data.Maybe' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var isJust=Elm.Data.Maybe.isJust,Red_0=["Red"],Black_1=["Black"]
959−function RBNode_2(a1){return function(a2){return function(a3){return function(a4){return function(a5){return ["RBNode",a1,a2,a3,a4,a5]}}}}};var RBEmpty_3=["RBEmpty"],raise_4=console.log,empty_5=RBEmpty_3
960−function equal_pathLen_6(t_46){return function(){function path_numBlacks_47(t_48){return function(){switch(t_48[0]){case"RBEmpty":return 1;case"RBNode":return function(){var bl_52=path_numBlacks_47(t_48[4]),br_53=path_numBlacks_47(t_48[5]);return((not(eq(bl_52,br_53))||(eq(bl_52,-1)||eq(br_53,-1)))?-1:(bl_52+(eq(t_48[1],Red_0)?0:1)))}()};throw "Non-exhaustive pattern match in case"}()};return not(eq(-1,path_numBlacks_47(t_46)))}()}
961−function rootBlack_7(t_54){return function(){switch(t_54[0]){case"RBEmpty":return true;case"RBNode":switch(t_54[1][0]){case"Black":return true};break};return false}()}
962−function redBlack_children_8(t_55){return function(){switch(t_55[0]){case"RBEmpty":return true;case"RBNode":switch(t_55[1][0]){case"Red":switch(t_55[4][0]){case"RBNode":switch(t_55[4][1][0]){case"Red":return false};break};switch(t_55[5][0]){case"RBNode":switch(t_55[5][1][0]){case"Red":return false};break};break};return(redBlack_children_8(t_55[4])&&redBlack_children_8(t_55[5]))};throw "Non-exhaustive pattern match in case"}()}
963−function findExtreme_9(f_58){return function(t_59){return function(){switch(t_59[0]){case"RBEmpty":return Nothing;case"RBNode":return function(){var case6=findExtreme_9(f_58)(f_58(["Tuple2",t_59[4],t_59[5]]));switch(case6[0]){case"Just":return Just(case6[1]);case"Nothing":return Just(t_59[2])};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
964−function findminRbt_10(t_65){return findExtreme_9(fst)(t_65)}
965−function findmaxRbt_11(t_66){return findExtreme_9(snd)(t_66)}
966−function optionRelation_12(f_67){return function(u_68){return function(xo_69){return function(yo_70){return function(){var case0=["Tuple2",xo_69,yo_70];switch(case0[0]){case"Tuple2":switch(case0[1][0]){case"Nothing":return u_68};switch(case0[2][0]){case"Nothing":return u_68};switch(case0[1][0]){case"Just":switch(case0[2][0]){case"Just":return f_67(case0[1][1])(case0[2][1])};break};break};throw "Non-exhaustive pattern match in case"}()}}}}
967−function olt_13(xo_73){return function(yo_74){return optionRelation_12(function(x_75){return function(y_76){return(compare(x_75)(y_76)[0]==='LT')}})(true)(xo_73)(yo_74)}}
968−function olte_14(xo_77){return function(yo_78){return optionRelation_12(function(x_79){return function(y_80){return function(){var ord=compare(x_79)(y_80)[0];return ord==='LT'||ord==='EQ'}()}})(true)(xo_77)(yo_78)}}
969−function ordered_15(t_81){return function(){switch(t_81[0]){case"RBEmpty":return true;case"RBNode":return function(){var Tuple2$lmaxrmin_87=["Tuple2",findmaxRbt_11(t_81[4]),findminRbt_10(t_81[5])],lmax_88=function(){switch(Tuple2$lmaxrmin_87[0]){case"Tuple2":return Tuple2$lmaxrmin_87[1]};throw "Non-exhaustive pattern match in case"}(),rmin_89=function(){switch(Tuple2$lmaxrmin_87[0]){case"Tuple2":return Tuple2$lmaxrmin_87[2]};throw "Non-exhaustive pattern match in case"}();return(olte_14(lmax_88)(Just(t_81[2]))&&(olte_14(Just(t_81[2]))(rmin_89)&&(ordered_15(t_81[4])&&ordered_15(t_81[5]))))}()};throw "Non-exhaustive pattern match in case"}()}
970−function leftLeaning_16(t_94){return function(){switch(t_94[0]){case"RBEmpty":return true;case"RBNode":switch(t_94[4][0]){case"RBEmpty":switch(t_94[5][0]){case"RBNode":switch(t_94[5][1][0]){case"Red":return false};break};break;case"RBNode":switch(t_94[4][1][0]){case"Black":switch(t_94[5][0]){case"RBNode":switch(t_94[5][1][0]){case"Red":return false};break};break};break};return(leftLeaning_16(t_94[4])&&leftLeaning_16(t_94[5]))};throw "Non-exhaustive pattern match in case"}()}
971−function invariants_hold_17(t_97){return(ordered_15(t_97)&&(rootBlack_7(t_97)&&(redBlack_children_8(t_97)&&(equal_pathLen_6(t_97)&&leftLeaning_16(t_97)))))}
972−function min_18(t_98){return function(){switch(t_98[0]){case"RBEmpty":return console.log(Value.str("(min RBEmpty) is not defined"));case"RBNode":switch(t_98[4][0]){case"RBEmpty":return ["Tuple2",t_98[2],t_98[3]]};return min_18(t_98[4])};throw "Non-exhaustive pattern match in case"}()}
973−function max_19(t_102){return function(){switch(t_102[0]){case"RBEmpty":return console.log(Value.str("(max RBEmpty) is not defined"));case"RBNode":switch(t_102[5][0]){case"RBEmpty":return ["Tuple2",t_102[2],t_102[3]]};return max_19(t_102[5])};throw "Non-exhaustive pattern match in case"}()}
974−function lookup_20(k_106){return function(t_107){return function(){switch(t_107[0]){case"RBEmpty":return Nothing;case"RBNode":return function(){var case6=compare(k_106)(t_107[2]);switch(case6[0]){case"EQ":return Just(t_107[3]);case"GT":return lookup_20(k_106)(t_107[5]);case"LT":return lookup_20(k_106)(t_107[4])};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
975−function member_21(k_112){return function(t_113){return isJust(lookup_20(k_112)(t_113))}}
976−function rotateLeft_22(t_114){return function(){switch(t_114[0]){case"RBNode":switch(t_114[5][0]){case"RBNode":return RBNode_2(t_114[1])(t_114[5][2])(t_114[5][3])(RBNode_2(Red_0)(t_114[2])(t_114[3])(t_114[4])(t_114[5][4]))(t_114[5][5])};break};return raise_4(Value.str("rotateLeft of a node without enough children"))}()}
977−function rotateRight_23(t_124){return function(){switch(t_124[0]){case"RBNode":switch(t_124[4][0]){case"RBNode":return RBNode_2(t_124[1])(t_124[4][2])(t_124[4][3])(t_124[4][4])(RBNode_2(Red_0)(t_124[2])(t_124[3])(t_124[4][5])(t_124[5]))};break};return raise_4(Value.str("rotateRight of a node without enough children"))}()}
978−function rotateLeftIfNeeded_24(t_134){return function(){switch(t_134[0]){case"RBNode":switch(t_134[5][0]){case"RBNode":switch(t_134[5][1][0]){case"Red":return rotateLeft_22(t_134)};break};break};return t_134}()}
979−function rotateRightIfNeeded_25(t_135){return function(){switch(t_135[0]){case"RBNode":switch(t_135[4][0]){case"RBNode":switch(t_135[4][1][0]){case"Red":switch(t_135[4][4][0]){case"RBNode":switch(t_135[4][4][1][0]){case"Red":return rotateRight_23(t_135)};break};break};break};break};return t_135}()}
980−function otherColor_26(c_136){return function(){switch(c_136[0]){case"Black":return Red_0;case"Red":return Black_1};throw "Non-exhaustive pattern match in case"}()}
981−function color_flip_27(t_137){return function(){switch(t_137[0]){case"RBNode":switch(t_137[4][0]){case"RBNode":switch(t_137[5][0]){case"RBNode":return RBNode_2(otherColor_26(t_137[1]))(t_137[2])(t_137[3])(RBNode_2(otherColor_26(t_137[4][1]))(t_137[4][2])(t_137[4][3])(t_137[4][4])(t_137[4][5]))(RBNode_2(otherColor_26(t_137[5][1]))(t_137[5][2])(t_137[5][3])(t_137[5][4])(t_137[5][5]))};break};break};return raise_4(Value.str("color_flip called on a RBEmpty or RBNode with a RBEmpty child"))}()}
982−function color_flipIfNeeded_28(t_151){return function(){switch(t_151[0]){case"RBNode":switch(t_151[4][0]){case"RBNode":switch(t_151[4][1][0]){case"Red":switch(t_151[5][0]){case"RBNode":switch(t_151[5][1][0]){case"Red":return color_flip_27(t_151)};break};break};break};break};return t_151}()}
983−function fixUp_29(t_152){return color_flipIfNeeded_28(rotateRightIfNeeded_25(rotateLeftIfNeeded_24(t_152)))}
984−function ensureBlackRoot_30(t_153){return function(){switch(t_153[0]){case"RBNode":switch(t_153[1][0]){case"Red":return RBNode_2(Black_1)(t_153[2])(t_153[3])(t_153[4])(t_153[5])};break};return t_153}()}
985−function insert_31(k_158){return function(v_159){return function(t_160){return function(){function ins_161(t_162){return function(){switch(t_162[0]){case"RBEmpty":return RBNode_2(Red_0)(k_158)(v_159)(RBEmpty_3)(RBEmpty_3);case"RBNode":return function(){var h_168=function(){var case6=compare(k_158)(t_162[2]);switch(case6[0]){case"EQ":return RBNode_2(t_162[1])(t_162[2])(v_159)(t_162[4])(t_162[5]);case"GT":return RBNode_2(t_162[1])(t_162[2])(t_162[3])(t_162[4])(ins_161(t_162[5]));case"LT":return RBNode_2(t_162[1])(t_162[2])(t_162[3])(ins_161(t_162[4]))(t_162[5])};throw "Non-exhaustive pattern match in case"}();return fixUp_29(h_168)}()};throw "Non-exhaustive pattern match in case"}()};return(not(invariants_hold_17(t_160))?raise_4(Value.str("invariants broken before insert")):function(){var new_t_169=ensureBlackRoot_30(ins_161(t_160));return(not(invariants_hold_17(new_t_169))?raise_4(Value.str("invariants broken after insert")):new_t_169)}())}()}}}
986−function singleton_32(k_170){return function(v_171){return insert_31(k_170)(v_171)(RBEmpty_3)}}
987−function isRed_33(t_172){return function(){switch(t_172[0]){case"RBNode":switch(t_172[1][0]){case"Red":return true};break};return false}()}
988−function isRedLeft_34(t_173){return function(){switch(t_173[0]){case"RBNode":switch(t_173[4][0]){case"RBNode":switch(t_173[4][1][0]){case"Red":return true};break};break};return false}()}
989−function isRedLeftLeft_35(t_174){return function(){switch(t_174[0]){case"RBNode":switch(t_174[4][0]){case"RBNode":switch(t_174[4][4][0]){case"RBNode":switch(t_174[4][4][1][0]){case"Red":return true};break};break};break};return false}()}
990−function isRedRight_36(t_175){return function(){switch(t_175[0]){case"RBNode":switch(t_175[5][0]){case"RBNode":switch(t_175[5][1][0]){case"Red":return true};break};break};return false}()}
991−function isRedRightLeft_37(t_176){return function(){switch(t_176[0]){case"RBNode":switch(t_176[5][0]){case"RBNode":switch(t_176[5][4][0]){case"RBNode":switch(t_176[5][4][1][0]){case"Red":return true};break};break};break};return false}()}
992−function moveRedLeft_38(t_177){return function(){var t__178=color_flip_27(t_177);return function(){switch(t__178[0]){case"RBNode":return function(){switch(t__178[5][0]){case"RBNode":switch(t__178[5][4][0]){case"RBNode":switch(t__178[5][4][1][0]){case"Red":return color_flip_27(rotateLeft_22(RBNode_2(t__178[1])(t__178[2])(t__178[3])(t__178[4])(rotateRight_23(t__178[5]))))};break};break};return t__178}()};return t__178}()}()}
993−function moveRedRight_39(t_184){return function(){var t__185=color_flip_27(t_184);return(isRedLeftLeft_35(t__185)?color_flip_27(rotateRight_23(t__185)):t__185)}()}
994−function moveRedLeftIfNeeded_40(t_186){return((not(isRedLeft_34(t_186))&&not(isRedLeftLeft_35(t_186)))?moveRedLeft_38(t_186):t_186)}
995−function moveRedRightIfNeeded_41(t_187){return((not(isRedRight_36(t_187))&&not(isRedRightLeft_37(t_187)))?moveRedRight_39(t_187):t_187)}
996−function deleteMin_42(t_188){return function(){function del_189(t_190){return function(){switch(t_190[0]){case"RBNode":switch(t_190[4][0]){case"RBEmpty":return RBEmpty_3};break};return function(){var t__191=moveRedLeftIfNeeded_40(t_190);return function(){switch(t__191[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return fixUp_29(RBNode_2(t__191[1])(t__191[2])(t__191[3])(del_189(t__191[4]))(t__191[5]))};throw "Non-exhaustive pattern match in case"}()}()}()};return ensureBlackRoot_30(del_189(t_188))}()}
997−function deleteMax_43(t_197){return function(){function del_198(t_199){return function(){var t__200=(isRedLeft_34(t_199)?rotateRight_23(t_199):t_199);return function(){switch(t__200[0]){case"RBNode":switch(t__200[5][0]){case"RBEmpty":return RBEmpty_3};break};return function(){var t___201=moveRedRightIfNeeded_41(t__200);return function(){switch(t___201[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return fixUp_29(RBNode_2(t___201[1])(t___201[2])(t___201[3])(t___201[4])(del_198(t___201[5])))};throw "Non-exhaustive pattern match in case"}()}()}()}()};return ensureBlackRoot_30(del_198(t_197))}()}
998−function remove_44(k_207){return function(t_208){return function(){function eq_and_noRightNode_209(t_215){return function(){switch(t_215[0]){case"RBNode":switch(t_215[5][0]){case"RBEmpty":return eq(k_207,t_215[2])};break};return false}()}
999−function eq_210(t_217){return function(){switch(t_217[0]){case"RBNode":return eq(k_207,t_217[2])};return false}()}
1000−function delLT_211(t_219){return function(){var t__220=moveRedLeftIfNeeded_40(t_219);return function(){switch(t__220[0]){case"RBEmpty":return raise_4(Value.str("delLT on RBEmpty"));case"RBNode":return fixUp_29(RBNode_2(t__220[1])(t__220[2])(t__220[3])(del_214(t__220[4]))(t__220[5]))};throw "Non-exhaustive pattern match in case"}()}()}
1001−function delEQ_212(t_226){return function(){switch(t_226[0]){case"RBEmpty":return raise_4(Value.str("delEQ called on a RBEmpty"));case"RBNode":return function(){var Tuple2$k_v__230=min_18(t_226[5]),k__231=function(){switch(Tuple2$k_v__230[0]){case"Tuple2":return Tuple2$k_v__230[1]};throw "Non-exhaustive pattern match in case"}(),v__232=function(){switch(Tuple2$k_v__230[0]){case"Tuple2":return Tuple2$k_v__230[2]};throw "Non-exhaustive pattern match in case"}();return fixUp_29(RBNode_2(t_226[1])(k__231)(v__232)(t_226[4])(deleteMin_42(t_226[5])))}()};throw "Non-exhaustive pattern match in case"}()}
1002−function delGT_213(t_237){return function(){switch(t_237[0]){case"RBEmpty":return raise_4(Value.str("delGT called on a RBEmpty"));case"RBNode":return fixUp_29(RBNode_2(t_237[1])(t_237[2])(t_237[3])(t_237[4])(del_214(t_237[5])))};throw "Non-exhaustive pattern match in case"}()}
1003−function del_214(t_243){return function(){switch(t_243[0]){case"RBEmpty":return RBEmpty_3;case"RBNode":return((compare(k_207)(t_243[2])[0]==='LT')?delLT_211(t_243):function(){var t__245=(isRedLeft_34(t_243)?rotateRight_23(t_243):t_243);return(eq_and_noRightNode_209(t__245)?RBEmpty_3:function(){var t_246=moveRedRightIfNeeded_41(t_246);return(eq_210(t_246)?delEQ_212(t_246):delGT_213(t_246))}())}())};throw "Non-exhaustive pattern match in case"}()};return(not(invariants_hold_17(t_208))?raise_4(Value.str("invariants broken before remove")):function(){var t__247=ensureBlackRoot_30(del_214(t_208));return(invariants_hold_17(t__247)?t__247:raise_4(Value.str("invariants broken after remove")))}())}()}}
1004−function fold_45(f_248){return function(acc_249){return function(t_250){return function(){switch(t_250[0]){case"RBEmpty":return acc_249;case"RBNode":return fold_45(f_248)(f_248(t_250[2])(t_250[3])(fold_45(f_248)(acc_249)(t_250[4])))(t_250[5])};throw "Non-exhaustive pattern match in case"}()}}};return {empty:empty_5,lookup:lookup_20,member:member_21,insert:insert_31,singleton:singleton_32,remove:remove_44,fold:fold_45}}();Elm.main=function(){return Elm.Dict.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Dict module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>EQ, GT, LT, console.log, fst, snd</span>');document.body.innerHTML=Text.monospace(msg);throw e}}try{if(Elm.Set)throw "Module name collision, 'Set' is already defined.";Elm.Set=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Dict instanceof Object))throw 'module not found'}catch(e){throw "Module 'Dict' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var Dict=Elm.Dict,empty_0=Dict.empty,remove_3=Dict.remove,member_4=Dict.member
1005−function singleton_1(k_5){return Dict.singleton(k_5)(["Tuple0"])}
1006−function insert_2(k_6){return Dict.insert(k_6)(["Tuple0"])};return {empty:empty_0,singleton:singleton_1,insert:insert_2,remove:remove_3,member:member_4}}();Elm.main=function(){return Elm.Set.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Set module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>Dict.empty, Dict.insert, Dict.member, Dict.remove, Dict.singleton</span>');document.body.innerHTML=Text.monospace(msg);throw e}}
958+}();
959+try{
960+
961+for(var i in Elm) { this[i] = Elm[i]; }
962+if (Elm.Dict) throw "Module name collision, 'Dict' is already defined.";
963+Elm.Dict=function(){
964+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
965+ var hiddenVars=[];
966+ for(var i in Elm.Prelude){
967+ if (hiddenVars.indexOf(i) >= 0) continue;
968+ this[i]=Elm.Prelude[i];}
969+ try{if (!(Elm.Maybe instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Maybe' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
970+ var isJust=Elm.Maybe.isJust;
971+ var Red_0=["Red"];
972+ var Black_1=["Black"];
973+ function RBNode_2(a1){
974+ return function(a2){
975+ return function(a3){
976+ return function(a4){
977+ return function(a5){
978+ return ["RBNode",a1,a2,a3,a4,a5];};};};};};
979+ var RBEmpty_3=["RBEmpty"];
980+ var empty_4=RBEmpty_3;
981+ var raise_5=console.log;
982+ function min_6(t_43){
983+ return function(){
984+ switch(t_43[0]){
985+ case "RBEmpty":
986+ return raise_5(Value.str("(min RBEmpty) is not defined"));
987+ case "RBNode":
988+ switch(t_43[4][0]){
989+ case "RBEmpty":
990+ return ["Tuple2",t_43[2],t_43[3]];
991+ }
992+ return min_6(t_43[4]);
993+ }
994+ throw "Non-exhaustive pattern match in case";}();};
995+ function lookup_7(k_47){
996+ return function(t_48){
997+ return function(){
998+ switch(t_48[0]){
999+ case "RBEmpty":
1000+ return Nothing;
1001+ case "RBNode":
1002+ return function(){
1003+ var case6=compare(k_47)(t_48[2]);
1004+ switch(case6[0]){
1005+ case "EQ":
1006+ return Just(t_48[3]);
1007+ case "GT":
1008+ return lookup_7(k_47)(t_48[5]);
1009+ case "LT":
1010+ return lookup_7(k_47)(t_48[4]);
1011+ }
1012+ throw "Non-exhaustive pattern match in case";}();
1013+ }
1014+ throw "Non-exhaustive pattern match in case";}();};};
1015+ function findWithDefault_8(base_53){
1016+ return function(k_54){
1017+ return function(t_55){
1018+ return function(){
1019+ switch(t_55[0]){
1020+ case "RBEmpty":
1021+ return base_53;
1022+ case "RBNode":
1023+ return function(){
1024+ var case6=compare(k_54)(t_55[2]);
1025+ switch(case6[0]){
1026+ case "EQ":
1027+ return t_55[3];
1028+ case "GT":
1029+ return findWithDefault_8(base_53)(k_54)(t_55[5]);
1030+ case "LT":
1031+ return findWithDefault_8(base_53)(k_54)(t_55[4]);
1032+ }
1033+ throw "Non-exhaustive pattern match in case";}();
1034+ }
1035+ throw "Non-exhaustive pattern match in case";}();};};};
1036+ function find_9(k_60){
1037+ return function(t_61){
1038+ return function(){
1039+ switch(t_61[0]){
1040+ case "RBEmpty":
1041+ return raise_5(Value.str("Key was not found in dictionary!"));
1042+ case "RBNode":
1043+ return function(){
1044+ var case6=compare(k_60)(t_61[2]);
1045+ switch(case6[0]){
1046+ case "EQ":
1047+ return t_61[3];
1048+ case "GT":
1049+ return find_9(k_60)(t_61[5]);
1050+ case "LT":
1051+ return find_9(k_60)(t_61[4]);
1052+ }
1053+ throw "Non-exhaustive pattern match in case";}();
1054+ }
1055+ throw "Non-exhaustive pattern match in case";}();};};
1056+ function member_10(k_66){
1057+ return function(t_67){
1058+ return isJust(lookup_7(k_66)(t_67));};};
1059+ function rotateLeft_11(t_68){
1060+ return function(){
1061+ switch(t_68[0]){
1062+ case "RBNode":
1063+ switch(t_68[5][0]){
1064+ case "RBNode":
1065+ return RBNode_2(t_68[1])(t_68[5][2])(t_68[5][3])(RBNode_2(Red_0)(t_68[2])(t_68[3])(t_68[4])(t_68[5][4]))(t_68[5][5]);
1066+ }break;
1067+ }
1068+ return raise_5(Value.str("rotateLeft of a node without enough children"));}();};
1069+ function rotateRight_12(t_78){
1070+ return function(){
1071+ switch(t_78[0]){
1072+ case "RBNode":
1073+ switch(t_78[4][0]){
1074+ case "RBNode":
1075+ return RBNode_2(t_78[1])(t_78[4][2])(t_78[4][3])(t_78[4][4])(RBNode_2(Red_0)(t_78[2])(t_78[3])(t_78[4][5])(t_78[5]));
1076+ }break;
1077+ }
1078+ return raise_5(Value.str("rotateRight of a node without enough children"));}();};
1079+ function rotateLeftIfNeeded_13(t_88){
1080+ return function(){
1081+ switch(t_88[0]){
1082+ case "RBNode":
1083+ switch(t_88[5][0]){
1084+ case "RBNode":
1085+ switch(t_88[5][1][0]){
1086+ case "Red":
1087+ return rotateLeft_11(t_88);
1088+ }break;
1089+ }break;
1090+ }
1091+ return t_88;}();};
1092+ function rotateRightIfNeeded_14(t_89){
1093+ return function(){
1094+ switch(t_89[0]){
1095+ case "RBNode":
1096+ switch(t_89[4][0]){
1097+ case "RBNode":
1098+ switch(t_89[4][1][0]){
1099+ case "Red":
1100+ switch(t_89[4][4][0]){
1101+ case "RBNode":
1102+ switch(t_89[4][4][1][0]){
1103+ case "Red":
1104+ return rotateRight_12(t_89);
1105+ }break;
1106+ }break;
1107+ }break;
1108+ }break;
1109+ }
1110+ return t_89;}();};
1111+ function otherColor_15(c_90){
1112+ return function(){
1113+ switch(c_90[0]){
1114+ case "Black":
1115+ return Red_0;
1116+ case "Red":
1117+ return Black_1;
1118+ }
1119+ throw "Non-exhaustive pattern match in case";}();};
1120+ function color_flip_16(t_91){
1121+ return function(){
1122+ switch(t_91[0]){
1123+ case "RBNode":
1124+ switch(t_91[4][0]){
1125+ case "RBNode":
1126+ switch(t_91[5][0]){
1127+ case "RBNode":
1128+ return RBNode_2(otherColor_15(t_91[1]))(t_91[2])(t_91[3])(RBNode_2(otherColor_15(t_91[4][1]))(t_91[4][2])(t_91[4][3])(t_91[4][4])(t_91[4][5]))(RBNode_2(otherColor_15(t_91[5][1]))(t_91[5][2])(t_91[5][3])(t_91[5][4])(t_91[5][5]));
1129+ }break;
1130+ }break;
1131+ }
1132+ return raise_5(Value.str("color_flip called on a RBEmpty or RBNode with a RBEmpty child"));}();};
1133+ function color_flipIfNeeded_17(t_105){
1134+ return function(){
1135+ switch(t_105[0]){
1136+ case "RBNode":
1137+ switch(t_105[4][0]){
1138+ case "RBNode":
1139+ switch(t_105[4][1][0]){
1140+ case "Red":
1141+ switch(t_105[5][0]){
1142+ case "RBNode":
1143+ switch(t_105[5][1][0]){
1144+ case "Red":
1145+ return color_flip_16(t_105);
1146+ }break;
1147+ }break;
1148+ }break;
1149+ }break;
1150+ }
1151+ return t_105;}();};
1152+ function fixUp_18(t_106){
1153+ return color_flipIfNeeded_17(rotateRightIfNeeded_14(rotateLeftIfNeeded_13(t_106)));};
1154+ function ensureBlackRoot_19(t_107){
1155+ return function(){
1156+ switch(t_107[0]){
1157+ case "RBNode":
1158+ switch(t_107[1][0]){
1159+ case "Red":
1160+ return RBNode_2(Black_1)(t_107[2])(t_107[3])(t_107[4])(t_107[5]);
1161+ }break;
1162+ }
1163+ return t_107;}();};
1164+ function insert_20(k_112){
1165+ return function(v_113){
1166+ return function(t_114){
1167+ return function(){
1168+ function ins_115(t_116){
1169+ return function(){
1170+ switch(t_116[0]){
1171+ case "RBEmpty":
1172+ return RBNode_2(Red_0)(k_112)(v_113)(RBEmpty_3)(RBEmpty_3);
1173+ case "RBNode":
1174+ return function(){
1175+ var h_122=function(){
1176+ var case6=compare(k_112)(t_116[2]);
1177+ switch(case6[0]){
1178+ case "EQ":
1179+ return RBNode_2(t_116[1])(t_116[2])(v_113)(t_116[4])(t_116[5]);
1180+ case "GT":
1181+ return RBNode_2(t_116[1])(t_116[2])(t_116[3])(t_116[4])(ins_115(t_116[5]));
1182+ case "LT":
1183+ return RBNode_2(t_116[1])(t_116[2])(t_116[3])(ins_115(t_116[4]))(t_116[5]);
1184+ }
1185+ throw "Non-exhaustive pattern match in case";}();
1186+ return fixUp_18(h_122);}();
1187+ }
1188+ throw "Non-exhaustive pattern match in case";}();};
1189+ return ensureBlackRoot_19(ins_115(t_114));}();};};};
1190+ function singleton_21(k_123){
1191+ return function(v_124){
1192+ return insert_20(k_123)(v_124)(RBEmpty_3);};};
1193+ function isRed_22(t_125){
1194+ return function(){
1195+ switch(t_125[0]){
1196+ case "RBNode":
1197+ switch(t_125[1][0]){
1198+ case "Red":
1199+ return true;
1200+ }break;
1201+ }
1202+ return false;}();};
1203+ function isRedLeft_23(t_126){
1204+ return function(){
1205+ switch(t_126[0]){
1206+ case "RBNode":
1207+ switch(t_126[4][0]){
1208+ case "RBNode":
1209+ switch(t_126[4][1][0]){
1210+ case "Red":
1211+ return true;
1212+ }break;
1213+ }break;
1214+ }
1215+ return false;}();};
1216+ function isRedLeftLeft_24(t_127){
1217+ return function(){
1218+ switch(t_127[0]){
1219+ case "RBNode":
1220+ switch(t_127[4][0]){
1221+ case "RBNode":
1222+ switch(t_127[4][4][0]){
1223+ case "RBNode":
1224+ switch(t_127[4][4][1][0]){
1225+ case "Red":
1226+ return true;
1227+ }break;
1228+ }break;
1229+ }break;
1230+ }
1231+ return false;}();};
1232+ function isRedRight_25(t_128){
1233+ return function(){
1234+ switch(t_128[0]){
1235+ case "RBNode":
1236+ switch(t_128[5][0]){
1237+ case "RBNode":
1238+ switch(t_128[5][1][0]){
1239+ case "Red":
1240+ return true;
1241+ }break;
1242+ }break;
1243+ }
1244+ return false;}();};
1245+ function isRedRightLeft_26(t_129){
1246+ return function(){
1247+ switch(t_129[0]){
1248+ case "RBNode":
1249+ switch(t_129[5][0]){
1250+ case "RBNode":
1251+ switch(t_129[5][4][0]){
1252+ case "RBNode":
1253+ switch(t_129[5][4][1][0]){
1254+ case "Red":
1255+ return true;
1256+ }break;
1257+ }break;
1258+ }break;
1259+ }
1260+ return false;}();};
1261+ function moveRedLeft_27(t_130){
1262+ return function(){
1263+ var t__131=color_flip_16(t_130);
1264+ return function(){
1265+ switch(t__131[0]){
1266+ case "RBNode":
1267+ return function(){
1268+ switch(t__131[5][0]){
1269+ case "RBNode":
1270+ switch(t__131[5][4][0]){
1271+ case "RBNode":
1272+ switch(t__131[5][4][1][0]){
1273+ case "Red":
1274+ return color_flip_16(rotateLeft_11(RBNode_2(t__131[1])(t__131[2])(t__131[3])(t__131[4])(rotateRight_12(t__131[5]))));
1275+ }break;
1276+ }break;
1277+ }
1278+ return t__131;}();
1279+ }
1280+ return t__131;}();}();};
1281+ function moveRedRight_28(t_137){
1282+ return function(){
1283+ var t__138=color_flip_16(t_137);
1284+ return (isRedLeftLeft_24(t__138)?color_flip_16(rotateRight_12(t__138)):t__138);}();};
1285+ function moveRedLeftIfNeeded_29(t_139){
1286+ return ((not(isRedLeft_23(t_139))&&not(isRedLeftLeft_24(t_139)))?moveRedLeft_27(t_139):t_139);};
1287+ function moveRedRightIfNeeded_30(t_140){
1288+ return ((not(isRedRight_25(t_140))&&not(isRedRightLeft_26(t_140)))?moveRedRight_28(t_140):t_140);};
1289+ function deleteMin_31(t_141){
1290+ return function(){
1291+ function del_142(t_143){
1292+ return function(){
1293+ switch(t_143[0]){
1294+ case "RBNode":
1295+ switch(t_143[4][0]){
1296+ case "RBEmpty":
1297+ return RBEmpty_3;
1298+ }break;
1299+ }
1300+ return function(){
1301+ var t__144=moveRedLeftIfNeeded_29(t_143);
1302+ return function(){
1303+ switch(t__144[0]){
1304+ case "RBEmpty":
1305+ return RBEmpty_3;
1306+ case "RBNode":
1307+ return fixUp_18(RBNode_2(t__144[1])(t__144[2])(t__144[3])(del_142(t__144[4]))(t__144[5]));
1308+ }
1309+ throw "Non-exhaustive pattern match in case";}();}();}();};
1310+ return ensureBlackRoot_19(del_142(t_141));}();};
1311+ function remove_32(k_150){
1312+ return function(t_151){
1313+ return function(){
1314+ function eq_and_noRightNode_152(t_153){
1315+ return function(){
1316+ switch(t_153[0]){
1317+ case "RBNode":
1318+ switch(t_153[5][0]){
1319+ case "RBEmpty":
1320+ return eq(k_150,t_153[2]);
1321+ }break;
1322+ }
1323+ return false;}();};
1324+ return function(){
1325+ function eq_155(t_156){
1326+ return function(){
1327+ switch(t_156[0]){
1328+ case "RBNode":
1329+ return eq(k_150,t_156[2]);
1330+ }
1331+ return false;}();};
1332+ return function(){
1333+ function delLT_158(t_159){
1334+ return function(){
1335+ var t__160=moveRedLeftIfNeeded_29(t_159);
1336+ return function(){
1337+ switch(t__160[0]){
1338+ case "RBEmpty":
1339+ return raise_5(Value.str("delLT on RBEmpty"));
1340+ case "RBNode":
1341+ return fixUp_18(RBNode_2(t__160[1])(t__160[2])(t__160[3])(del(t__160[4]))(t__160[5]));
1342+ }
1343+ throw "Non-exhaustive pattern match in case";}();}();};
1344+ return function(){
1345+ function delEQ_166(t_167){
1346+ return function(){
1347+ switch(t_167[0]){
1348+ case "RBEmpty":
1349+ return raise_5(Value.str("delEQ called on a RBEmpty"));
1350+ case "RBNode":
1351+ return function(){
1352+ var Tuple2$k_v__171=min_6(t_167[5]);
1353+ var k__172=function(){
1354+ switch(Tuple2$k_v__171[0]){
1355+ case "Tuple2":
1356+ return Tuple2$k_v__171[1];
1357+ }
1358+ throw "Non-exhaustive pattern match in case";}();
1359+ var v__173=function(){
1360+ switch(Tuple2$k_v__171[0]){
1361+ case "Tuple2":
1362+ return Tuple2$k_v__171[2];
1363+ }
1364+ throw "Non-exhaustive pattern match in case";}();
1365+ return fixUp_18(RBNode_2(t_167[1])(k__172)(v__173)(t_167[4])(deleteMin_31(t_167[5])));}();
1366+ }
1367+ throw "Non-exhaustive pattern match in case";}();};
1368+ return function(){
1369+ function delGT_178(t_179){
1370+ return function(){
1371+ switch(t_179[0]){
1372+ case "RBEmpty":
1373+ return raise_5(Value.str("delGT called on a RBEmpty"));
1374+ case "RBNode":
1375+ return fixUp_18(RBNode_2(t_179[1])(t_179[2])(t_179[3])(t_179[4])(del(t_179[5])));
1376+ }
1377+ throw "Non-exhaustive pattern match in case";}();};
1378+ return function(){
1379+ function del_185(t_186){
1380+ return function(){
1381+ switch(t_186[0]){
1382+ case "RBEmpty":
1383+ return RBEmpty_3;
1384+ case "RBNode":
1385+ return ((compare(k_150)(t_186[2])[0] === 'LT')?delLT_158(t_186):function(){
1386+ var t__188=(isRedLeft_23(t_186)?rotateRight_12(t_186):t_186);
1387+ return (eq_and_noRightNode_152(t__188)?RBEmpty_3:function(){
1388+ var t_189=moveRedRightIfNeeded_30(t_189);
1389+ return (eq_155(t_189)?delEQ_166(t_189):delGT_178(t_189));}());}());
1390+ }
1391+ throw "Non-exhaustive pattern match in case";}();};
1392+ return ensureBlackRoot_19(del_185(t_151));}();}();}();}();}();}();};};
1393+ function map_33(f_190){
1394+ return function(t_191){
1395+ return function(){
1396+ switch(t_191[0]){
1397+ case "RBEmpty":
1398+ return RBEmpty_3;
1399+ case "RBNode":
1400+ return RBNode_2(t_191[1])(t_191[2])(f_190(t_191[3]))(map_33(f_190)(t_191[4]))(map_33(f_190)(t_191[5]));
1401+ }
1402+ throw "Non-exhaustive pattern match in case";}();};};
1403+ function foldl_34(f_197){
1404+ return function(acc_198){
1405+ return function(t_199){
1406+ return function(){
1407+ switch(t_199[0]){
1408+ case "RBEmpty":
1409+ return acc_198;
1410+ case "RBNode":
1411+ return foldl_34(f_197)(f_197(t_199[2])(t_199[3])(foldl_34(f_197)(acc_198)(t_199[4])))(t_199[5]);
1412+ }
1413+ throw "Non-exhaustive pattern match in case";}();};};};
1414+ function foldr_35(f_204){
1415+ return function(acc_205){
1416+ return function(t_206){
1417+ return function(){
1418+ switch(t_206[0]){
1419+ case "RBEmpty":
1420+ return acc_205;
1421+ case "RBNode":
1422+ return foldr_35(f_204)(f_204(t_206[2])(t_206[3])(foldr_35(f_204)(acc_205)(t_206[5])))(t_206[4]);
1423+ }
1424+ throw "Non-exhaustive pattern match in case";}();};};};
1425+ function union_36(t1_211){
1426+ return function(t2_212){
1427+ return foldl_34(insert_20)(t2_212)(t1_211);};};
1428+ function intersect_37(t1_213){
1429+ return function(t2_214){
1430+ return foldl_34(function(k_215){
1431+ return function(v_216){
1432+ return function(t_217){
1433+ return (member_10(k_215)(t2_214)?insert_20(k_215)(v_216)(t_217):t_217);};};})(empty_4)(t1_213);};};
1434+ function diff_38(t1_218){
1435+ return function(t2_219){
1436+ return foldl_34(function(k_220){
1437+ return function(__221){
1438+ return function(t_222){
1439+ return remove_32(k_220)(t_222);};};})(t1_218)(t2_219);};};
1440+ function keys_39(t_223){
1441+ return foldl_34(function(k_224){
1442+ return function(__225){
1443+ return function(acc_226){
1444+ return ["Cons",k_224,acc_226];};};})(["Nil"])(t_223);};
1445+ function values_40(t_227){
1446+ return foldl_34(function(__228){
1447+ return function(x_229){
1448+ return function(y_230){
1449+ return ["Cons",x_229,y_230];};};})(["Nil"])(t_227);};
1450+ function toList_41(t_231){
1451+ return foldl_34(function(k_232){
1452+ return function(v_233){
1453+ return function(acc_234){
1454+ return ["Cons",["Tuple2",k_232,v_233],acc_234];};};})(["Nil"])(t_231);};
1455+ function fromList_42(assocs_235){
1456+ return List.foldl(uncurry(insert_20))(empty_4)(assocs_235);};
1457+ return {empty:empty_4,lookup:lookup_7,findWithDefault:findWithDefault_8,find:find_9,member:member_10,insert:insert_20,singleton:singleton_21,remove:remove_32,map:map_33,foldl:foldl_34,foldr:foldr_35,union:union_36,intersect:intersect_37,diff:diff_38,keys:keys_39,values:values_40,toList:toList_41,fromList:fromList_42};}();
1458+Elm.main=function(){
1459+ return Elm.Dict.main;};
1460+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Dict module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}
1461+try{
1462+
1463+for(var i in Elm) { this[i] = Elm[i]; }
1464+if (Elm.Set) throw "Module name collision, 'Set' is already defined.";
1465+Elm.Set=function(){
1466+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
1467+ var hiddenVars=[];
1468+ for(var i in Elm.Prelude){
1469+ if (hiddenVars.indexOf(i) >= 0) continue;
1470+ this[i]=Elm.Prelude[i];}
1471+ var empty_0=Dict.empty;
1472+ var remove_3=Dict.remove;
1473+ var member_4=Dict.member;
1474+ var union_5=Dict.union;
1475+ var intersect_6=Dict.intersect;
1476+ var diff_7=Dict.diff;
1477+ var toList_8=Dict.keys;
1478+ var fromList_9=List.foldl(function(k_15){
1479+ return function(t_16){
1480+ return Dict.insert(k_15)(["Tuple0"])(t_16);};})(empty_0);
1481+ function singleton_1(k_13){
1482+ return Dict.singleton(k_13)(["Tuple0"]);};
1483+ function insert_2(k_14){
1484+ return Dict.insert(k_14)(["Tuple0"]);};
1485+ function foldl_10(f_17){
1486+ return Dict.foldl(function(k_18){
1487+ return function(v_19){
1488+ return function(b_20){
1489+ return f_17(k_18)(b_20);};};});};
1490+ function foldr_11(f_21){
1491+ return Dict.foldr(function(k_22){
1492+ return function(v_23){
1493+ return function(b_24){
1494+ return f_21(k_22)(b_24);};};});};
1495+ function map_12(f_25){
1496+ return function(t_26){
1497+ return function(x){
1498+ return fromList_9(List.map(f_25)(x));}(toList_8(t_26));};};
1499+ return {empty:empty_0,singleton:singleton_1,insert:insert_2,remove:remove_3,member:member_4,union:union_5,intersect:intersect_6,diff:diff_7,toList:toList_8,fromList:fromList_9,foldl:foldl_10,foldr:foldr_11,map:map_12};}();
1500+Elm.main=function(){
1501+ return Elm.Set.main;};
1502+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Set module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}
10071503var Elm = Elm || {};
10081504Elm.Char = function() {
10091505 function isBetween(lo,hi) { return function(chr) {
@@ -2981,16 +3477,192 @@ Elm.Prelude = function() {
29813477 show = Value.show;
29823478
29833479}());
2984−try{if(Elm.Automaton)throw "Module name collision, 'Automaton' is already defined.";Elm.Automaton=function(){try{if(!(Elm.Prelude instanceof Object))throw 'module not found'}catch(e){throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var hiddenVars=[];for(var i in Elm.Prelude){if(hiddenVars.indexOf(i)>=0)continue;this[i]=Elm.Prelude[i]};try{if(!(Elm.Data.List instanceof Object))throw 'module not found'}catch(e){throw "Module 'Data.List' is missing. Compile with --make flag or load missing module in a separate JavaScript file."};var unzip=Elm.Data.List.unzip
2985−function Automaton_0(a1){return ["Automaton",a1]};var Listen_9=["Listen"],Ignore_10=["Ignore"]
2986−function DragFrom_11(a1){return ["DragFrom",a1]};var count_8=init_6(0)(function(__75){return function(c_76){return(1+c_76)}})
2987−function run_1(Automaton$m0_15){return function(input_16){return function(){switch(Automaton$m0_15[0]){case"Automaton":return lift(fst)(foldp_(function(a_18){return function(Tuple2$bAutomaton$m_19){return function(){switch(Tuple2$bAutomaton$m_19[0]){case"Tuple2":switch(Tuple2$bAutomaton$m_19[2][0]){case"Automaton":return Tuple2$bAutomaton$m_19[2][1](a_18)};break};throw "Non-exhaustive pattern match in case"}()}})(Automaton$m0_15[1])(input_16))};throw "Non-exhaustive pattern match in case"}()}}
2988−function step_2(a_22){return function(Automaton$m_23){return function(){switch(Automaton$m_23[0]){case"Automaton":return Automaton$m_23[1](a_22)};throw "Non-exhaustive pattern match in case"}()}}
2989−function composeAuto_3(a1_25){return function(a2_26){return function(){var Automaton$m1_27=a1_25,m1_28=function(){switch(Automaton$m1_27[0]){case"Automaton":return Automaton$m1_27[1]};throw "Non-exhaustive pattern match in case"}(),Automaton$m2_29=a2_26,m2_30=function(){switch(Automaton$m2_29[0]){case"Automaton":return Automaton$m2_29[1]};throw "Non-exhaustive pattern match in case"}();return Automaton_0(function(a_33){return function(){var Tuple2$bm1__34=m1_28(a_33),b_35=function(){switch(Tuple2$bm1__34[0]){case"Tuple2":return Tuple2$bm1__34[1]};throw "Non-exhaustive pattern match in case"}(),m1__36=function(){switch(Tuple2$bm1__34[0]){case"Tuple2":return Tuple2$bm1__34[2]};throw "Non-exhaustive pattern match in case"}();return function(){var Tuple2$cm2__41=m2_30(b_35),c_42=function(){switch(Tuple2$cm2__41[0]){case"Tuple2":return Tuple2$cm2__41[1]};throw "Non-exhaustive pattern match in case"}(),m2__43=function(){switch(Tuple2$cm2__41[0]){case"Tuple2":return Tuple2$cm2__41[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",c_42,composeAuto_3(m1__36)(m2__43)]}()}()})}()}}
2990−function combine_4(autos_48){return Automaton_0(function(a_49){return function(){var Tuple2$bsautos__50=unzip(map(function(Automaton$m_53){return function(){switch(Automaton$m_53[0]){case"Automaton":return Automaton$m_53[1](a_49)};throw "Non-exhaustive pattern match in case"}()})(autos_48)),bs_51=function(){switch(Tuple2$bsautos__50[0]){case"Tuple2":return Tuple2$bsautos__50[1]};throw "Non-exhaustive pattern match in case"}(),autos__52=function(){switch(Tuple2$bsautos__50[0]){case"Tuple2":return Tuple2$bsautos__50[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",bs_51,combine_4(autos__52)]}()})}
2991−function pure_5(f_59){return Automaton_0(function(x_60){return ["Tuple2",f_59(x_60),pure_5(f_59)]})}
2992−function init_6(s_61){return function(step_62){return Automaton_0(function(a_63){return function(){var s__64=step_62(a_63)(s_61);return ["Tuple2",s__64,init_6(s__64)(step_62)]}()})}}
2993−function init__7(s_65){return function(step_66){return Automaton_0(function(a_67){return function(){var Tuple2$bs__68=step_66(a_67)(s_65),b_69=function(){switch(Tuple2$bs__68[0]){case"Tuple2":return Tuple2$bs__68[1]};throw "Non-exhaustive pattern match in case"}(),s__70=function(){switch(Tuple2$bs__68[0]){case"Tuple2":return Tuple2$bs__68[2]};throw "Non-exhaustive pattern match in case"}();return ["Tuple2",b_69,init__7(s__70)(step_66)]}()})}}
2994−function vecSub_12(Tuple2$x1y1_77){return function(Tuple2$x2y2_78){return function(){switch(Tuple2$x1y1_77[0]){case"Tuple2":return function(){switch(Tuple2$x2y2_78[0]){case"Tuple2":return ["Tuple2",(Tuple2$x1y1_77[1]-Tuple2$x2y2_78[1]),(Tuple2$x1y1_77[2]-Tuple2$x2y2_78[2])]};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
2995−function stepDrag_13(Tuple2$presspos_83){return function(Tuple2$dsform_84){return function(){switch(Tuple2$presspos_83[0]){case"Tuple2":return function(){switch(Tuple2$dsform_84[0]){case"Tuple2":return function(){function wrap_89(ds__90){return ["Tuple2",Tuple2$dsform_84[2],["Tuple2",ds__90,Tuple2$dsform_84[2]]]};return function(){switch(Tuple2$dsform_84[1][0]){case"DragFrom":return(Tuple2$presspos_83[1]?["Tuple2",uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]),["Tuple2",DragFrom_11(Tuple2$dsform_84[1][1]),Tuple2$dsform_84[2]]]:function(){var form__92=uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]);return ["Tuple2",form__92,["Tuple2",Listen_9,form__92]]}());case"Ignore":return wrap_89((Tuple2$presspos_83[1]?Ignore_10:Listen_9));case"Listen":return wrap_89((not(Tuple2$presspos_83[1])?Listen_9:(isWithin(Tuple2$presspos_83[2])(Tuple2$dsform_84[2])?DragFrom_11(Tuple2$presspos_83[2]):Ignore_10)))};throw "Non-exhaustive pattern match in case"}()}()};throw "Non-exhaustive pattern match in case"}()};throw "Non-exhaustive pattern match in case"}()}}
2996−function dragForm_14(form_93){return init__7(["Tuple2",Listen_9,form_93])(stepDrag_13)};return {Automaton:Automaton_0,run:run_1,step:step_2,composeAuto:composeAuto_3,combine:combine_4,pure:pure_5,init:init_6,init_:init__7,count:count_8,Listen:Listen_9,Ignore:Ignore_10,DragFrom:DragFrom_11,vecSub:vecSub_12,stepDrag:stepDrag_13,dragForm:dragForm_14}}();Elm.main=function(){return Elm.Automaton.main}}catch(e){Elm.main=function(){var msg=('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>'+'<br/><span style="color:grey">Runtime Error in Automaton module:<br/>'+e+'<br/><br/>The problem may stem from an improper usage of:<br/>fst, unzip</span>');document.body.innerHTML=Text.monospace(msg);throw e}}
3480+
3481+try{
3482+
3483+for(var i in Elm) { this[i] = Elm[i]; }
3484+if (Elm.Automaton) throw "Module name collision, 'Automaton' is already defined.";
3485+Elm.Automaton=function(){
3486+ try{if (!(Elm.Prelude instanceof Object)) throw 'module not found'; } catch(e) {throw "Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.";}
3487+ var hiddenVars=[];
3488+ for(var i in Elm.Prelude){
3489+ if (hiddenVars.indexOf(i) >= 0) continue;
3490+ this[i]=Elm.Prelude[i];}
3491+ function Automaton_0(a1){
3492+ return ["Automaton",a1];};
3493+ var Listen_9=["Listen"];
3494+ var Ignore_10=["Ignore"];
3495+ function DragFrom_11(a1){
3496+ return ["DragFrom",a1];};
3497+ var count_8=init_6(0)(function(__75){
3498+ return function(c_76){
3499+ return (1+c_76);};});
3500+ function run_1(Automaton$m0_15){
3501+ return function(input_16){
3502+ return function(){
3503+ switch(Automaton$m0_15[0]){
3504+ case "Automaton":
3505+ return lift(fst)(foldp_(function(a_18){
3506+ return function(Tuple2$bAutomaton$m_19){
3507+ return function(){
3508+ switch(Tuple2$bAutomaton$m_19[0]){
3509+ case "Tuple2":
3510+ switch(Tuple2$bAutomaton$m_19[2][0]){
3511+ case "Automaton":
3512+ return Tuple2$bAutomaton$m_19[2][1](a_18);
3513+ }break;
3514+ }
3515+ throw "Non-exhaustive pattern match in case";}();};})(Automaton$m0_15[1])(input_16));
3516+ }
3517+ throw "Non-exhaustive pattern match in case";}();};};
3518+ function step_2(Automaton$m_22){
3519+ return function(a_23){
3520+ return function(){
3521+ switch(Automaton$m_22[0]){
3522+ case "Automaton":
3523+ return Automaton$m_22[1](a_23);
3524+ }
3525+ throw "Non-exhaustive pattern match in case";}();};};
3526+ function composeAuto_3(a1_25){
3527+ return function(a2_26){
3528+ return function(){
3529+ var Automaton$m1_27=a1_25;
3530+ var m1_28=function(){
3531+ switch(Automaton$m1_27[0]){
3532+ case "Automaton":
3533+ return Automaton$m1_27[1];
3534+ }
3535+ throw "Non-exhaustive pattern match in case";}();
3536+ var Automaton$m2_29=a2_26;
3537+ var m2_30=function(){
3538+ switch(Automaton$m2_29[0]){
3539+ case "Automaton":
3540+ return Automaton$m2_29[1];
3541+ }
3542+ throw "Non-exhaustive pattern match in case";}();
3543+ return Automaton_0(function(a_33){
3544+ return function(){
3545+ var Tuple2$bm1__34=m1_28(a_33);
3546+ var b_35=function(){
3547+ switch(Tuple2$bm1__34[0]){
3548+ case "Tuple2":
3549+ return Tuple2$bm1__34[1];
3550+ }
3551+ throw "Non-exhaustive pattern match in case";}();
3552+ var m1__36=function(){
3553+ switch(Tuple2$bm1__34[0]){
3554+ case "Tuple2":
3555+ return Tuple2$bm1__34[2];
3556+ }
3557+ throw "Non-exhaustive pattern match in case";}();
3558+ return function(){
3559+ var Tuple2$cm2__41=m2_30(b_35);
3560+ var c_42=function(){
3561+ switch(Tuple2$cm2__41[0]){
3562+ case "Tuple2":
3563+ return Tuple2$cm2__41[1];
3564+ }
3565+ throw "Non-exhaustive pattern match in case";}();
3566+ var m2__43=function(){
3567+ switch(Tuple2$cm2__41[0]){
3568+ case "Tuple2":
3569+ return Tuple2$cm2__41[2];
3570+ }
3571+ throw "Non-exhaustive pattern match in case";}();
3572+ return ["Tuple2",c_42,composeAuto_3(m1__36)(m2__43)];}();}();});}();};};
3573+ function combine_4(autos_48){
3574+ return Automaton_0(function(a_49){
3575+ return function(){
3576+ var Tuple2$bsautos__50=unzip(map(function(Automaton$m_53){
3577+ return function(){
3578+ switch(Automaton$m_53[0]){
3579+ case "Automaton":
3580+ return Automaton$m_53[1](a_49);
3581+ }
3582+ throw "Non-exhaustive pattern match in case";}();})(autos_48));
3583+ var bs_51=function(){
3584+ switch(Tuple2$bsautos__50[0]){
3585+ case "Tuple2":
3586+ return Tuple2$bsautos__50[1];
3587+ }
3588+ throw "Non-exhaustive pattern match in case";}();
3589+ var autos__52=function(){
3590+ switch(Tuple2$bsautos__50[0]){
3591+ case "Tuple2":
3592+ return Tuple2$bsautos__50[2];
3593+ }
3594+ throw "Non-exhaustive pattern match in case";}();
3595+ return ["Tuple2",bs_51,combine_4(autos__52)];}();});};
3596+ function pure_5(f_59){
3597+ return Automaton_0(function(x_60){
3598+ return ["Tuple2",f_59(x_60),pure_5(f_59)];});};
3599+ function init_6(s_61){
3600+ return function(step_62){
3601+ return Automaton_0(function(a_63){
3602+ return function(){
3603+ var s__64=step_62(a_63)(s_61);
3604+ return ["Tuple2",s__64,init_6(s__64)(step_62)];}();});};};
3605+ function init__7(s_65){
3606+ return function(step_66){
3607+ return Automaton_0(function(a_67){
3608+ return function(){
3609+ var Tuple2$bs__68=step_66(a_67)(s_65);
3610+ var b_69=function(){
3611+ switch(Tuple2$bs__68[0]){
3612+ case "Tuple2":
3613+ return Tuple2$bs__68[1];
3614+ }
3615+ throw "Non-exhaustive pattern match in case";}();
3616+ var s__70=function(){
3617+ switch(Tuple2$bs__68[0]){
3618+ case "Tuple2":
3619+ return Tuple2$bs__68[2];
3620+ }
3621+ throw "Non-exhaustive pattern match in case";}();
3622+ return ["Tuple2",b_69,init__7(s__70)(step_66)];}();});};};
3623+ function vecSub_12(Tuple2$x1y1_77){
3624+ return function(Tuple2$x2y2_78){
3625+ return function(){
3626+ switch(Tuple2$x1y1_77[0]){
3627+ case "Tuple2":
3628+ return function(){
3629+ switch(Tuple2$x2y2_78[0]){
3630+ case "Tuple2":
3631+ return ["Tuple2",(Tuple2$x1y1_77[1]-Tuple2$x2y2_78[1]),(Tuple2$x1y1_77[2]-Tuple2$x2y2_78[2])];
3632+ }
3633+ throw "Non-exhaustive pattern match in case";}();
3634+ }
3635+ throw "Non-exhaustive pattern match in case";}();};};
3636+ function stepDrag_13(Tuple2$presspos_83){
3637+ return function(Tuple2$dsform_84){
3638+ return function(){
3639+ switch(Tuple2$presspos_83[0]){
3640+ case "Tuple2":
3641+ return function(){
3642+ switch(Tuple2$dsform_84[0]){
3643+ case "Tuple2":
3644+ return function(){
3645+ function wrap_89(ds__90){
3646+ return ["Tuple2",Tuple2$dsform_84[2],["Tuple2",ds__90,Tuple2$dsform_84[2]]];};
3647+ return function(){
3648+ switch(Tuple2$dsform_84[1][0]){
3649+ case "DragFrom":
3650+ return (Tuple2$presspos_83[1]?["Tuple2",uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]),["Tuple2",DragFrom_11(Tuple2$dsform_84[1][1]),Tuple2$dsform_84[2]]]:function(){
3651+ var form__92=uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]);
3652+ return ["Tuple2",form__92,["Tuple2",Listen_9,form__92]];}());
3653+ case "Ignore":
3654+ return wrap_89((Tuple2$presspos_83[1]?Ignore_10:Listen_9));
3655+ case "Listen":
3656+ return wrap_89((not(Tuple2$presspos_83[1])?Listen_9:(isWithin(Tuple2$presspos_83[2])(Tuple2$dsform_84[2])?DragFrom_11(Tuple2$presspos_83[2]):Ignore_10)));
3657+ }
3658+ throw "Non-exhaustive pattern match in case";}();}();
3659+ }
3660+ throw "Non-exhaustive pattern match in case";}();
3661+ }
3662+ throw "Non-exhaustive pattern match in case";}();};};
3663+ function dragForm_14(form_93){
3664+ return init__7(["Tuple2",Listen_9,form_93])(stepDrag_13);};
3665+ return {Automaton:Automaton_0,run:run_1,step:step_2,composeAuto:composeAuto_3,combine:combine_4,pure:pure_5,init:init_6,init_:init__7,count:count_8,Listen:Listen_9,Ignore:Ignore_10,DragFrom:DragFrom_11,vecSub:vecSub_12,stepDrag:stepDrag_13,dragForm:dragForm_14};}();
3666+Elm.main=function(){
3667+ return Elm.Automaton.main;};
3668+} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Automaton module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}