This repository has been archived by the owner on Mar 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjsparsec-Text.Parsec-min.js
144 lines (131 loc) · 57.2 KB
/
jsparsec-Text.Parsec-min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
JSParsec - A parser combinator library for JavaScript
http://code.google.com/p/jshaskell/
Copyright (c) 2010 Balazs Endresz ([email protected])
Dual licensed under the MIT and GPL licenses.
The initial implementation of some combinators,
and the memoization technique is derived from:
http://www.bluishcoder.co.nz/2007/10/javascript-parser-combinators.html
Most functions should behave like their counterparts in Parsec 3:
http://www.haskell.org/haskellwiki/Parsec
------------------------------------------------------------
JSHaskell - Some Haskell language features for JavaScript
http://code.google.com/p/jshaskell/
Copyright (c) 2010 Balazs Endresz ([email protected])
Dual licensed under the MIT and GPL licenses.
------------------------------------------------------------
*/
(function(){(function(){function ba(f,g){return Za[f]=g||{}}function $a(f,g){for(var l=Za[f],o=0,u=g.length;o<u;++o){var C=Za[f+"_"+g[o]];for(var B in C)l[B]=C[B]}}function U(f){return Cb.call(f)=="[object Array]"}function Na(f){return f!==Oa}function fb(f,g){return f===g}function Ua(f,g){return f!==g}function Ha(f,g){return f+g}function ca(f,g){return f-g}function E(f,g){return f*g}function ja(f,g){return f/g}function F(f,g){return f<g}function H(f,g){return f<=g}function Pa(f,g){return f>g}function gb(f,
g){return f>=g}function vb(f){return-f}function Da(f){var g=f.constructor;if(g)return g;f=typeof f;return f=="string"?String:f=="number"?Number:f=="boolean"?Boolean:f=="function"?Function:Oa}function hb(f){function g(){var l=na(arguments);return l.length>=(f._length===Oa?f.length:f._length)?f.apply(null,l):function(){return g.apply(null,l.concat(na(arguments)))}}return g}function Qa(f){var g=na(arguments,1);return function(){return f.apply(null,g)}}function ib(){function f(g){return!g?[]:[[g.name||
g._name||g,g.arguments]].concat(f(g.caller))}return f(arguments.callee.caller)}function xa(f){var g=(f instanceof Function?f.name||f._name:null)||f||"Unspecified error from "+arguments.callee.caller.name+" <- "+arguments.callee.caller.caller.name,l=new Error(g);try{l.stackTrace=ib()}catch(o){}l.message=g;throw l;}function wb(f,g){for(var l in g)f[l]=g[l];return f}function R(f,g){if(g.indexOf)return g.indexOf(f);var l=g.length;if(!l)return-1;for(var o=0;o<l;o++)if(g[o]===f)return o;return-1}function xb(f,
g){if(g.lastIndexOf)return g.lastIndexOf(f);var l=g.length;if(!l)return-1;for(l=l-1;l>-1;--l)if(g[l]===f)return l;return-1}function jb(f){var g=f.charAt;f=Va(f);f.sort();return g?f.join(""):f}function Va(f){if(!f.charAt)return ka.call(f,0);for(var g=[],l=0,o=f.length;l<o;++l)g.push(f.charAt(l));return g}function ya(f,g){return{indexOf:function(l){return l>=f&&l<=g?true:-1},toString:function(){return"range("+f+", "+g+")"}}}function kb(f,g){function l(){var o=100*g;do f=f();while(--o&&f&&f.call);setTimeout(l,
1)}if(!g||g==Infinity){do f=f();while(f&&f.call);return f}l()}function Kb(f,g){return g?g[f]:function(l){return l[f]}}function lb(){}function la(){}function Ea(f){return function(){var g=[],l=this._recordset;if(l&&l.constructor!=Array){for(var o in l){var u=f?l[o].name||l[o]:this[o];if(!f&&u instanceof Function)u=u.constructor!=Function?u.constructor.name:"Function("+u.name+")";g.push(o+(f?" :: ":" = ")+u)}l=replicate(this._dataConstructor.length+2," ").join("");g="{"+g.join("\n"+l+",")+"\n"+l+"}"}else{for(o=
0;o in this;o++)g.push(f?l[o].name||l[o]:this[o]);g=g.join(" ")}return"("+this._dataConstructor+(g?" ":"")+g+")"}}function Db(f,g,l,o,u){xa("Type error: expecting "+f.name+" instead of "+g.name+" in the argument '"+l+"' of "+o+"."+u)}function Lb(f,g){function l(I,oa){function N(Ia,za){var pa=Ia instanceof lb,qa=new f,J,V;qa.constructor=f;qa._recordset=w&&oa[0]||oa;qa._dataConstructor=I;qa[I]=true;if(pa)for(var Y in za){pa=za[Y];w||xa("Records are not defined for "+o+"."+I);Y in D||xa("The accessor '"+
Y+"' is not defined for "+o+"."+I);V=D[Y];if(typeof V!="string"){J=Da(pa);J!=V&&Db(V,J,Y,o,I)}qa[Y]=pa;qa[da[Y]]=pa}else{Y=arguments;for(var K=0,ab=Y.length;K<ab;++K){pa=Y[K];V=oa[K];if(typeof V!="string"){J=Da(pa);J!=V&&Db(V,J,K,o,I)}qa[K]=pa;if(w)qa[mb[K]]=pa}}qa.update=function(bb){var cb={};for(var P in D)cb[P]=P in bb?bb[P]:this[P];return N(Eb,cb)};return qa}var w=oa&&typeof oa[0]=="object",D=w&&oa[0];if(w){var ga=0,Z,da={},mb={};for(Z in D){var Ja=Z.charAt(0);if(Ja=="_"||Ja==Ja.toUpperCase())throw o+
"."+Q+"."+Z+": record names can't start with underscore or uppercase letters";if(Z in{update:1})throw o+"."+Q+"."+Z+": record name is invalid";da[Z]=ga;mb[ga]=Z;ga++}}return N}var o=f.name;if(f._constructors)throw"Type constructor has been already defined: '"+o+"'";f._constructors=g;f.prototype=new la;for(var u=0,C=g.length;u<C;++u){var B=typeof g[u]!="object",Q=B?g[u]:g[u][0];if(Q in f)throw"The name of the data constructor ("+o+"."+Q+") is invalid!";f[Q]=B?l(Q)():l(Q,na(g[u],1));if(!B)f[Q]._length=
g[u].length-1}}function Ka(f){return f._dataConstructor}function La(){this.keys=[];this.values=[]}function nb(f,g){var l={};l._context=[];l._name=f;l._dict=new La;l.context=function(){this._context=na(arguments);delete l.context;return this};l.types=function(o){this._fnTypes=o;delete l.types;return this};l.impl=function(o){this._default=o;for(var u in l._fnTypes)(function(C,B){l[C]=B!==Oa&&B.constructor!=Array?(typeof o=="function"?o():o)[C]:function(){var Q=arguments,I;if(B===Oa||B===ea)xa("There's no type signature for "+
l._name+"."+C+", it can be accessed only by: getInstance("+l._name+", SomeType)."+C);var oa,N=Wa(function(w,D){D=B[D];if(oa||D==ea)return oa=true;w=Da(w);if(D==g){I=I||w;return I==w}else return w==D},Q);!oa&&N.length!=B.length-1&&xa("Type error in "+l._name+"."+C);(N=l._dict.get(I))||xa("No "+l._name+" instance for "+(I.name||I._name));return N[C].apply(null,Q)}})(u,l._fnTypes[u]);delete l.impl;return this};return l}function Ra(f,g,l){Xa(function(B){if(!B._dict.get(g))throw"No "+(B._name||"")+" instance for "+
(g.name||g._name);},f._context);var o={};o._type=g;f._dict.put(g,o);l=typeof l=="function"?l(o):l||{};var u=f._default;u=typeof u=="function"?u(o):u;for(var C in f._fnTypes)o[C]=l[C]||u[C];return o}function yb(f,g){return f._dict.get(g)}function db(f,g,l){return f._dict.get(Da(l))[g]}function Mb(f){return["l",f]}function Fb(f){return["r",f]}function zb(f){return["x",f]}function ob(f){if(f)if(!f._String){var g=Aa[f];if(f._Op&&!g)return"l";return g&&(g.fixity[0]||"l")}}function Gb(f){if(f)if(!f._String){var g=
Aa[f];if(f._Op&&!g)return 9;return g&&(Na(g.fixity[1])?g.fixity[1]:9)}}function Ya(){}function eb(f,g,l){var o;if(f[g]._Op){delete f[g]._Op;o=f[g]}else o=Aa[f[g]].func;o=o(f[g-1],f[g+1]);f.splice(g-1,3,o);return va(f,l)}function Nb(f){if(typeof f=="string"){f=new String(f);f._String=true;return f}else{f._Array=true;return f}}function Ob(f){f._Op=true;return f}function va(f,g){f=Xa(function(I){if(!I)return I;if(I._Array){delete I._Array;return I}return I.constructor==Array?va(I,g):I.CallStream?I.resolve(g):
I},f);if(g)f=Xa(function(I){return I instanceof Ya?g:I},f);for(var l=[],o=[],u=0,C=f.length;u<C;++u){var B=f[u],Q=false;if(Aa[B])Q=true;if(B&&B._String){Q=false;B=B.toString()}if(B&&B._Op)Q=true;if(!Q&&u!=C-1)l.push(B);else{u==C-1&&l.push(B);l=l.length>1?l[0].apply(null,l.slice(1)):l[0];o.push(l);u!=C-1&&o.push(B);l=[]}}f=o;o=Xa(ob,f);C=Xa(Gb,f);B=Wa(Na,C).sort().pop();u=R(B,C);C=xb(B,C);return o[u]=="l"?eb(f,u,g):o[C]=="r"?eb(f,C,g):o[u]=="x"?eb(f,u,g):f[0]}function Ab(f){return function(){function g(){return u.apply(null,
arguments)}function l(){return(C?u:l.resolve()).apply(null,arguments)}var o=arguments,u,C;l.resolve=function(B){if(C)return u;u=va(o,B||g);o=null;C=true;return u};l.CallStream=true;l.constructor=f;return l}}function Pb(){return va(na(arguments))}function Ma(f){this.scope=f}function pb(f){return function(){function g(){return u.apply(null,arguments)}function l(B){if(C||B instanceof Ma)return(C?u:l.resolve()).apply(null,arguments);o.push(va(arguments,g));return l}var o=[],u,C;o.push(va(arguments,g));
l.resolve=function(){if(C)return u;u=f.do_.apply(null,o);C=true;o=null;return u};l.CallStream=true;l.constructor=f._type;return l}}var ra=function(){return this}()||window,Za=ra.NS||(ra.NS={}),Oa,Cb={}.toString,ka=[].slice,qb=[].map,n=[].filter;(function(){return this}).toString().indexOf("this");(function(){var f={9:1,d:1,b:1,0:1,a:1,c:1},g=[9,"d","b",0,"a","c"],l=0;for(var o in f)if(o!=g[l++])return false;return true})();ra.global=ra;ra.namespace=ba;ra.importSubmodules=$a;var na="a"[0]?function(f,
g){return ka.call(f,g||0)}:function(f,g){if(typeof f=="string"){f=f.split("");if(!g)return f}return ka.call(f,g||0)},Xa=qb?function(f,g){return qb.call(g,f)}:function(f,g){for(var l=[],o=0,u=g.length;o<u;++o)l[o]=f(g[o],o,g);return l},Wa=n?function(f,g){return n.call(g,f)}:function(f,g){for(var l=[],o=0,u=g.length;o<u;++o)f(g[o],o,g)&&l.push(g[o]);return l};ba("Haskell_Main",{Bool:Boolean,isArray:U,isDefined:Na,slice:na,imap:Xa,ifilter:Wa,indexOf:R,lastIndexOf:xb,isort:jb,range:ya,extend:wb,namespace:ba,
typeOf:Da,strictEq:fb,strictNe:Ua,unsafeAdd:Ha,unsafeSub:ca,unsafeMul:E,unsafeDiv:ja,lt:F,le:H,gt:Pa,ge:gb,negate:vb,evalThunks:kb,toArray:Va,curry:hb,error:xa,eta:Qa});var Eb=new lb;la.prototype.toString=Ea();la.prototype.dataConstructorToString=Ea(true);la.prototype.update=Qa(xa);ba("Haskell_DataType",{data:Lb,ADT:la,record:Eb,accessor:Kb,accessors:{},showConstrOf:Ka});La.prototype.put=function(f,g){this.keys.push(f);this.values.push(g)};La.prototype.get=function(f){f=R(f,this.keys);if(f!=-1)return this.values[f]};
var ea={};ba("Haskell_TypeClass",{typeclass:nb,VARARG:ea,instance:Ra,getInstance:yb,asTypeOf:db});var Aa={};ra=new Ya;ba("Haskell_Expression",{operators:Aa,infix:zb,infixl:Mb,infixr:Fb,op:Ob,no:Nb,resolve:va,recurse:ra,Recurse:Ya,exl:Ab,exs:Pb});ba("Haskell_Do",{createDo:pb,Scope:Ma})})();(function(){namespace("Haskell");importSubmodules("Haskell",["Main","DataType","TypeClass","Expression","Do"])})();(function(){function ba(){}function $a(a){a.constructor=ma["Tuple"+a.length];return a}function U(){}
function Na(a,c){return a===true?c:a===false?false:K(va)}function fb(a,c){return a===true?true:a===false?c:K(Ab)}function Ua(a){return a===true?false:a===false?true:K(Ua)}function Ha(a){return a.charAt?"":[]}function ca(a,c){if(a.charAt&&c.charAt)return a+c;return[a].concat(c)}function E(a,c){if(a.charAt&&c.charAt)return a+c;return a+c.join("")}function ja(a){var c=a.charAt,i=c?a.charAt(0):a[0];a=c?a.substr(1):w(a,1);c=[i,a];c.head=i;c.tail=a;c.constructor=ma.Tuple2;return c}function F(a,c){for(var i=
c.charAt,p=[],L=0,G=c.length;L<G;++L)p[L]=a(i?c.charAt(L):c[L]);return p}function H(a,c,i){for(var p=i.charAt,L=i.length-1;L>-1;--L)c=a(p?i.charAt(L):i[L],c);return c}function Pa(a,c){var i=a.charAt,p=c.charAt;if(i)return a.concat(p?c:c.join(""));if(p)return(i?a:a.join("")).concat(c);return a.concat(c)}function gb(a){return a.charCodeAt(0)}function vb(a){return function(){return a().apply(null,arguments)}}function Da(a,c){!ignoreAsserts&&!a&&K("AssertionFailed");return c}function hb(a){return function(){return a}}
function Qa(a,c){return function(i){var p=w(arguments,1);p.unshift(c(i));return a.apply(null,p)}}function ib(a,c){return function(){return a(c.apply(null,arguments))}}function xa(a){return function(c,i){return a(i,c)}}function wb(a,c,i){return a(i)?i:wb(a,c,c(i))}function R(a,c){var i=c.length;if(!i)return ya.Nothing;for(var p=!!c.charAt,L=Qb($,mb(p?c.charAt(0):c[0])),G=0;G<i;++G)if(L.eq(p?c.charAt(G):c[G],a))return ya.Just(G);return ya.Nothing}function xb(a,c){return a===c?U.EQ:a<=c?U.LT:U.GT}function jb(a){return parseInt(a.join?
a.join(""):a,16)}function Va(a){return parseInt(a.join?a.join(""):a,8)}function ya(){}function kb(a){a.length||ea("head");return a.charAt?a.charAt(0):a[0]}function Kb(a){a.length||ea("tail");return a.substr?a.substr(1):w(a,1)}function lb(a){var c=a.length;c||ea("last");c=c-1;return a.charAt?a.charAt(c):a[c]}function la(a){var c=a.length;c||ea("init");c=c-1;return a.substring?a.substring(0,c):[].slice.call(a,0,c)}function Ea(a){return!a.length}function Db(a){return a.length}function Lb(a,c){for(var i=
[],p=0,L=c.length,G=c.charAt;p<L;++p)if(a(G?c.charAt(p):c[p]))i.push(c[p]);return G?i.join(""):i}function Ka(a,c,i){for(var p=0,L=i.length,G=i.charAt;p<L;++p)c=a(c,G?i.charAt(p):i[p]);return c}function La(a,c,i){if(i.length){i=ja(i);a=La(a,a(c,i.head),i.tail)}else a=Ha(i);return ca(c,a)}function nb(a,c){if(!c.length)return Ha(c);c=ja(c);return La(a,c.head,c.tail)}function Ra(a,c){var i=c.length;i==0&&ea("foldr1");if(i==1)return c.charAt?c.charAt(0):c[0];c=ja(c);return a(c.head,Ra(a,c.tail))}function yb(a,
c,i){if(!i.length)return ca(c,Ha(i));i=ja(i);c=yb(a,c,i.tail);return ca(a(i.head,c.head),c)}function db(a,c){var i=c.length;if(i==0)return Ha(c);if(i==1)return ca(c.charAt?c.charAt(0):c[0],Ha(c));c=ja(c);i=db(a,c.tail);return ca(a(c.head,i.head),i)}function Mb(a,c){for(var i=[],p=0;p<a;++p)i[p]=c;return i}function Fb(a,c){for(var i=!!c.charAt,p=0,L=c.length;p<L;++p)if(!a(i?c.charAt(p):c[p]))break;return i?c.substring(0,p):[].slice.call(c,0,p)}function zb(a,c){for(var i=!!c.charAt,p=0,L=c.length;p<
L;++p)if(!a(i?c.charAt(p):c[p]))break;return i?c.substr(p):w(c,p)}function ob(a,c){return c.substring?c.substring(0,a):[].slice.call(c,0,a)}function Gb(a,c){return c.substring?c.substring(a):[].slice.call(c,a)}function Ya(a,c){a=[ob(a,c),Gb(a,c)];a.constructor=ma.Tuple2;return a}function eb(a,c){a=[Fb(a,c),zb(a,c)];a.constructor=ma.Tuple2;return a}function Nb(a,c){return eb(function(i){return!a(i)},c)}function Ob(a){a=a.charAt;var c=V(c);c.reverse();return a?c.join(""):c}function va(a){return H(Na,
true,a)}function Ab(a){return H(fb,false,a)}function Pb(a,c){return Ab(F(a,c))}function Ma(a,c){return va(F(a,c))}function pb(a,c){return ga(a,c)!=-1}function ra(a,c){return ga(a,c)==-1}function Za(a,c){var i=c.length;if(!i)return ya.Nothing;for(var p=!!c.charAt,L=sa($,"eq",a),G=0;G<i;++G){var v=p?c.charAt(G):c[G];if(L(v[0],a))return ya.Just(v[1])}return ya.Nothing}function Oa(a,c){return H(function(i,p){return Pa(a(i),p)},[],c)}function Cb(a){return H(Pa,[],a)}function ka(a,c){return a.charAt?a.charAt(c):
a[c]}function qb(a,c){for(var i=[],p=a.charAt,L=c.charAt,G=0,v=Math.min(a.length,c.length);G<v;++G)i[G]=[p?a.charAt(G):a[G],L?c.charAt(G):c[G]];return i}function n(a,c,i){for(var p=[],L=a.charAt,G=c.charAt,v=i.charAt,T=0,ta=Math.min(a.length,c.length);T<ta;++T)p[T]=[L?a.charAt(T):a[T],G?c.charAt(T):c[T],v?i.charAt(T):i[T]];return p}function na(a,c,i){for(var p=[],L=c.charAt,G=i.charAt,v=0,T=Math.min(c.length,i.length);v<T;++v)p[v]=a(L?c.charAt(v):c[v],G?i.charAt(v):i[v]);return p}function Xa(a,c,
i,p){for(var L=[],G=c.charAt,v=i.charAt,T=p.charAt,ta=0,fc=Math.min(c.length,i.length);ta<fc;++ta)L[ta]=a(G?c.charAt(ta):c[ta],v?i.charAt(ta):i[ta],T?p.charAt(ta):p[ta]);return L}function Wa(a){return H(function(c,i){return[ca(c[0],i[0]),ca(c[1],i[1])]},[[],[]],a)}function Eb(a){return H(function(c,i){return[ca(c[0],i[0]),ca(c[1],i[1]),ca(c[2],i[2])]},[[],[],[]],a)}function ea(a){return K("Prelude."+a+": empty list")}function Aa(a){return/^\s$/.test(a)}function f(a){return a.toUpperCase()==a}function g(a){return a.toLowerCase()==
a}function l(a){return/^\w$/.test(a)&&/^\D$/.test(a)}function o(a){return/^\w$/.test(a)}function u(a){return/^\d$/.test(a)}function C(a){return/^[0-7]$/.test(a)}function B(a){return/^[0-9A-Fa-f]$/.test(a)}function Q(a){return a.toUpperCase()}function I(a){return a.toLowerCase()}function oa(a){return a.toUpperCase()}var N=NS.Haskell.Bool,w=NS.Haskell.slice,D=NS.Haskell.imap,ga=NS.Haskell.indexOf,Z=NS.Haskell.extend,da=NS.Haskell.namespace,mb=NS.Haskell.typeOf,Ja=NS.Haskell.strictEq,Ia=NS.Haskell.strictNe,
za=NS.Haskell.lt,pa=NS.Haskell.le,qa=NS.Haskell.gt,J=NS.Haskell.ge,V=NS.Haskell.toArray,Y=NS.Haskell.curry,K=NS.Haskell.error,ab=NS.Haskell.data,bb=NS.Haskell.typeclass,cb=NS.Haskell.VARARG,P=NS.Haskell.instance,Qb=NS.Haskell.getInstance,sa=NS.Haskell.asTypeOf,gc=NS.Haskell.operators,S=NS.Haskell.infixr,Ba=NS.Haskell.createDo,Rb=NS.Haskell.Scope;ab(ba,["Unit"]);da("GHC_Unit",{Unit:ba,unit:ba.Unit});var ma={};D(function(a){var c="Tuple"+a;ma[c]=function(){};ma[c]._name=c;ma["tuple"+a]=function(i){i.constructor=
ma[c];return i}},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]);ma.tuple=$a;da("GHC_Tuple",{Tuple:ma,tuple:$a});ab(U,["LT","EQ","GT"]);da("GHC_Ordering",{Ordering:U});var $=bb("Eq","a").types({eq:["a","a",Boolean],ne:["a","a",Boolean]}).impl(function(a){return{eq:function(c,i){return!a.ne(c,i)},ne:function(c,i){return!a.eq(c,i)}}});D=bb("Ord","a").context($).types({compare:["a","a",U],"<":["a","a",Boolean],"<=":["a","a",Boolean],">":["a","a",Boolean],">=":["a","a",Boolean],max:["a","a","a"],min:["a","a",
"a"]}).impl(function(a){var c=Qb($,a._type).eq;return{compare:function(i,p){return c(i,p)?U.EQ:a["<="](i,p)?U.LT:U.GT},"<":function(i,p){return a.compare(i,p).LT?true:false},"<=":function(i,p){return a.compare(i,p).GT?false:true},">":function(i,p){return a.compare(i,p).GT?true:false},">=":function(i,p){return a.compare(i,p).LT?false:true},max:function(i,p){return a["<="](i,p)?p:i},min:function(i,p){return a["<="](i,p)?i:p}}});da("GHC_Classes",{Eq:$,Ord:D,andOp:Na,orOp:fb,not:Ua});var Wb=bb("Functor",
"f").types({fmap:[Function,"f","f"],"<$":["a","f","f"]}).impl(function(a){return{"<$":function(c,i){return a.fmap(hb(c),i)}}});cb=bb("Monad","m").types({">>=":["m",Function,"m"],">>":["m","m","m"],return_:["a","m"],fail:[String,"m"],do_:cb,do$:cb,run:cb}).impl(function(a){return{">>":function(c,i){c=a[">>="](c,hb(i));c.constructor=a._type;return c},fail:function(c){return K(c)},do_:function(){function c(L){for(var G=new Rb(L),v=1,T=i.length,ta=i[0];v<T;++v)ta=p(ta,i[v]);v=_slice.call(arguments,1);
v.unshift(G);return ta.apply(null,v)}var i=arguments,p=a[">>"];c.constructor=a._type;return c},run:function(c){var i=w(arguments,1);i.unshift(new Rb);return c.apply(null,i)},do$:Ba(a)}});var Hb=ca;P($,Boolean,{eq:Ja,ne:Ia});P(D,Boolean,{compare:function(a,c){return a===true&&c===false?U.LT:a===false&&c===true?U.GT:U.EQ}});P($,U,{eq:function(a,c){return a.EQ&&c.EQ?true:a.LT&&c.LT?true:a.GT&&c.GT?true:false}});P(D,U,{"<=":function(a,c){return a.LT?true:c.LT?false:a.EQ?true:c.EQ?false:a.GT&&c.GT?true:
K()}});P($,String,{eq:Ja,ne:Ia});var Sa=String.fromCharCode,Sb=Number.MIN_VALUE,kc=Number.MAX_VALUE;P($,Number,{eq:Ja,ne:Ia});P(D,Number,{compare:function(a,c){return a===c?U.EQ:a<=c?U.LT:U.GT},"<":za,"<=":pa,">":qa,">=":J,max:function(a,c){return a<=c?c:a},min:function(a,c){return a<=c?a:c}});Ia=function(a){return a};Y=Y(function(a,c){return a(c)});P($,RegExp,{eq:function(a,c){return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline}});P($,Array,{eq:function(a,
c){var i=a.length;if(i!=c.length)return false;for(var p=0;p<i;++p)if(!$.eq(a[p],c[p]))return false;return true}});P($,Object,{eq:function(a,c){var i,p={};for(i in a)p[i]=true;for(i in c)p[i]=true;for(i in p)if(!$.eq(a[i],c[i]))return false;return true}});za=Math.round;pa=parseInt;Z(gc,{$:{func:Y,fixity:S(0)},".":{func:Qa,fixity:S(9)},":":{func:ca,fixity:S(5)},"++":{func:Pa,fixity:S(5)}});da("GHC_Base",{Unit:ba,Tuple:ma,Bool:N,Ordering:U,Eq:$,Ord:D,andOp:Na,orOp:fb,not:Ua,Functor:Wb,Monad:cb,emptyListOf:Ha,
cons:ca,consJoin:E,uncons:ja,augment:Hb,map:F,foldr:H,append:Pa,otherwise:true,ord:gb,chr:Sa,eqString:Ja,minInt:Sb,maxInt:kc,id:Ia,lazy:vb,assert:Da,const_:hb,compose1:Qa,compose:ib,flip:xa,call:Y,until:wb,asTypeOf:sa,elemIndex:R,unsafeCompare:xb,readHex:jb,readOct:Va,round:za,toInteger:pa,fromInteger:Ia,fromIntegral:Ia});var ha=bb("Show","a").types({show:["a",String]}).impl({show:function(a){return a.toString()}});P(ha,ba,{show:function(){return"()"}});P(ha,Boolean);P(ha,String,{show:function(a){return'"'+
a.toString()+'"'}});P(ha,Number);P(ha,RegExp);P(ha,Function,{show:function(a){var c=a.name||a._name||"\u03bb";if(a.constructor)return c+" :: "+a.constructor.name;a=(a=a.toString().match(/\([^\)]*\)/))&&a[0]||"";return c+a}});P(ha,Array,{show:function(a){return typeof a[0]==String?'"'+a.join("")+'"':"["+F(ha.show,a).join(", ")+"]"}});P(ha,Object,{show:function(a){var c=[];for(var i in a)c.push(" "+i+": "+ha.show(a[i]));return"{\n"+a.join(",\n")+"\n}"}});da("GHC_Show",{Show:ha});ab(ya,[["Just","a"],
"Nothing"]);da("GHC_Maybe",{Maybe:ya});da("GHC_List",{map:F,append:Pa,filter:Lb,concat:Cb,head:kb,last:lb,tail:Kb,init:la,null_:Ea,length:Db,index:ka,foldl:Ka,scanl:La,scanl1:nb,foldr:H,foldr1:Ra,scanr:yb,scanr1:db,replicate:Mb,take:ob,drop:Gb,splitAt:Ya,takeWhile:Fb,dropWhile:zb,span:eb,break_:Nb,reverse:Ob,and:va,or:Ab,any:Pb,all:Ma,elem:pb,notElem:ra,lookup:Za,concatMap:Oa,zip:qb,zip3:n,zipWith:na,zipWith3:Xa,unzip:Wa,unzip3:Eb,errorEmptyList:ea});da("GHC_Unicode",{isSpace:Aa,isUpper:f,isLower:g,
isAlpha:l,isAlphaNum:o,isDigit:u,isHexDigit:B,isOctDigit:C,toUpper:Q,toLower:I,toTitle:oa})})();(function(){function ba(){}function $a(b,e,j){return j.Left?b(j[0]):j.Right?e(j[0]):sa($a)}function U(b){for(var e=[],j=0,q=b.length;j<q;++j){var A=b[j];A.Left&&e.push(A[0])}return e}function Na(b){for(var e=[],j=0,q=b.length;j<q;++j){var A=b[j];A.Right&&e.push(A[0])}return e}function fb(b){function e(q){return function(A){return[w(q,A[0]),A[1]]}}function j(q){return function(A){return[A[0],w(q,A[1])]}}
return Z(function(q,A){return $a(e,j,q)(A)},[[],[]],b)}function Ua(b){return b[0]}function Ha(b){return b[1]}function ca(b){return function(e,j){e=[e,j];e.constructor=o.Tuple2;return b(e)}}function E(b){return function(e){return b(e[0],e[1])}}function ja(b,e,j){if(j.Nothing)return b;if(j.Just)return e(j[0])}function F(b){return!!b.Just}function H(b){return!!b.Nothing}function Pa(b){return b.Nothing?sa("Maybe.fromJust: Nothing"):b.Just?b[0]:sa()}function gb(b,e){return e.Nothing?b:e.Just?e[0]:sa(gb)}
function vb(b){return b.Nothing?[]:b.Just?[b[0]]:sa(vb)}function Da(b){if(!b.length)return N(b);return Ba.Just(b[0])}function hb(b){for(var e=[],j=0,q=b.length;j<q;++j)b[j].Just&&e.push(b[j][0]);return e}function Qa(b,e){var j=D(e);e=Qa(b,j.tail);b=b(j.head);return b.Nothing?e:b.Just?w(r,e):sa(Qa)}function ib(b,e){if(!b.length)return Ba.Just(e);b=D(b);e=D(e);if(b.head===e.head)return ib(b.tail,e.tail);return Ba.Nothing}function xa(b,e){return xb(function(){return B.eq(b)},e)}function wb(b,e){return jb(function(){return B.eq(b)},
e)}function R(b,e){return Da(Rb(b,e))}function xb(b,e){return Da(jb(b,e))}function jb(b,e){function j(q,A){if(!e.length)return e;return b(x)?w(q,j(q+1,A)):j(q+1,A)}return j(0,e)}function Va(b,e){if(!b.length)return true;if(!e.length)return false;b=D(b);e=D(e);return b.head===e.head&&Va(b.tail,e.tail)}function ya(b,e){return Va(lc(b),lc(e))}function kb(b,e){return Fa(function(j){return Va(b,j)},ra(e))}function Kb(b){function e(j,q){var A=D(j);return!j.length?N(j):W(A.head,q)?e(A.tail,q):w(A.head,e(A.tail,
w(A.head,q)))}return e(b,N(b))}function lb(b,e){return nub_(e,N(e))}function la(b,e){return Ea(B.eq,b,e)}function Ea(b,e,j){if(!j.length)return N(j);j=D(j);return b(e,j.head)?j.tail:w(j.head,Ea(b,e,j.tail))}function Db(b,e){return ha(pa(la),b,e)}function Lb(b,e){return Ka(B.eq,b,e)}function Ka(b,e,j){return da(e,ha(function(q,A){return Ea(b,A,q)},lb(b,j),e))}function La(b,e){return nb(B.eq,b,e)}function nb(b,e,j){return Rb(function(q){return Fa(function(A){return b(q,A)},j)},e)}function Ra(b,e){if(!e.length)return N(e);
if(e.length==1)return w($(e),N(e));e=D(e);return w(e.head,w(b,Ra(b,e.tail)))}function yb(b,e){return ma(Ra(b,e))}function db(b){if(!b.length)return N(b);b=D(b);if(!b.head.length)return db(b.tail);var e=D(b.head),j=e.head;e=e.tail;b=b.tail;return D(D(j,ga($,b)),db(D(e,ga(Wb,b))))}function Mb(b,e){return Z(function(j,q){return Fb(b,j,q)},[N(e),N(e)],e)}function Fb(b,e,j){var q=j[0];j=j[1];return b(e)?[w(e,q),j]:[q,w(e,j)]}function zb(b,e,j){if(!j.length)return[e,N(j)];j=D(j);var q=b(e,x);e=q[1];b=zb(b,
q[0],j.tail);return[b[0],w(e,b[1])]}function ob(b,e,j){if(!j.length)return[e,N(j)];j=D(j);j=ob(b,e,j.tail);e=j[1];b=b(j[0],x);return[b[0],w(b[1],e)]}function Gb(b,e){var j=S(Q,ab(b));return Ya(j.compare,b,e)}function Ya(b,e,j){if(!j.length)return w(e,N(j));j=D(j);return b(e,j.head).GT?w(j.head,Ya(b,e,j.tail)):w(e,j.tail)}function eb(b){if(!b.length)return Xb("maximum");var e=S(Q,ab($(b)));return na(e.max,b)}function Nb(b){if(!b.length)return Xb("minimum");var e=S(Q,ab($(b)));return na(e.min,b)}function Ob(b,
e){function j(q,A){return b(q,A).GT?q:A}if(!e.length)return Xb("maximumBy");return na(j,e)}function va(b,e){function j(q,A){return b(q,A).GT?A:q}if(!e.length)return Xb("minimumBy");return na(j,e)}function Ab(b,e,j){return ha(function(q,A){return Ea(b,A,q)},e,j)}function Pb(b){return Ma(B.eq,b)}function Ma(b,e){if(!e.length)return N(e);var j=D(e);e=mc(function(q){return b(x,q)},e);return w(w(j.head,e.ys),Ma(b,e.zs))}function pb(b){if(!b.length)return[N(b)];return da([N(b)],ga(function(e){return w(x,
e)},pb(b)))}function ra(b){if(!xs.length)return[N(b)];return w(b,ra(Wb(b)))}function Za(b){return w([],Oa(b))}function Oa(b){function e(q,A){return w(q,w(w(j.head,q),A))}var j=D(b);return w(j.head,Z(e,[],Oa(j.tail)))}function Cb(b){function e(j,q){function A(Yb,rb){return fa(Ia,Yb,rb)[1]}function fa(Yb,rb,Ta){if(!rb.length)return[ua.tail,Ta];var Zb=D(rb).head;Ta=fa(za(Yb,function(hc){w(Zb,hc)}),rb,Ta);rb=Ta[0];Ta=Ta[1];return[w(Zb,rb),w(Yb(w(ua.head,w(Zb,rb))),Ta)]}if(!j.length)return N(j);var ua=
D(j);return Z(A,e(ua.tail,w(ua.head,q)),Cb(q))}return w(b,e(b,[]))}function ka(b){var e=S(Q,ab(b.charAt?b.charAt(0):b[0]));return qb(e.compare,b)}function qb(b,e){function j(q,A){q=b(q,A);return q.LT?-1:q.GT?1:q.EQ?0:sa(ka)}if(e.sort)return e.sort(j);return Y(e).sort(j).join("")}function n(b,e){e=b(e);return e.Just?w(e[0][0],n(b,e[0][1])):e.Nothing?[]:sa()}function na(b,e){if(!e.length)return Xb("foldl1");e=D(e);return ha(b,e.head,e.tail)}function Xa(b){return ha(P,0,b)}function Wa(b){return ha(Qb,
1,b)}function Eb(b){b=b.split("\n");b[b.length-1]==""&&b.pop();return b}function ea(b){return b.join("\n")}function Aa(b){b=b.split(/\s+/);b[0]==""&&b.shift();b[b.length-1]==""&&b.pop();return b}function f(b){return b.join(" ")}function g(b){b=parseInt(b,16);return isNaN(b)?sa(g):b}var l=NS.GHC_Base.Unit,o=NS.GHC_Base.Tuple,u=NS.GHC_Base.Bool,C=NS.GHC_Base.Ordering,B=NS.GHC_Base.Eq,Q=NS.GHC_Base.Ord;l=NS.GHC_Base.andOp;l=NS.GHC_Base.orOp;l=NS.GHC_Base.not;var I=NS.GHC_Base.Functor,oa=NS.GHC_Base.Monad,
N=NS.GHC_Base.emptyListOf,w=NS.GHC_Base.cons,D=NS.GHC_Base.uncons,ga=NS.GHC_Base.map,Z=NS.GHC_Base.foldr,da=NS.GHC_Base.append,mb=NS.GHC_Base.ord,Ja=NS.GHC_Base.chr,Ia=NS.GHC_Base.id,za=NS.GHC_Base.compose1,pa=NS.GHC_Base.flip,qa=NS.GHC_Base.asTypeOf;xa=NS.GHC_Base.elemIndex;var J=NS.Haskell_DataType.data,V=NS.Haskell_DataType.ADT;V=NS.Haskell_DataType.record;V=NS.Haskell_DataType.accessor;V=NS.Haskell_DataType.accessors;V=NS.Haskell_DataType.showConstrOf;u=NS.Haskell_Main.Bool;u=NS.Haskell_Main.isArray;
u=NS.Haskell_Main.isDefined;var Y=NS.Haskell_Main.slice;u=NS.Haskell_Main.imap;var K=NS.Haskell_Main.ifilter;K=NS.Haskell_Main.indexOf;K=NS.Haskell_Main.lastIndexOf;K=NS.Haskell_Main.isort;K=NS.Haskell_Main.range;K=NS.Haskell_Main.extend;K=NS.Haskell_Main.namespace;var ab=NS.Haskell_Main.typeOf,bb=NS.Haskell_Main.strictEq,cb=NS.Haskell_Main.strictNe,P=NS.Haskell_Main.unsafeAdd;J=NS.Haskell_Main.unsafeSub;var Qb=NS.Haskell_Main.unsafeMul;J=NS.Haskell_Main.unsafeDiv;J=NS.Haskell_Main.lt;J=NS.Haskell_Main.le;
J=NS.Haskell_Main.gt;J=NS.Haskell_Main.ge;J=NS.Haskell_Main.negate;J=NS.Haskell_Main.evalThunks;J=NS.Haskell_Main.toArray;J=NS.Haskell_Main.curry;var sa=NS.Haskell_Main.error;J=NS.Haskell_Main.eta;B=NS.GHC_Classes.Eq;Q=NS.GHC_Classes.Ord;l=NS.GHC_Classes.andOp;l=NS.GHC_Classes.orOp;l=NS.GHC_Classes.not;C=NS.GHC_Ordering.Ordering;o=NS.GHC_Tuple.Tuple;l=NS.GHC_Unit.Unit;var gc=NS.GHC_Unit.unit;u=NS.Haskell.Bool;u=NS.Haskell.isArray;u=NS.Haskell.isDefined;Y=NS.Haskell.slice;u=NS.Haskell.imap;K=NS.Haskell.ifilter;
K=NS.Haskell.indexOf;K=NS.Haskell.lastIndexOf;K=NS.Haskell.isort;K=NS.Haskell.range;K=NS.Haskell.extend;K=NS.Haskell.namespace;ab=NS.Haskell.typeOf;bb=NS.Haskell.strictEq;cb=NS.Haskell.strictNe;P=NS.Haskell.unsafeAdd;J=NS.Haskell.unsafeSub;Qb=NS.Haskell.unsafeMul;J=NS.Haskell.unsafeDiv;J=NS.Haskell.lt;J=NS.Haskell.le;J=NS.Haskell.gt;J=NS.Haskell.ge;J=NS.Haskell.negate;J=NS.Haskell.evalThunks;J=NS.Haskell.toArray;J=NS.Haskell.curry;sa=NS.Haskell.error;J=NS.Haskell.eta;J=NS.Haskell.data;V=NS.Haskell.ADT;
V=NS.Haskell.record;V=NS.Haskell.accessor;V=NS.Haskell.accessors;V=NS.Haskell.showConstrOf;V=NS.Haskell.instance;var S=NS.Haskell.getInstance;qa=NS.Haskell.asTypeOf;var Ba=NS.GHC_Maybe.Maybe;ga=NS.GHC_List.map;da=NS.GHC_List.append;var Rb=NS.GHC_List.filter,ma=NS.GHC_List.concat,$=NS.GHC_List.head;qa=NS.GHC_List.last;var Wb=NS.GHC_List.tail,Hb=NS.GHC_List.init,Sa=NS.GHC_List.null_,Sb=NS.GHC_List.length,kc=NS.GHC_List.index,ha=NS.GHC_List.foldl,a=NS.GHC_List.scanl,c=NS.GHC_List.scanl1;Z=NS.GHC_List.foldr;
var i=NS.GHC_List.foldr1,p=NS.GHC_List.scanr,L=NS.GHC_List.scanr1,G=NS.GHC_List.replicate,v=NS.GHC_List.take,T=NS.GHC_List.drop,ta=NS.GHC_List.splitAt,fc=NS.GHC_List.takeWhile,M=NS.GHC_List.dropWhile,mc=NS.GHC_List.span,zc=NS.GHC_List.break_,lc=NS.GHC_List.reverse,Tb=NS.GHC_List.and,bc=NS.GHC_List.or,Fa=NS.GHC_List.any,Ib=NS.GHC_List.all,W=NS.GHC_List.elem,Ca=NS.GHC_List.notElem,sb=NS.GHC_List.lookup,Ub=NS.GHC_List.concatMap,Ec=NS.GHC_List.zip,O=NS.GHC_List.zip3,aa=NS.GHC_List.zipWith,tb=NS.GHC_List.zipWith3,
nc=NS.GHC_List.unzip,oc=NS.GHC_List.unzip3,Xb=NS.GHC_List.errorEmptyList,pc=NS.GHC_Unicode.isSpace,qc=NS.GHC_Unicode.isUpper,rc=NS.GHC_Unicode.isLower,Ac=NS.GHC_Unicode.isAlpha,Bc=NS.GHC_Unicode.isAlphaNum,d=NS.GHC_Unicode.isDigit,h=NS.GHC_Unicode.isHexDigit,k=NS.GHC_Unicode.isOctDigit,s=NS.GHC_Unicode.toUpper,y=NS.GHC_Unicode.toLower,z=NS.GHC_Unicode.toTitle;J(ba,[["Left","a"],["Right","b"]]);K("Data_Either",{Either:ba,either:$a,lefts:U,rights:Na,partitionEithers:fb});V(B,l,{eq:bb,ne:cb});V(Q,l,
{"<=":function(){return true},"<":function(){return false},">=":function(){return true},">":function(){return false},max:function(){return gc},min:function(){return gc},compare:function(){return C.EQ}});K("Data_Tuple",{fst:Ua,snd:Ha,curry_:ca,uncurry:E});V(I,Ba,{fmap:function(b,e){return e.Nothing?Ba.Nothing:e.Just?Ba.Just(b(e[0])):sa("Functor.Maybe.fmap")}});V(oa,Ba,{">>=":function(b,e){return b.Just?e(b[0]):b.Nothing?Ba.Nothing:sa("Monad.Maybe.>>=")},">>":function(b,e){return b.Just?e:b.Nothing?
Ba.Nothing:sa("Monad.Maybe.>>")},return_:Ba.Just,fail:Ba.Nothing});K("Data_Maybe",{Maybe:Ba,maybe:ja,isJust:F,isNothing:H,fromJust:Pa,fromMaybe:gb,listToMaybe:Da,maybeToList:vb,catMaybes:hb,mapMaybe:Qa});var t={};u(function(b){t["zip"+b]=function(){return t["zipWith"+b](o["tuple"+b](Y(arguments)))};t["zipWith"+b]=function(e){var j=ga(D,Y(arguments,1)),q=ga(Ua,j);j=ga(Ha,j);return w(e.apply(null,q),t["zipWith"+b].apply(null,[e].concat(j)))};t["unzip"+b]=function(e){return Z(function(j,q){return ga(w,
j,q)},G(b,[]),e)}},[4,5,6,7]);K("Data_List",{append:da,head:$,last:qa,tail:Wb,init:Hb,null_:Sa,length:Sb,map:ga,reverse:lc,intersperse:Ra,intercalate:yb,transpose:db,subsequences:Za,permutations:Cb,foldl:ha,foldl1:na,foldr:Z,foldr1:i,concat:ma,concatMap:Ub,and:Tb,or:bc,any:Fa,all:Ib,sum:Xa,product:Wa,maximum:eb,minimum:Nb,scanl:a,scanl1:c,scanr:p,scanr1:L,mapAccumL:zb,mapAccumR:ob,replicate:G,unfoldr:n,take:v,drop:T,splitAt:ta,takeWhile:fc,dropWhile:M,span:mc,break_:zc,stripPrefix:ib,group:Pb,inits:pb,
tails:ra,isPrefixOf:Va,isSuffixOf:ya,isInfixOf:kb,elem:W,notElem:Ca,lookup:sb,find:R,filter:Rb,partition:Mb,index:kc,elemIndex:xa,elemIndices:wb,findIndex:xb,findIndices:jb,zip:Ec,zip3:O,zip4:t.zip4,zip5:t.zip5,zip6:t.zip6,zip7:t.zip7,zipWith:aa,zipWith3:tb,zipWith4:t.zipWith4,zipWith5:t.zipWith5,zipWith6:t.zipWith6,zipWith7:t.zipWith7,unzip:nc,unzip3:oc,unzip4:t.unzip4,unzip5:t.unzip5,unzip6:t.unzip6,unzip7:t.unzip7,lines:Eb,words:Aa,unlines:ea,unwords:f,nub:Kb,delete_:la,difference:Db,union:Lb,
intersect:La,sort:ka,insert:Gb,nubBy:lb,deleteBy:Ea,deleteFirstsBy:Ab,unionBy:Ka,intersectBy:nb,groupBy:Ma,sortBy:qb,insertBy:Ya,maximumBy:Ob,minimumBy:va});K("Data_Char",{String:String,ord:mb,chr:Ja,isSpace:pc,isUpper:qc,isLower:rc,isAlpha:Ac,isAlphaNum:Bc,isDigit:d,isHexDigit:h,isOctDigit:k,toUpper:s,toLower:y,toTitle:z,digitToInt:g})})();(function(){var ba=NS.Data_Maybe.Maybe,$a=NS.Data_Maybe.maybe,U=NS.Data_List.append,Na=NS.Data_List.head,fb=NS.Data_List.last,Ua=NS.Data_List.tail,Ha=NS.Data_List.init,
ca=NS.Data_List.null_,E=NS.Data_List.length,ja=NS.Data_List.map,F=NS.Data_List.reverse,H=NS.Data_List.foldl,Pa=NS.Data_List.foldl1,gb=NS.Data_List.foldr,vb=NS.Data_List.foldr1,Da=NS.Data_List.concat,hb=NS.Data_List.concatMap,Qa=NS.Data_List.and,ib=NS.Data_List.or,xa=NS.Data_List.any,wb=NS.Data_List.all,R=NS.Data_List.sum,xb=NS.Data_List.product,jb=NS.Data_List.maximum,Va=NS.Data_List.minimum,ya=NS.Data_List.scanl,kb=NS.Data_List.scanl1,Kb=NS.Data_List.scanr,lb=NS.Data_List.scanr1,la=NS.Data_List.replicate,
Ea=NS.Data_List.take,Db=NS.Data_List.drop,Lb=NS.Data_List.splitAt,Ka=NS.Data_List.takeWhile,La=NS.Data_List.dropWhile,nb=NS.Data_List.span,Ra=NS.Data_List.break_,yb=NS.Data_List.elem,db=NS.Data_List.notElem,Mb=NS.Data_List.lookup,Fb=NS.Data_List.filter,zb=NS.Data_List.index,ob=NS.Data_List.elemIndex,Gb=NS.Data_List.zip,Ya=NS.Data_List.zip3,eb=NS.Data_List.zipWith,Nb=NS.Data_List.zipWith3,Ob=NS.Data_List.unzip,va=NS.Data_List.unzip3,Ab=NS.Data_List.lines,Pb=NS.Data_List.words,Ma=NS.Data_List.unlines,
pb=NS.Data_List.unwords,ra=NS.Data_Tuple.fst,Za=NS.Data_Tuple.snd,Oa=NS.Data_Tuple.curry_,Cb=NS.Data_Tuple.uncurry,ka=NS.Data_Either.Either,qb=NS.Data_Either.either,n=NS.GHC_Show.Show,na=NS.GHC_Base.Bool,Xa=NS.GHC_Base.Ordering,Wa=NS.GHC_Base.Eq,Eb=NS.GHC_Base.Ord,ea=NS.GHC_Base.andOp,Aa=NS.GHC_Base.orOp,f=NS.GHC_Base.not,g=NS.GHC_Base.Functor,l=NS.GHC_Base.Monad,o=NS.GHC_Base.emptyListOf,u=NS.GHC_Base.cons,C=NS.GHC_Base.consJoin,B=NS.GHC_Base.uncons;ja=NS.GHC_Base.map;gb=NS.GHC_Base.foldr;U=NS.GHC_Base.append;
var Q=NS.GHC_Base.otherwise,I=NS.GHC_Base.id,oa=NS.GHC_Base.const_,N=NS.GHC_Base.compose1,w=NS.GHC_Base.compose,D=NS.GHC_Base.flip,ga=NS.GHC_Base.call,Z=NS.GHC_Base.until,da=NS.GHC_Base.asTypeOf;ob=NS.GHC_Base.elemIndex;var mb=NS.GHC_Base.unsafeCompare,Ja=NS.GHC_Base.readHex,Ia=NS.GHC_Base.readOct,za=NS.GHC_Base.round,pa=NS.GHC_Base.toInteger,qa=NS.GHC_Base.fromInteger,J=NS.GHC_Base.fromIntegral;na=NS.Haskell.Bool;var V=NS.Haskell.namespace,Y=NS.Haskell.curry,K=NS.Haskell.error;da=NS.Haskell.asTypeOf;
V("Prelude",{cons:u,consJoin:C,uncons:B,elemIndex:ob,unsafeCompare:mb,emptyListOf:o,readHex:Ja,readOct:Ia,round:za,toInteger:pa,fromInteger:qa,fromIntegral:J,Bool:na,andOp:ea,orOp:Aa,not:f,otherwise:Q,Maybe:ba,maybe:$a,Either:ka,either:qb,Ordering:Xa,String:String,fst:ra,snd:Za,curry:Y,curry_:Oa,uncurry:Cb,Eq:Wa,Ord:Eb,fromIntegral:J,Monad:l,Functor:g,id:I,const_:oa,compose:w,compose1:N,flip:D,call:ga,until:Z,asTypeOf:da,error:K,map:ja,append:U,filter:Fb,head:Na,last:fb,tail:Ua,init:Ha,null_:ca,length:E,
index:zb,reverse:F,foldl:H,foldl1:Pa,foldr:gb,foldr1:vb,and:Qa,or:ib,any:xa,all:wb,sum:R,product:xb,concat:Da,concatMap:hb,maximum:jb,minimum:Va,scanl:ya,scanl1:kb,scanr:Kb,scanr1:lb,replicate:la,take:Ea,drop:Db,splitAt:Lb,takeWhile:Ka,dropWhile:La,span:nb,break_:Ra,elem:yb,notElem:db,lookup:Mb,zip:Gb,zip3:Ya,zipWith:eb,zipWith3:Nb,unzip:Ob,unzip3:va,lines:Ab,words:Pb,unlines:Ma,unwords:pb,Show:n})})();(function(){function ba(d,h){this.input=d;this.index=h||0;this.length=d.length-this.index;this.cache=
{};return this}function $a(d){return new ba(d)}function U(d){return function(h,k,s){return s({ast:null,success:false,expecting:{unexpected:d}})}}function Na(d){return function(h,k,s){return s({success:false,expecting:d})}}function fb(d,h,k){return k({success:false})}function Ua(d){return typeof d=="string"?sb(d):Ia(d)?sa(d):d}function Ha(d,h,k,s,y){var z=h instanceof ba?h:$a(h);V(d(new Ba,z,function(t){t.state=z;delete t.index;delete t.length;if(t.success){delete t.error;delete t.expecting}else{t.error=
ca(t.expecting,t.state);s&&s(t.error)}k(t)}),y)}function ca(d,h,k,s){k=k===undefined?h.index:k;if(typeof d=="string"){var y=h.input.split("\n"),z=y.length,t=h.input.substr(k).split("\n").length;z=z-t+1;y=k-y.splice(0,z-1).join("\n").length;h=s||h.input.substr(k,d.length).substr(0,6);return'Unexpected "'+(h.length?h:"end of input")+(s?"":'", expecting "'+d)+'" at line '+z+" char "+y}if(Ia(d)){d=w(function(b){return typeof b=="object"?b.expecting:b},d);return ca(d.join('" or "'),h)}else if(typeof d==
"object")return ca(d.expecting,h,d.at,d.unexpected)}function E(){}function ja(d,h){return function(k,s,y){return function(){return d(k,s,function(z){return z.success?function(){return h(z.ast)(k,s,y)}:y(z)})}}}function F(d,h){if(d=="scope")throw"Can't use 'scope' as an identifier!";return function(k,s,y){return function(){return h(k,s,function(z){if(z.success)k[d]=z.ast;return y(z)})}}}function H(d,h){h&&za(arguments);return function(k,s,y){return function(){return function(){var z;if(typeof d=="string"){if(!(d in
k))throw'Not in scope: "'+d+'"';z=k[d]}else z=d(k);return y({ast:z,success:true})}}}}function Pa(d){var h=za(arguments,1);return function(k){return d.apply(null,w(function(s){return k[s]},h))}}function gb(d,h,k){return k({ast:h.index,success:true})}function vb(d){var h=typeof d;return function(k,s,y){s.scrollTo(h=="string"?k[d]:d);return y({success:true})}}function Da(d){return function(h,k,s){return s({ast:d,success:true})}}function hb(d,h){return v(F("a",d),F("b",h),H(function(k){return k.a(k.b)}))}
function Qa(d,h){return v(F("x1",h),T(d,"x1"))}function ib(d,h,k){return v(F("x1",h),F("x2",k),T(d,"x1","x2"))}function xa(d,h,k,s){return v(F("x1",h),F("x2",k),F("x3",s),T(d,"x1","x2","x3"))}function wb(d,h){return v(F("a",d),h,H("a"))}function R(d,h){function k(s,y,z){return function(){return d(s,y,function(t){function b(j){var q=j.expecting;if(q)if(q.constructor==Array)e=e.concat(q);else e.push(q);j.expecting=j.success?c:e}var e=[];b(t);return t.ast!==c?function(){return z(t)}:function(){return h(s,
y,function(j){b(j);return z(j)})}})}}k.constructor=E;return k}function xb(){var d=w(Ua,arguments);return function(h,k,s){for(var y=1,z=d.length,t=d[0];y<z;++y)t=R(t,d[y]);return t(h,k,s)}}function jb(d){return function(h,k,s){function y(e){return function(j,q,A){return function(){return e(j,q,function(fa){z++;if(!fa.success)return A(fa);fa.ast!==c&&t.push(fa.ast);return z<b?y(d[z])(j,q,A):A(fa)})}}}var z=0,t=[],b=d.length;return function(){return y(d[z])(h,k,function(e){var j=e.success;return s({ast:t,
success:j,expecting:j?c:e.expecting})})}}}function Va(d){return function(h){return function(k,s,y){function z(e){return function(j,q,A){return function(){return e(j,q,function(fa){if(!fa.success)return A(fa);t=true;fa.ast!==c&&b.push(fa.ast);return z(e)(j,q,A)})}}}var t=false,b=[];return function(){return z(h)(k,s,function(e){var j=!d||t&&d;return y({ast:j?b:c,success:j,expecting:j?c:e.expecting})})}}}}function ya(d){return function(h){var k=L++,s=function(y,z,t){y=z.index;var b=z.getCached(k);if(b!==
c)return t(b);b=d(h,z,y);z.putCached(k,y,b);return t(b)};s.constructor=E;return s}}function kb(d){return function(h,k){var s=L++,y=function(z,t,b){var e=t.index,j=t.getCached(s);if(j!==c)return b(j);return function(){return h(z,t,function(q){q=d(k,q,t,e);t.putCached(s,e,q);return b(q)})}};y.constructor=E;return y}}function Kb(d){return function(h,k,s){return d(h)(h,k,s)}}function lb(d){function h(k,s){return v(F("x",k),F("xs",s),H(Pa(ka,"x","xs")))}return Z(h,M([]),d)}function la(d){return Z(R,p,
d)}function Ea(d,h){return R(h,M(d))}function Db(d){return Ea(Aa.Nothing,Qa(Aa.Just,d))}function Lb(d){return R(v(d,M(null)),M(null))}function Ka(d,h,k){return v(d,F("x",k),h,H("x"))}function La(d){return v(d,Ib(d))}function nb(d,h){return R(Ra(d,h),M([]))}function Ra(d,h){return v(F("x",d),F("xs",Tb(v(h,d))),T(ka,"x","xs"))}function yb(d,h){return v(F("x",d),R(v(h,F("xs",function(k,s,y){return db(d,h)(k,s,y)}),H(function(k){return ka(k.scope.x,k.xs)})),H(function(k){return[k.x]})))}function db(d,
h){return R(yb(d,h),M([]))}function Mb(d,h){return bc(v(F("x",d),h,H("x")))}function Fb(d,h){return Tb(v(F("x",d),h,H("x")))}function zb(d,h){return d<=0?M([]):lb(da(d,h))}function ob(d,h,k){return R(eb(d,h),M(k))}function Gb(d,h,k){return R(Ya(d,h),M(k))}function Ya(d,h){function k(s){var y=v(F("f",h),F("y",d),function(z,t,b){return k(z.f(s,z.y))(z,t,b)});return R(y,M(s))}return ja(d,k)}function eb(d,h){function k(y){var z=v(F("f",h),F("y",s),H(function(t){return t.f(y,t.y)}));return R(z,M(y))}var s=
ja(d,k);return s}function Nb(d,h,k){d=h.at(0);if(d.length){h.scroll(1);return k({ast:d,success:true})}return k({success:false,expecting:"anyToken"})}function Ob(d,h,k){return k({success:!h.length,expecting:h.length?"end of input":c})}function va(d){return Fa(R(ja(Fa(d),U),M(null)))}function Ab(d,h){function k(y,z,t){return s(y,z,t)}var s=R(v(h,M([])),v(F("x",d),F("xs",k),T(ka,"x","xs")));return s}function Pb(d){return v(F("state",ta),F("x",d),fc("state"),H("x"))}function Ma(){}function pb(){}function ra(d){function h(m){return k(sb(m))}
function k(m){return v(F("x",m),Lc,H("x"))}function s(m,X,ia){return Mc(m,X,ia)}function y(m,X,ia){return Nc(m,X,ia)}function z(m,X,ia){return Fc(m,X,ia)}function t(m){return Ka(h("("),h(")"),m)}function b(m){return Ka(h("{"),h("}"),m)}function e(m){return Ka(h("<"),h(">"),m)}function j(m){return Ka(h("["),h("]"),m)}function q(m){return nb(m,Gc)}function A(m){return nb(m,Hc)}function fa(m){return Ra(m,Gc)}function ua(m){return Ra(m,Hc)}function Yb(m){return v(W(m[0]),M(m[1]))}function rb(m){return Fa(v(sb(m[0]),
M(m[1])))}function Ta(m,X){return O("digits","<-",bc,X)(H,function(ia){return ga(function(ub,sc){return m*ub+Xa(ha(sc))},0,ia.digits)})}function Zb(m,X,ia){return cc(m,X,ia)}function hc(m,X){return(X+Eb(ha(m)))/10}function tc(m){return m<0?1/tc(-m):Wa(Math.pow(10,m))}function uc(m){return aa(O("fract","<-",Qc)("expo","<-",Ea,1,Oc)(H,function(X){return Wa(m+X.fract)*X.expo}),"<|>",O("expo","<-",Oc)(H,function(X){return Wa(m)*X.expo}))}function vc(m){return O("f","<-",uc,m)(T,g.Right,"f")}function wc(m){return aa(k,
"$",Fa,O(sb(m))(va,d.opLetter,"<?>","end of "+m))}function ic(m){return Cc(pa(d.reservedOpNames),m)}function Ga(m){function X(ub){return!ub.length?M(null):v(Ub(ia(ub[0]),""+m),X(za(ub,1)))}function ia(ub){return Wb(ub)?R(W(ub.toLowerCase()),W(ub.toUpperCase())):W(ub)}return d.caseSensitive?sb(m):v(X(m),M(m))}function Bb(m){return aa(k,"$",Fa,O(Ga(m))(va,d.identLetter,"<?>","end of "+m))}function Cc(m,X){function ia(sc){if(!sc.length)return false;var Ic=ub(sc[0],X);return Ic.LT?ia(za(sc,1)):Ic.EQ?
true:Ic.GT?false:null}var ub=na;return ia(m)}function Jc(m){m=d.caseSensitive?m:m.toLowerCase();return Cc(Rc,m)}if(!d.LanguageDef)throw"Type error: unexpected '"+d.constructor.name+"', expecting 'GenLanguageDef.LanguageDef'";var jc=La(Ca(Rb)),Dc=O(Fa(sb(d.commentLine)))(Ib,Ca(function(m){return m!="\n"}))(M,null),wa=a(za(d.commentEnd+d.commentStart)),Mc=aa(v(Fa(sb(d.commentEnd)),M(null)),"<|>",v(La(nc(wa)),s),"<|>",v(tb(wa),s),"<?>","end of comment"),Nc=aa(v(Fa(sb(d.commentEnd)),M(null)),"<|>",v(z,
y),"<|>",v(La(nc(wa)),y),"<|>",v(tb(wa),y),"<?>","end of comment");wa=d.nestedComments?Nc:Mc;var Fc=v(Fa(sb(d.commentStart)),wa);wa=D(d.commentLine);var Jb=D(d.commentStart),Lc=S(wa&&Jb?[Ib,[jc,"<?>",""]]:wa?[Ib,[jc,"<|>",Fc,"<?>",""]]:Jb?[Ib,[jc,"<|>",Dc,"<?>",""]]:[Ib,[jc,"<|>",Dc,"<|>",Fc,"<?>",""]]),Hc=h(";"),Gc=h(",");jc=h(".");Dc=h(":");wa=Ja(za("abfnrtv\\\"'"),za("a\u0008\u000c\n\r\t\u000b\\\"'"));Jb=Ja(["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","DLE","DC1","DC2","DC3","DC4","NAK","SYN",
"ETB","CAN","SUB","ESC","DEL"].concat(["BS","HT","LF","VT","FF","CR","SO","SI","EM","FS","GS","RS","US","SP"]),["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","SUB","ESC","DEL"].concat(["BS","HT","LF","VT","FF","CR","SO","SI","EM","FS","GS","RS","US","SP"]));wa=la(w(Yb,wa));var Vb=la(w(rb,Jb));Jb=Ca(function(m){return m!='"'&&m!="\\"&&m>"\u0016"});var dc=W("&"),xc=O(bc,oc)(W("\\"),"<?>","end of string gap"),ec=O("code","<-",Zb,"<|>",v(W("o"),
Ta(8,rc)),"<|>",v(W("x"),Ta(16,qc)))(H(function(m){return toEnum(Wa(m.code))})),$b=O(W("^"))("code","<-",Xb)(H(function(m){return toEnum(fromEnum(m.code)-fromEnum("A"))}));Vb=aa(wa,"<|>",ec,"<|>",Vb,"<|>",$b,"<?>","escape code");wa=v(W("\\"),Vb);ec=Ca(function(m){return m!="'"&&m!="\\"&&m>"\u0016"});wa=aa(ec,"<|>",wa,"<?>","literal character");wa=aa(k,[Ka,W("'"),[W("'"),"<?>","end of character"],wa],"<?>","character");dc=O(W("\\"))(v(xc,M(Aa.Nothing)),"<|>",v(dc,M(Aa.Nothing)),"<|>",O("esc","<-",
Vb)(T,Aa.Just,"esc"));Jb=aa(O("c","<-",Jb)(T,Aa.Just,"c"),"<|>",dc,"<?>","string character");Jb=aa(k,[O("str","<-",Ka,W('"'),[W('"'),"<?>","end of string"],[Tb,Jb])(H,function(m){return Z(o(f)(C,o(ka)),"",m.str)}),"<?>","literal string"]);var cc=Ta(10,pc);dc=O(tb,"xX")(Ta,16,qc);xc=O(tb,"oO")(Ta,8,rc);var Qc=aa(O(W("."))("digits","<-",bc,pc,"<?>","fraction")(H,function(m){return Z(hc,0,m.digits)}),"<?>","fraction");Vb=aa([W("-"),">>",M,J],"<|>",[W("+"),">>",M,C],"<|>",M,C);var Oc=aa(O(tb,"eE")("f",
"<-",Vb)("e","<-",cc,"<?>","exponent")(T,tc,"f","e"),"<?>","exponent");ec=O("n","<-",cc)(function(m,X,ia){return uc(m.n)(m,X,ia)});$b=O("n","<-",cc)(function(m,X,ia){return Ea(g.Left(m.n),vc(m.n))(m,X,ia)});var ac=aa(O("n","<-",dc,"<|>",xc)(T,g.Left,"n"),"<|>",$b,"<|>",vc(0),"<|>",M,g.Left(0));$b=aa(v(W("0"),ac),"<|>",$b);ac=aa(O(W,"0")(dc,"<|>",xc,"<|>",cc,"<|>",M,0),"<?>","");ac=R(ac,cc);var yc=O("f","<-",k,Vb)("n","<-",ac)(H,function(m){return m.f(m.n)});Vb=S(k,$b,"<?>","number");ec=S(k,ec,"<?>",
"float");$b=S(k,yc,"<?>","integer");ac=S(k,ac,"<?>","natural");yc=aa(O("c","<-",d.opStart)("cs","<-",Tb,d.opLetter)(T,qb,"c","cs"),"<?>","operator");yc=aa(k,"$",Fa,O("name","<-",yc)(function(m,X,ia){return(ic(m.name)?U("reserved operator "+m.name):M(m.name))(m,X,ia)}));var Kc=aa(O("c","<-",d.identStart)("cs","<-",Tb,d.identLetter)(T,qb,"c","cs"),"<?>","identifier");Kc=aa(k,"$",Fa,O("name","<-",Kc)(function(m,X,ia){return(Jc(m.name)?U("reserved word "+m.name):M(m.name))(m,X,ia)}));var Pc=pa(d.reservedNames),
Rc=d.caseSensitive?Pc:w(function(m){return m.toLowerCase()},Pc);return pb.TokenParser(Y,{identifier:Kc,reserved:Bb,operator:yc,reservedOp:wc,charLiteral:wa,stringLiteral:Jb,natural:ac,integer:$b,float_:ec,naturalOrFloat:Vb,decimal:cc,hexadecimal:dc,octal:xc,symbol:h,lexeme:k,whiteSpace:Lc,parens:t,braces:b,angles:e,brackets:j,squares:j,semi:Hc,comma:Gc,colon:Dc,dot:jc,semiSep:A,semiSep1:ua,commaSep:q,commaSep1:fa})}function Za(){}function Oa(){}function Cb(d,h){function k(t,b){return function(e,j,
q){return t(e[b])(e,j,q)}}function s(t,b){var e=t[0],j=b[0],q=b[1],A=b[2],fa=b[3];b=b[4];if(t.Infix){var ua=t[1];if(ua.AssocNone)return[j,q,ka(e,A),fa,b];if(ua.AssocLeft)return[j,ka(e,q),A,fa,b];if(ua.AssocRight)return[ka(e,j),q,A,fa,b]}if(t.Prefix)return[j,q,A,ka(e,fa),b];if(t.Postfix)return[j,q,A,fa,ka(e,b)]}function y(t,b){return Fa(v(b,i("ambiguous use of a "+t+" associative operator")))}function z(t,b){function e(Ga){return aa(O("f","<-",Zb)("y","<-",O("z","<-",ic)(k,j,"z"))(H,function(Bb){return Bb.f(Ga,
Bb.y)}),"<|>",vc,"<|>",wc)}function j(Ga){return R(e(Ga),M(Ga))}function q(Ga){return aa(O("f","<-",hc)("y","<-",ic)(function(Bb,Cc,Jc){return A(Bb.f(Ga,Bb.y))(Bb,Cc,Jc)}),"<|>",uc,"<|>",wc)}function A(Ga){return R(q(Ga),M(Ga))}function fa(Ga){return O("f","<-",tc)("y","<-",ic)(uc,"<|>",vc,"<|>",wc,"<|>",H,function(Bb){return Bb.f(Ga,Bb.y)})}var ua=Z(s,[[],[],[],[],[]],b),Yb=ua[1],rb=ua[2],Ta=ua[3];b=ua[4];var Zb=la(ua[0]),hc=la(Yb),tc=la(rb);ua=Ub(la(Ta),"");b=Ub(la(b),"");var uc=y("right",Zb),vc=
y("left",hc),wc=y("non",tc);b=R(b,M(C));ua=R(ua,M(C));var ic=O("pre","<-",ua)("x","<-",t)("post","<-",b)(H,function(Ga){return Ga.post(Ga.pre(Ga.x))});return O("x","<-",ic)(k,e,"x","<|>",k,q,"x","<|>",k,fa,"x","<|>",H,"x","<?>","operator").resolve()}return ga(z,h,d)}var ka=NS.Prelude.cons,qb=NS.Prelude.consJoin,n=NS.Prelude.elemIndex,na=NS.Prelude.unsafeCompare,Xa=NS.Prelude.toInteger,Wa=NS.Prelude.fromInteger,Eb=NS.Prelude.fromIntegral,ea=NS.Prelude.Bool,Aa=NS.Prelude.Maybe,f=NS.Prelude.maybe,g=
NS.Prelude.Either,l=NS.Prelude.String,o=NS.Prelude.curry,u=NS.Prelude.Monad,C=NS.Prelude.id,B=NS.Prelude.const_,Q=NS.Prelude.compose,I=NS.Prelude.flip,oa=NS.Prelude.call;l=NS.Prelude.asTypeOf;var N=NS.Prelude.error,w=NS.Prelude.map;n=NS.Prelude.append;n=NS.Prelude.filter;n=NS.Prelude.head;n=NS.Prelude.last;n=NS.Prelude.tail;n=NS.Prelude.init;var D=NS.Prelude.null_;n=NS.Prelude.length;n=NS.Prelude.index;n=NS.Prelude.reverse;var ga=NS.Prelude.foldl;n=NS.Prelude.foldl1;var Z=NS.Prelude.foldr;n=NS.Prelude.foldr1;
n=NS.Prelude.and;n=NS.Prelude.or;n=NS.Prelude.any;n=NS.Prelude.all;n=NS.Prelude.sum;n=NS.Prelude.product;n=NS.Prelude.concat;n=NS.Prelude.concatMap;n=NS.Prelude.maximum;n=NS.Prelude.minimum;n=NS.Prelude.scanl;n=NS.Prelude.scanl1;n=NS.Prelude.scanr;n=NS.Prelude.scanr1;var da=NS.Prelude.replicate;n=NS.Prelude.take;n=NS.Prelude.drop;n=NS.Prelude.splitAt;n=NS.Prelude.takeWhile;n=NS.Prelude.dropWhile;n=NS.Prelude.span;n=NS.Prelude.break_;var mb=NS.Prelude.elem;n=NS.Prelude.notElem;n=NS.Prelude.lookup;
var Ja=NS.Prelude.zip;n=NS.Prelude.zip3;n=NS.Prelude.zipWith;n=NS.Prelude.zipWith3;n=NS.Prelude.unzip;n=NS.Prelude.unzip3;n=NS.Prelude.lines;n=NS.Prelude.words;n=NS.Prelude.unlines;n=NS.Prelude.unwords;ea=NS.Haskell.Bool;var Ia=NS.Haskell.isArray,za=NS.Haskell.slice,pa=NS.Haskell.isort,qa=NS.Haskell.extend;ea=NS.Haskell.namespace;var J=NS.Haskell.negate,V=NS.Haskell.evalThunks;o=NS.Haskell.curry;N=NS.Haskell.error;N=NS.Haskell.data;var Y=NS.Haskell.record,K=NS.Haskell.instance,ab=NS.Haskell.getInstance;
l=NS.Haskell.asTypeOf;var bb=NS.Haskell.operators,cb=NS.Haskell.infix,P=NS.Haskell.infixl,Qb=NS.Haskell.infixr,sa=NS.Haskell.resolve,gc=NS.Haskell.exl,S=NS.Haskell.exs,Ba=NS.Haskell.Scope;l=NS.Data_Char.String;var Rb=NS.Data_Char.isSpace,ma=NS.Data_Char.isUpper,$=NS.Data_Char.isLower,Wb=NS.Data_Char.isAlpha,Hb=NS.Data_Char.isAlphaNum,Sa=NS.Data_Char.isDigit,Sb=NS.Data_Char.isHexDigit,kc=NS.Data_Char.isOctDigit,ha=NS.Data_Char.digitToInt;n=NS.Data_List.append;n=NS.Data_List.head;n=NS.Data_List.last;
n=NS.Data_List.tail;n=NS.Data_List.init;D=NS.Data_List.null_;n=NS.Data_List.length;w=NS.Data_List.map;n=NS.Data_List.reverse;ga=NS.Data_List.foldl;n=NS.Data_List.foldl1;Z=NS.Data_List.foldr;n=NS.Data_List.foldr1;n=NS.Data_List.concat;n=NS.Data_List.concatMap;n=NS.Data_List.and;n=NS.Data_List.or;n=NS.Data_List.any;n=NS.Data_List.all;n=NS.Data_List.sum;n=NS.Data_List.product;n=NS.Data_List.maximum;n=NS.Data_List.minimum;n=NS.Data_List.scanl;n=NS.Data_List.scanl1;n=NS.Data_List.scanr;n=NS.Data_List.scanr1;
da=NS.Data_List.replicate;n=NS.Data_List.take;n=NS.Data_List.drop;n=NS.Data_List.splitAt;n=NS.Data_List.takeWhile;n=NS.Data_List.dropWhile;n=NS.Data_List.span;n=NS.Data_List.break_;mb=NS.Data_List.elem;n=NS.Data_List.notElem;n=NS.Data_List.lookup;n=NS.Data_List.filter;n=NS.Data_List.index;n=NS.Data_List.elemIndex;Ja=NS.Data_List.zip;n=NS.Data_List.zip3;n=NS.Data_List.zipWith;n=NS.Data_List.zipWith3;n=NS.Data_List.unzip;n=NS.Data_List.unzip3;n=NS.Data_List.lines;n=NS.Data_List.words;n=NS.Data_List.unlines;
n=NS.Data_List.unwords;var a=NS.Data_List.nub,c;ba.prototype={memoize:false,scrollTo:function(d){this.index=d;this.length=this.input.length-d;return this},scroll:function(d){this.index+=d;this.length-=d;return this},dropped:0,at:function(d){return this.input.charAt(this.index+d)},substring:function(d,h){return this.input.substring(d+this.index,(h||this.length)+this.index)},substr:function(d,h){return this.input.substring(d+this.index,h||this.length)},toString:function(){var d=this.substring(0);return"PS at "+
this.index+" "+(d.length?'"'+d+'"':"Empty")},getCached:function(d){if(this.memoize)if(d=this.cache[d])if(d=d[this.index]){this.index=d.index;this.length=d.length;return d}},putCached:function(d,h,k){if(!this.memoize)return false;k.index=this.index;k.length=this.length;var s=this.cache[d];s||(s=this.cache[d]={});s[h]=k},sourceLine:function(d){return(d=this.input.substring(0,d).match(/(\r\n)|\r|\n/g))?d.length:0}};var i=Na,p=fb;n=p;var L=0,G=function(d,h){function k(s,y,z){return function(){return d(s,
y,function(t){return t.success?h(s,y,z):z(t)})}}k.constructor=E;return k},v=function(){function d(k,s,y){k=new Ba(k);for(var z=1,t=h.length,b=h[0];z<t;++z)b=G(b,h[z]);return b(k,s,y)}var h=w(Ua,arguments);d.constructor=E;return d},T=Q(H,Pa),ta=gb,fc=vb,M=Da,mc=M;Q=Qa;var zc=G,lc=R,Tb=Va(false),bc=Va(true),Fa=kb(function(d,h,k,s){if(h.success)return h;k.scrollTo(s);return{ast:c,success:false,expecting:h.expecting}}),Ib=function(d){return kb(function(h,k){return{ast:c,success:k.success,expecting:k.expecting}})(Tb(d),
null)},W=ya(function(d,h){if(h.length>0&&h.at(0)==d){h.scroll(1);return{ast:d,success:true}}return{success:false,expecting:d}}),Ca=ya(function(d,h){var k=h.at(0);if(h.length>0&&d(k)){h.scroll(1);return{ast:k,success:true}}return{success:false,expecting:k}}),sb=function(d){return kb(function(h,k,s,y){h=k.ast.join("");return{ast:h.length?h:c,success:k.success,expecting:k.success?c:{at:y,expecting:d}}})(jb(w(W,d)),null)},Ub=kb(function(d,h,k,s){return h.success?h:{ast:h.ast,success:false,expecting:{at:s,
expecting:d}}}),Ec=ya(function(d,h){if(typeof d=="string")if(h.substring(0,d.length)==d){h.scroll(d.length);return{ast:d,success:true}}else return{success:false,expecting:d};else if(d.exec){var k=new RegExp("^"+d.source),s=h.substring(0);k=(k=(k=k.exec(s))&&k[0])&&k.length;s=s.substr(0,k);if(k){h.scroll(k);return{ast:s,success:true}}else return{success:false,expecting:d.source}}});qa(bb,{"<-":{func:F,fixity:Qb(-1)},">>=":{func:ja,fixity:P(1)},"=<<":{func:I(ja),fixity:Qb(1)},">>":{func:zc,fixity:P(1)},
"*>":{func:zc,fixity:P(4)},"<*":{func:wb,fixity:P(4)},"<$>":{func:Q,fixity:P(4)},"<*>":{func:hb,fixity:P(4)},"<**>":{func:o(ib)(I(oa)),fixity:P(4)},"<$":{func:function(d,h){return wb(mc(value),h)},fixity:P(4)},"<|>":{func:R,fixity:Qb(1)},"<?>":{func:Ub,fixity:cb(0)}});K(u,E,function(){return{">>=":ja,">>":G,do_:v,return_:Da,fail:Na,run:Ha,do$:function(){function d(z,t,b){return s(z,t,b)}function h(z,t,b){if(y||z instanceof Ba)return(y?s:h.resolve())(z,t,b);k.push(sa(arguments,d));return h}var k=[],
s,y;k.push(sa(arguments,d));h.resolve=function(){if(y)return s;s=v.apply(null,k);y=true;k=null;return s};h.CallStream=true;h.constructor=E;return h}}});var O=ab(u,E).do$,aa=gc(E);ea("Text_Parsec_Prim",{sequence:lb,run:Ha,Parser:E,ParseState:ba,ps:$a,toParser:Ua,unexpected:U,parsecMap:Q,fmap:Q,liftM:Qa,liftM2:ib,liftM3:xa,liftA:Q,liftA2:ib,liftA3:xa,ap:hb,parserBind:ja,parserReturn:Da,return_:M,pure:mc,parserFail:Na,fail:i,parserZero:fb,mzero:p,empty:n,parserPlus:R,parserPlusN:xb,mplus:lc,do_:v,do$:O,
do2:G,bind:F,ret:H,withBound:Pa,returnCall:T,getPosition:gb,setPosition:vb,getParserState:ta,setParserState:fc,tokens:jb,many:Tb,many1:bc,string:sb,char_:W,satisfy:Ca,label:Ub,try_:Fa,skipMany:Ib,match:Ec,withScope:Kb,ex:aa});var tb=function(d){return Ub(Ca(function(h){return mb(h,d)}),"oneOf("+d+")")},nc=function(d){return Ub(Ca(function(h){return!mb(h,d)}),"noneOf("+d+")")},oc=S(Ca,Rb,"<?>","space");u=S(Ib,oc,"<?>","white space");I=S(W,"\n","<?>","new-line");oa=S(W,"\t","<?>","tab");var Xb=S(Ca,
ma,"<?>","uppercase letter");$=S(Ca,$,"<?>","lowercase letter");Hb=S(Ca,Hb,"<?>","letter or digit");ma=S(Ca,Wb,"<?>","letter");var pc=S(Ca,Sa,"<?>","digit"),qc=S(Ca,Sb,"<?>","hexadecimal digit"),rc=S(Ca,kc,"<?>","octal digit");B=S(Ca,B(true));ea("Text_Parsec_Char",{oneOf:tb,noneOf:nc,space:oc,spaces:u,newline:I,tab:oa,upper:Xb,lower:$,alphaNum:Hb,letter:ma,digit:pc,hexDigit:qc,octDigit:rc,anyChar:B});ea("Text_Parsec_Combinator",{choice:la,count:zb,between:Ka,option:Ea,optionMaybe:Db,optional:Lb,skipMany1:La,
sepBy:nb,sepBy1:Ra,endBy:Fb,endBy1:Mb,sepEndBy:db,sepEndBy1:yb,chainl:Gb,chainl1:Ya,chainr:ob,chainr1:eb,eof:Ob,notFollowedBy:va,manyTill:Ab,lookAhead:Pb,anyToken:Nb});N(Ma,[["LanguageDef",{commentStart:l,commentEnd:l,commentLine:l,nestedComments:Boolean,identStart:E,identLetter:E,opStart:E,opLetter:E,reservedNames:Array,reservedOpNames:Array,caseSensitive:Boolean}]]);N(pb,[["TokenParser",{identifier:E,reserved:Function,operator:E,reservedOp:Function,charLiteral:E,stringLiteral:E,natural:E,integer:E,
float_:E,naturalOrFloat:E,decimal:E,hexadecimal:E,octal:E,symbol:Function,lexeme:Function,whiteSpace:E,parens:Function,braces:Function,angles:Function,brackets:Function,squares:Function,semi:E,comma:E,colon:E,dot:E,semiSep:Function,semiSep1:Function,commaSep:Function,commaSep1:Function}]]);ea("Text_Parsec_Token",{GenLanguageDef:Ma,GenTokenParser:pb,makeTokenParser:ra});Sa=tb(":!#$%&*+./<=>?@\\^|-~");B=Ma.LanguageDef(Y,{commentStart:"",commentEnd:"",commentLine:"",nestedComments:true,identStart:S(ma,
"<|>",W("_")),identLetter:S(Hb,"<|>",tb("_'")),opStart:Sa,opLetter:Sa,reservedOpNames:[],reservedNames:[],caseSensitive:true});l=Ma.LanguageDef(Y,{commentStart:"{-",commentEnd:"-}",commentLine:"--",nestedComments:true,identStart:ma,identLetter:S(Hb,"<|>",tb,"_'"),opStart:Sa,opLetter:Sa,reservedOpNames:[],reservedNames:[],caseSensitive:true});Sa=Ma.LanguageDef(Y,{commentStart:"/*",commentEnd:"*/",commentLine:"//",nestedComments:true,identStart:ma,identLetter:S(Hb,"<|>",tb,"_'"),opStart:Sa,opLetter:Sa,
reservedOpNames:[],reservedNames:[],caseSensitive:false});Sb=l.update({reservedOpNames:["::","..","=","\\","|","<-","->","@","~","=>"],reservedNames:["let","in","case","of","if","then","else","data","type","class","default","deriving","do","import","infix","infixl","infixr","instance","module","newtype","where","primitive"]});var Ac=Sb.update({identLetter:S(Sb.identLetter,"<|>",W("#")),reservedNames:Sb.reservedNames.concat(["foreign","import","export","primitive","_ccall_","_casm_","forall"])}),Bc=
Sa.update({reservedNames:["case","class","default","extends","import","in","let","new","of","package"],caseSensitive:true});ea("Text_Parsec_Language",{emptyDef:B,haskellStyle:l,javaStyle:Sa,haskellDef:Ac,mondrianDef:Bc,getHaskell:function(){return ra(Ac)},getMondrian:function(){return ra(Bc)}});N(Za,["AssocNone","AssocLeft","AssocRight"]);N(Oa,[["Infix",E,Za],["Prefix",E],["Postfix",E]]);ea("Text_Parsec_Expr",{Assoc:Za,Operator:Oa,buildExpressionParser:Cb})})();(function(){namespace("Text_Parsec");
importSubmodules("Text_Parsec",["Prim","Char","Combinator","Token","Language","Expr"])})()})();