@@ -1,178 +1,221 @@
1+
2+(function() {
3+try{
4+
5+var $op={};
6+for(this['i'] in Elm){eval('var '+this['i']+'=Elm[this.i];');}
7+if (Elm.Automaton) throw "Module name collision, 'Automaton' is already defined.";
18Elm.Automaton=function(){
2− for(this['i'] in Elm.Prelude){
3− eval('var ' + this['i'] + '=Elm.Prelude[this.i];'); }
9+ try{
10+ if (!(Elm.Prelude instanceof Object)) throw 'module not found';
11+ } catch(e) {
12+ throw ("Module 'Prelude' is missing. Compile with --make flag or load missing module in a separate JavaScript file.");
13+ }
14+ var hiddenVars={};
15+ for (this['i'] in Elm.Prelude) {
16+ if (hiddenVars[this['i']]) continue;
17+ eval('var ' + this['i'] + ' = Elm.Prelude[this.i];');}
418 function Automaton_0(a1){
5− return ["Automaton",a1];};
6− var Listen_9=["Listen"];
7− var Ignore_10=["Ignore"];
8− function DragFrom_11(a1){
9− return ["DragFrom",a1];};
10− var count_8=init_6(0)(function(__75){
11− return function(c_76){
12− return (1+c_76);};});
13− function run_1(Automaton$m0_15){
14− return function(input_16){
19+ return ["Automaton",a1];}
20+ var Listen_8=["Listen"];
21+ var Ignore_9=["Ignore"];
22+ function DragFrom_10(a1){
23+ return ["DragFrom",a1];}
24+ $op['>>>'] = function(a1_24){
25+ return function(a2_25){
1526 return function(){
16− switch(Automaton$m0_15[0]){
17− case "Automaton":
18− return lift(fst)(foldp_(function(a_18){
19− return function(Tuple2$bAutomaton$m_19){
20− return function(){
21− switch(Tuple2$bAutomaton$m_19[0]){
22− case "Tuple2":
23− switch(Tuple2$bAutomaton$m_19[2][0]){
24− case "Automaton":
25− return Tuple2$bAutomaton$m_19[2][1](a_18);
26− }break;
27− }
28− throw "Non-exhaustive pattern match in case";}();};})(Automaton$m0_15[1])(input_16));
29− }
30− throw "Non-exhaustive pattern match in case";}();};};
31− function step_2(Automaton$m_22){
32− return function(a_23){
33− return function(){
34− switch(Automaton$m_22[0]){
35− case "Automaton":
36− return Automaton$m_22[1](a_23);
37− }
38− throw "Non-exhaustive pattern match in case";}();};};
39− function composeAuto_3(a1_25){
40− return function(a2_26){
41− return function(){
42− var Automaton$m1_27=a1_25;
43− var m1_28=function(){
44− switch(Automaton$m1_27[0]){
27+ var Automaton$m1_26=a1_24;
28+ var m1_27=function(){
29+ switch(Automaton$m1_26[0]){
4530 case "Automaton":
46− return Automaton$m1_27[1];
31+ return Automaton$m1_26[1];
4732 }
4833 throw "Non-exhaustive pattern match in case";}();
49− var Automaton$m2_29=a2_26;
50− var m2_30=function(){
51− switch(Automaton$m2_29[0]){
34+ var Automaton$m2_28=a2_25;
35+ var m2_29=function(){
36+ switch(Automaton$m2_28[0]){
5237 case "Automaton":
53− return Automaton$m2_29[1];
38+ return Automaton$m2_28[1];
5439 }
5540 throw "Non-exhaustive pattern match in case";}();
56− return Automaton_0(function(a_33){
41+ return Automaton_0(function(a_32){
5742 return function(){
58− var Tuple2$bm1__34=m1_28(a_33);
59− var b_35=function(){
60− switch(Tuple2$bm1__34[0]){
43+ var Tuple2$bm1__33=m1_27(a_32);
44+ var b_34=function(){
45+ switch(Tuple2$bm1__33[0]){
6146 case "Tuple2":
62− return Tuple2$bm1__34[1];
47+ return Tuple2$bm1__33[1];
6348 }
6449 throw "Non-exhaustive pattern match in case";}();
65− var m1__36=function(){
66− switch(Tuple2$bm1__34[0]){
50+ var m1__35=function(){
51+ switch(Tuple2$bm1__33[0]){
6752 case "Tuple2":
68− return Tuple2$bm1__34[2];
53+ return Tuple2$bm1__33[2];
6954 }
7055 throw "Non-exhaustive pattern match in case";}();
7156 return function(){
72− var Tuple2$cm2__41=m2_30(b_35);
73− var c_42=function(){
74− switch(Tuple2$cm2__41[0]){
57+ var Tuple2$cm2__40=m2_29(b_34);
58+ var c_41=function(){
59+ switch(Tuple2$cm2__40[0]){
7560 case "Tuple2":
76− return Tuple2$cm2__41[1];
61+ return Tuple2$cm2__40[1];
7762 }
7863 throw "Non-exhaustive pattern match in case";}();
79− var m2__43=function(){
80− switch(Tuple2$cm2__41[0]){
64+ var m2__42=function(){
65+ switch(Tuple2$cm2__40[0]){
8166 case "Tuple2":
82− return Tuple2$cm2__41[2];
67+ return Tuple2$cm2__40[2];
8368 }
8469 throw "Non-exhaustive pattern match in case";}();
85− return ["Tuple2",c_42,composeAuto_3(m1__36)(m2__43)];}();}();});}();};};
86− function combine_4(autos_48){
87− return Automaton_0(function(a_49){
70+ return ["Tuple2",c_41,$op['>>>'](m1__35)(m2__42)];}();}();});}();};};
71+ $op['<<<'] = function(a2_47){
72+ return function(a1_48){
73+ return $op['>>>'](a1_48)(a2_47);};};
74+ $op['^>>'] = function(f_49){
75+ return function(a_50){
76+ return $op['>>>'](pure_4(f_49))(a_50);};};
77+ $op['>>^'] = function(a_51){
78+ return function(f_52){
79+ return $op['>>>'](a_51)(pure_4(f_52));};};
80+ $op['^<<'] = function(f_53){
81+ return function(a_54){
82+ return $op['>>>'](a_54)(pure_4(f_53));};};
83+ $op['<<^'] = function(a_55){
84+ return function(f_56){
85+ return $op['>>>'](pure_4(f_56))(a_55);};};
86+ var count_7=init_5(0)(function(__84){
87+ return function(c_85){
88+ return (1+c_85);};});
89+ function run_1(Automaton$m0_14){
90+ return function(input_15){
91+ return function(){
92+ switch(Automaton$m0_14[0]){
93+ case "Automaton":
94+ return lift(fst)(foldp_(function(a_17){
95+ return function(Tuple2$bAutomaton$m_18){
96+ return function(){
97+ switch(Tuple2$bAutomaton$m_18[0]){
98+ case "Tuple2":
99+ switch(Tuple2$bAutomaton$m_18[2][0]){
100+ case "Automaton":
101+ return Tuple2$bAutomaton$m_18[2][1](a_17);
102+ }break;
103+ }
104+ throw "Non-exhaustive pattern match in case";}();};})(Automaton$m0_14[1])(input_15));
105+ }
106+ throw "Non-exhaustive pattern match in case";}();};}
107+ function step_2(Automaton$m_21){
108+ return function(a_22){
109+ return function(){
110+ switch(Automaton$m_21[0]){
111+ case "Automaton":
112+ return Automaton$m_21[1](a_22);
113+ }
114+ throw "Non-exhaustive pattern match in case";}();};}
115+ function combine_3(autos_57){
116+ return Automaton_0(function(a_58){
88117 return function(){
89− var Tuple2$bsautos__50=unzip(map(function(Automaton$m_53){
118+ var Tuple2$bsautos__59=unzip(map(function(Automaton$m_62){
90119 return function(){
91− switch(Automaton$m_53[0]){
120+ switch(Automaton$m_62[0]){
92121 case "Automaton":
93− return Automaton$m_53[1](a_49);
122+ return Automaton$m_62[1](a_58);
94123 }
95− throw "Non-exhaustive pattern match in case";}();})(autos_48));
96− var bs_51=function(){
97− switch(Tuple2$bsautos__50[0]){
124+ throw "Non-exhaustive pattern match in case";}();})(autos_57));
125+ var bs_60=function(){
126+ switch(Tuple2$bsautos__59[0]){
98127 case "Tuple2":
99− return Tuple2$bsautos__50[1];
128+ return Tuple2$bsautos__59[1];
100129 }
101130 throw "Non-exhaustive pattern match in case";}();
102− var autos__52=function(){
103− switch(Tuple2$bsautos__50[0]){
131+ var autos__61=function(){
132+ switch(Tuple2$bsautos__59[0]){
104133 case "Tuple2":
105− return Tuple2$bsautos__50[2];
134+ return Tuple2$bsautos__59[2];
106135 }
107136 throw "Non-exhaustive pattern match in case";}();
108− return ["Tuple2",bs_51,combine_4(autos__52)];}();});};
109− function pure_5(f_59){
110− return Automaton_0(function(x_60){
111− return ["Tuple2",f_59(x_60),pure_5(f_59)];});};
112− function init_6(s_61){
113− return function(step_62){
114− return Automaton_0(function(a_63){
137+ return ["Tuple2",bs_60,combine_3(autos__61)];}();});}
138+ function pure_4(f_68){
139+ return Automaton_0(function(x_69){
140+ return ["Tuple2",f_68(x_69),pure_4(f_68)];});}
141+ function init_5(s_70){
142+ return function(step_71){
143+ return Automaton_0(function(a_72){
115144 return function(){
116− var s__64=step_62(a_63)(s_61);
117− return ["Tuple2",s__64,init_6(s__64)(step_62)];}();});};};
118− function init__7(s_65){
119− return function(step_66){
120− return Automaton_0(function(a_67){
145+ var s__73=step_71(a_72)(s_70);
146+ return ["Tuple2",s__73,init_5(s__73)(step_71)];}();});};}
147+ function init__6(s_74){
148+ return function(step_75){
149+ return Automaton_0(function(a_76){
121150 return function(){
122− var Tuple2$bs__68=step_66(a_67)(s_65);
123− var b_69=function(){
124− switch(Tuple2$bs__68[0]){
151+ var Tuple2$bs__77=step_75(a_76)(s_74);
152+ var b_78=function(){
153+ switch(Tuple2$bs__77[0]){
125154 case "Tuple2":
126− return Tuple2$bs__68[1];
155+ return Tuple2$bs__77[1];
127156 }
128157 throw "Non-exhaustive pattern match in case";}();
129− var s__70=function(){
130− switch(Tuple2$bs__68[0]){
158+ var s__79=function(){
159+ switch(Tuple2$bs__77[0]){
131160 case "Tuple2":
132− return Tuple2$bs__68[2];
161+ return Tuple2$bs__77[2];
133162 }
134163 throw "Non-exhaustive pattern match in case";}();
135− return ["Tuple2",b_69,init__7(s__70)(step_66)];}();});};};
136− function vecSub_12(Tuple2$x1y1_77){
137− return function(Tuple2$x2y2_78){
164+ return ["Tuple2",b_78,init__6(s__79)(step_75)];}();});};}
165+ function vecSub_11(Tuple2$x1y1_86){
166+ return function(Tuple2$x2y2_87){
138167 return function(){
139− switch(Tuple2$x1y1_77[0]){
168+ switch(Tuple2$x1y1_86[0]){
140169 case "Tuple2":
141170 return function(){
142− switch(Tuple2$x2y2_78[0]){
171+ switch(Tuple2$x2y2_87[0]){
143172 case "Tuple2":
144− return ["Tuple2",(Tuple2$x1y1_77[1]-Tuple2$x2y2_78[1]),(Tuple2$x1y1_77[2]-Tuple2$x2y2_78[2])];
173+ return ["Tuple2",(Tuple2$x1y1_86[1]-Tuple2$x2y2_87[1]),(Tuple2$x1y1_86[2]-Tuple2$x2y2_87[2])];
145174 }
146175 throw "Non-exhaustive pattern match in case";}();
147176 }
148− throw "Non-exhaustive pattern match in case";}();};};
149− function stepDrag_13(Tuple2$presspos_83){
150− return function(Tuple2$dsform_84){
177+ throw "Non-exhaustive pattern match in case";}();};}
178+ function stepDrag_12(Tuple2$presspos_92){
179+ return function(Tuple2$dsform_93){
151180 return function(){
152− switch(Tuple2$presspos_83[0]){
181+ switch(Tuple2$presspos_92[0]){
153182 case "Tuple2":
154183 return function(){
155− switch(Tuple2$dsform_84[0]){
184+ switch(Tuple2$dsform_93[0]){
156185 case "Tuple2":
157186 return function(){
158− function wrap_89(ds__90){
159− return ["Tuple2",Tuple2$dsform_84[2],["Tuple2",ds__90,Tuple2$dsform_84[2]]];};
187+ function wrap_98(ds__99){
188+ return ["Tuple2",Tuple2$dsform_93[2],["Tuple2",ds__99,Tuple2$dsform_93[2]]];}
160189 return function(){
161− switch(Tuple2$dsform_84[1][0]){
190+ switch(Tuple2$dsform_93[1][0]){
162191 case "DragFrom":
163− 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(){
164− var form__92=uncurry(move)(vecSub_12(Tuple2$presspos_83[2])(Tuple2$dsform_84[1][1]))(Tuple2$dsform_84[2]);
165− return ["Tuple2",form__92,["Tuple2",Listen_9,form__92]];}());
192+ return (Tuple2$presspos_92[1]?["Tuple2",uncurry(move)(vecSub_11(Tuple2$presspos_92[2])(Tuple2$dsform_93[1][1]))(Tuple2$dsform_93[2]),["Tuple2",DragFrom_10(Tuple2$dsform_93[1][1]),Tuple2$dsform_93[2]]]:function(){
193+ var form__101=uncurry(move)(vecSub_11(Tuple2$presspos_92[2])(Tuple2$dsform_93[1][1]))(Tuple2$dsform_93[2]);
194+ return ["Tuple2",form__101,["Tuple2",Listen_8,form__101]];}());
166195 case "Ignore":
167− return wrap_89((Tuple2$presspos_83[1]?Ignore_10:Listen_9));
196+ return wrap_98((Tuple2$presspos_92[1]?Ignore_9:Listen_8));
168197 case "Listen":
169− 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)));
198+ return wrap_98((not(Tuple2$presspos_92[1])?Listen_8:(isWithin(Tuple2$presspos_92[2])(Tuple2$dsform_93[2])?DragFrom_10(Tuple2$presspos_92[2]):Ignore_9)));
170199 }
171200 throw "Non-exhaustive pattern match in case";}();}();
172201 }
173202 throw "Non-exhaustive pattern match in case";}();
174203 }
175− throw "Non-exhaustive pattern match in case";}();};};
176− function draggable_14(form_93){
177− return init__7(["Tuple2",Listen_9,form_93])(stepDrag_13);};
178− 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,draggable:draggable_14};}();
204+ throw "Non-exhaustive pattern match in case";}();};}
205+ function draggable_13(form_102){
206+ return init__6(["Tuple2",Listen_8,form_102])(stepDrag_12);}
207+ return {$op : {'>>>' : $op['>>>'], '<<<' : $op['<<<'], '^>>' : $op['^>>'], '>>^' : $op['>>^'], '^<<' : $op['^<<'], '<<^' : $op['<<^']},
208+ run:run_1,
209+ step:step_2,
210+ combine:combine_3,
211+ pure:pure_4,
212+ init:init_5,
213+ init_:init__6,
214+ count:count_7,
215+ draggable:draggable_13};}();
216+Elm.main=function(){
217+ return Elm.Automaton.main;};
218+} catch (e) {
219+Elm.main=function() {
220+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>');
221+document.body.innerHTML = Elm.Text.monospace(msg);throw e;};}}());