require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } },{"./Func.js":1,"./Obj.js":2,"./Num.js":3,"./List.js":4,"./Str.js":5}],1:[function(require,module,exports){ var curry, flip, fix, apply; curry = function(f){ return curry$(f); }; flip = curry$(function(f, x, y){ return f(y, x); }); fix = function(f){ return function(g, x){ return function(){ return f(g(g)).apply(null, arguments); }; }(function(g, x){ return function(){ return f(g(g)).apply(null, arguments); }; }); }; apply = curry$(function(f, list){ return f.apply(null, list); }); module.exports = { curry: curry, flip: flip, fix: fix, apply: apply }; function curry$(f, bound){ var context, _curry = function(args) { return f.length > 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } },{}],2:[function(require,module,exports){ var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find; values = function(object){ var i$, x, results$ = []; for (i$ in object) { x = object[i$]; results$.push(x); } return results$; }; keys = function(object){ var x, results$ = []; for (x in object) { results$.push(x); } return results$; }; pairsToObj = function(object){ var i$, len$, x, results$ = {}; for (i$ = 0, len$ = object.length; i$ < len$; ++i$) { x = object[i$]; results$[x[0]] = x[1]; } return results$; }; objToPairs = function(object){ var key, value, results$ = []; for (key in object) { value = object[key]; results$.push([key, value]); } return results$; }; listsToObj = curry$(function(keys, values){ var i$, len$, i, key, results$ = {}; for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) { i = i$; key = keys[i$]; results$[key] = values[i]; } return results$; }); objToLists = function(objectect){ var keys, values, key, value; keys = []; values = []; for (key in objectect) { value = objectect[key]; keys.push(key); values.push(value); } return [keys, values]; }; empty = function(object){ var x; for (x in object) { return false; } return true; }; each = curry$(function(f, object){ var i$, x; for (i$ in object) { x = object[i$]; f(x); } return object; }); map = curry$(function(f, object){ var k, x, results$ = {}; for (k in object) { x = object[k]; results$[k] = f(x); } return results$; }); compact = curry$(function(object){ var k, x, results$ = {}; for (k in object) { x = object[k]; if (x) { results$[k] = x; } } return results$; }); filter = curry$(function(f, object){ var k, x, results$ = {}; for (k in object) { x = object[k]; if (f(x)) { results$[k] = x; } } return results$; }); reject = curry$(function(f, object){ var k, x, results$ = {}; for (k in object) { x = object[k]; if (!f(x)) { results$[k] = x; } } return results$; }); partition = curry$(function(f, object){ var passed, failed, k, x; passed = {}; failed = {}; for (k in object) { x = object[k]; (f(x) ? passed : failed)[k] = x; } return [passed, failed]; }); find = curry$(function(f, object){ var i$, x; for (i$ in object) { x = object[i$]; if (f(x)) { return x; } } }); module.exports = { values: values, keys: keys, pairsToObj: pairsToObj, objToPairs: objToPairs, listsToObj: listsToObj, objToLists: objToLists, empty: empty, each: each, map: map, filter: filter, compact: compact, reject: reject, partition: partition, find: find }; function curry$(f, bound){ var context, _curry = function(args) { return f.length > 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } },{}],3:[function(require,module,exports){ var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm; max = curry$(function(x$, y$){ return x$ > y$ ? x$ : y$; }); min = curry$(function(x$, y$){ return x$ < y$ ? x$ : y$; }); negate = function(x){ return -x; }; abs = Math.abs; signum = function(x){ if (x < 0) { return -1; } else if (x > 0) { return 1; } else { return 0; } }; quot = curry$(function(x, y){ return ~~(x / y); }); rem = curry$(function(x$, y$){ return x$ % y$; }); div = curry$(function(x, y){ return Math.floor(x / y); }); mod = curry$(function(x$, y$){ var ref$; return ((x$) % (ref$ = y$) + ref$) % ref$; }); recip = (function(it){ return 1 / it; }); pi = Math.PI; tau = pi * 2; exp = Math.exp; sqrt = Math.sqrt; ln = Math.log; pow = curry$(function(x$, y$){ return Math.pow(x$, y$); }); sin = Math.sin; tan = Math.tan; cos = Math.cos; asin = Math.asin; acos = Math.acos; atan = Math.atan; atan2 = curry$(function(x, y){ return Math.atan2(x, y); }); truncate = function(x){ return ~~x; }; round = Math.round; ceiling = Math.ceil; floor = Math.floor; isItNaN = function(x){ return x !== x; }; even = function(x){ return x % 2 === 0; }; odd = function(x){ return x % 2 !== 0; }; gcd = curry$(function(x, y){ var z; x = Math.abs(x); y = Math.abs(y); while (y !== 0) { z = x % y; x = y; y = z; } return x; }); lcm = curry$(function(x, y){ return Math.abs(Math.floor(x / gcd(x, y) * y)); }); module.exports = { max: max, min: min, negate: negate, abs: abs, signum: signum, quot: quot, rem: rem, div: div, mod: mod, recip: recip, pi: pi, tau: tau, exp: exp, sqrt: sqrt, ln: ln, pow: pow, sin: sin, tan: tan, cos: cos, acos: acos, asin: asin, atan: atan, atan2: atan2, truncate: truncate, round: round, ceiling: ceiling, floor: floor, isItNaN: isItNaN, even: even, odd: odd, gcd: gcd, lcm: lcm }; function curry$(f, bound){ var context, _curry = function(args) { return f.length > 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } },{}],4:[function(require,module,exports){ var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, toString$ = {}.toString, slice$ = [].slice; each = curry$(function(f, xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; f(x); } return xs; }); map = curry$(function(f, xs){ var i$, len$, x, results$ = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; results$.push(f(x)); } return results$; }); compact = curry$(function(xs){ var i$, len$, x, results$ = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (x) { results$.push(x); } } return results$; }); filter = curry$(function(f, xs){ var i$, len$, x, results$ = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (f(x)) { results$.push(x); } } return results$; }); reject = curry$(function(f, xs){ var i$, len$, x, results$ = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (!f(x)) { results$.push(x); } } return results$; }); partition = curry$(function(f, xs){ var passed, failed, i$, len$, x; passed = []; failed = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; (f(x) ? passed : failed).push(x); } return [passed, failed]; }); find = curry$(function(f, xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (f(x)) { return x; } } }); head = first = function(xs){ if (!xs.length) { return; } return xs[0]; }; tail = function(xs){ if (!xs.length) { return; } return xs.slice(1); }; last = function(xs){ if (!xs.length) { return; } return xs[xs.length - 1]; }; initial = function(xs){ var len; len = xs.length; if (!len) { return; } return xs.slice(0, len - 1); }; empty = function(xs){ return !xs.length; }; reverse = function(xs){ return xs.concat().reverse(); }; unique = function(xs){ var result, i$, len$, x; result = []; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (!in$(x, result)) { result.push(x); } } return result; }; fold = foldl = curry$(function(f, memo, xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; memo = f(memo, x); } return memo; }); fold1 = foldl1 = curry$(function(f, xs){ return fold(f, xs[0], xs.slice(1)); }); foldr = curry$(function(f, memo, xs){ return fold(f, memo, xs.concat().reverse()); }); foldr1 = curry$(function(f, xs){ var ys; ys = xs.concat().reverse(); return fold(f, ys[0], ys.slice(1)); }); unfoldr = curry$(function(f, b){ var result, x, that; result = []; x = b; while ((that = f(x)) != null) { result.push(that[0]); x = that[1]; } return result; }); concat = function(xss){ return [].concat.apply([], xss); }; concatMap = curry$(function(f, xs){ var x; return [].concat.apply([], (function(){ var i$, ref$, len$, results$ = []; for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { x = ref$[i$]; results$.push(f(x)); } return results$; }())); }); flatten = curry$(function(xs){ var x; return [].concat.apply([], (function(){ var i$, ref$, len$, results$ = []; for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { x = ref$[i$]; if (toString$.call(x).slice(8, -1) === 'Array') { results$.push(flatten(x)); } else { results$.push(x); } } return results$; }())); }); difference = function(xs){ var yss, results, i$, len$, x, j$, len1$, ys; yss = slice$.call(arguments, 1); results = []; outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { ys = yss[j$]; if (in$(x, ys)) { continue outer; } } results.push(x); } return results; }; intersection = function(xs){ var yss, results, i$, len$, x, j$, len1$, ys; yss = slice$.call(arguments, 1); results = []; outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { ys = yss[j$]; if (!in$(x, ys)) { continue outer; } } results.push(x); } return results; }; union = function(){ var xss, results, i$, len$, xs, j$, len1$, x; xss = slice$.call(arguments); results = []; for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { xs = xss[i$]; for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) { x = xs[j$]; if (!in$(x, results)) { results.push(x); } } } return results; }; countBy = curry$(function(f, xs){ var results, i$, len$, x, key; results = {}; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; key = f(x); if (key in results) { results[key] += 1; } else { results[key] = 1; } } return results; }); groupBy = curry$(function(f, xs){ var results, i$, len$, x, key; results = {}; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; key = f(x); if (key in results) { results[key].push(x); } else { results[key] = [x]; } } return results; }); andList = function(xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (!x) { return false; } } return true; }; orList = function(xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (x) { return true; } } return false; }; any = curry$(function(f, xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (f(x)) { return true; } } return false; }); all = curry$(function(f, xs){ var i$, len$, x; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; if (!f(x)) { return false; } } return true; }); sort = function(xs){ return xs.concat().sort(function(x, y){ if (x > y) { return 1; } else if (x < y) { return -1; } else { return 0; } }); }; sortWith = curry$(function(f, xs){ if (!xs.length) { return []; } return xs.concat().sort(f); }); sortBy = curry$(function(f, xs){ if (!xs.length) { return []; } return xs.concat().sort(function(x, y){ if (f(x) > f(y)) { return 1; } else if (f(x) < f(y)) { return -1; } else { return 0; } }); }); sum = function(xs){ var result, i$, len$, x; result = 0; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; result += x; } return result; }; product = function(xs){ var result, i$, len$, x; result = 1; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { x = xs[i$]; result *= x; } return result; }; mean = average = function(xs){ var sum, len, i$, i; sum = 0; len = xs.length; for (i$ = 0; i$ < len; ++i$) { i = i$; sum += xs[i]; } return sum / len; }; maximum = function(xs){ var max, i$, ref$, len$, x; max = xs[0]; for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { x = ref$[i$]; if (x > max) { max = x; } } return max; }; minimum = function(xs){ var min, i$, ref$, len$, x; min = xs[0]; for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { x = ref$[i$]; if (x < min) { min = x; } } return min; }; scan = scanl = curry$(function(f, memo, xs){ var last, x; last = memo; return [memo].concat((function(){ var i$, ref$, len$, results$ = []; for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { x = ref$[i$]; results$.push(last = f(last, x)); } return results$; }())); }); scan1 = scanl1 = curry$(function(f, xs){ if (!xs.length) { return; } return scan(f, xs[0], xs.slice(1)); }); scanr = curry$(function(f, memo, xs){ xs = xs.concat().reverse(); return scan(f, memo, xs).reverse(); }); scanr1 = curry$(function(f, xs){ if (!xs.length) { return; } xs = xs.concat().reverse(); return scan(f, xs[0], xs.slice(1)).reverse(); }); slice = curry$(function(x, y, xs){ return xs.slice(x, y); }); take = curry$(function(n, xs){ if (n <= 0) { return xs.slice(0, 0); } else if (!xs.length) { return xs; } else { return xs.slice(0, n); } }); drop = curry$(function(n, xs){ if (n <= 0 || !xs.length) { return xs; } else { return xs.slice(n); } }); splitAt = curry$(function(n, xs){ return [take(n, xs), drop(n, xs)]; }); takeWhile = curry$(function(p, xs){ var len, i; len = xs.length; if (!len) { return xs; } i = 0; while (i < len && p(xs[i])) { i += 1; } return xs.slice(0, i); }); dropWhile = curry$(function(p, xs){ var len, i; len = xs.length; if (!len) { return xs; } i = 0; while (i < len && p(xs[i])) { i += 1; } return xs.slice(i); }); span = curry$(function(p, xs){ return [takeWhile(p, xs), dropWhile(p, xs)]; }); breakList = curry$(function(p, xs){ return span(compose$([not$, p]), xs); }); zip = curry$(function(xs, ys){ var result, len, i$, len$, i, x; result = []; len = ys.length; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { i = i$; x = xs[i$]; if (i === len) { break; } result.push([x, ys[i]]); } return result; }); zipWith = curry$(function(f, xs, ys){ var result, len, i$, len$, i, x; result = []; len = ys.length; for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { i = i$; x = xs[i$]; if (i === len) { break; } result.push(f(x, ys[i])); } return result; }); zipAll = function(){ var xss, minLength, i$, len$, xs, ref$, i, lresult$, j$, results$ = []; xss = slice$.call(arguments); minLength = 9e9; for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { xs = xss[i$]; minLength <= (ref$ = xs.length) || (minLength = ref$); } for (i$ = 0; i$ < minLength; ++i$) { i = i$; lresult$ = []; for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) { xs = xss[j$]; lresult$.push(xs[i]); } results$.push(lresult$); } return results$; }; zipAllWith = function(f){ var xss, minLength, i$, len$, xs, ref$, i, results$ = []; xss = slice$.call(arguments, 1); minLength = 9e9; for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { xs = xss[i$]; minLength <= (ref$ = xs.length) || (minLength = ref$); } for (i$ = 0; i$ < minLength; ++i$) { i = i$; results$.push(f.apply(null, (fn$()))); } return results$; function fn$(){ var i$, ref$, len$, results$ = []; for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) { xs = ref$[i$]; results$.push(xs[i]); } return results$; } }; module.exports = { each: each, map: map, filter: filter, compact: compact, reject: reject, partition: partition, find: find, head: head, first: first, tail: tail, last: last, initial: initial, empty: empty, reverse: reverse, difference: difference, intersection: intersection, union: union, countBy: countBy, groupBy: groupBy, fold: fold, fold1: fold1, foldl: foldl, foldl1: foldl1, foldr: foldr, foldr1: foldr1, unfoldr: unfoldr, andList: andList, orList: orList, any: any, all: all, unique: unique, sort: sort, sortWith: sortWith, sortBy: sortBy, sum: sum, product: product, mean: mean, average: average, concat: concat, concatMap: concatMap, flatten: flatten, maximum: maximum, minimum: minimum, scan: scan, scan1: scan1, scanl: scanl, scanl1: scanl1, scanr: scanr, scanr1: scanr1, slice: slice, take: take, drop: drop, splitAt: splitAt, takeWhile: takeWhile, dropWhile: dropWhile, span: span, breakList: breakList, zip: zip, zipWith: zipWith, zipAll: zipAll, zipAllWith: zipAllWith }; function curry$(f, bound){ var context, _curry = function(args) { return f.length > 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } function in$(x, arr){ var i = -1, l = arr.length >>> 0; while (++i < l) if (x === arr[i] && i in arr) return true; return false; } function compose$(fs){ return function(){ var i, args = arguments; for (i = fs.length; i > 0; --i) { args = [fs[i-1].apply(this, args)]; } return args[0]; }; } function not$(x){ return !x; } },{}],5:[function(require,module,exports){ var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat; split = curry$(function(sep, str){ return str.split(sep); }); join = curry$(function(sep, xs){ return xs.join(sep); }); lines = function(str){ if (!str.length) { return []; } return str.split('\n'); }; unlines = function(it){ return it.join('\n'); }; words = function(str){ if (!str.length) { return []; } return str.split(/[ ]+/); }; unwords = function(it){ return it.join(' '); }; chars = function(it){ return it.split(''); }; unchars = function(it){ return it.join(''); }; reverse = function(str){ return str.split('').reverse().join(''); }; repeat = curry$(function(n, str){ var out, res$, i$; res$ = []; for (i$ = 0; i$ < n; ++i$) { res$.push(str); } out = res$; return out.join(''); }); module.exports = { split: split, join: join, lines: lines, unlines: unlines, words: words, unwords: unwords, chars: chars, unchars: unchars, reverse: reverse, repeat: repeat }; function curry$(f, bound){ var context, _curry = function(args) { return f.length > 1 ? function(){ var params = args ? args.concat() : []; context = bound ? context || this : this; return params.push.apply(params, arguments) < f.length && arguments.length ? _curry.call(context, params) : f.apply(context, params); } : f; }; return _curry(); } },{}]},{},[]) ;