[Pkg-javascript-commits] [node-prelude-ls] 01/15: Import Upstream version 1.1.2

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Wed Oct 12 10:29:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository node-prelude-ls.

commit 57a8953fc133a3ec3581c108139fea69e5dccc2f
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Wed Oct 12 12:17:07 2016 +0530

    Import Upstream version 1.1.2
---
 .gitignore                     |    3 +
 .travis.yml                    |    3 +
 CHANGELOG.md                   |   99 +++
 LICENSE                        |   22 +
 Makefile                       |   56 ++
 README.md                      |   15 +
 browser/prelude-browser-min.js |   18 +
 browser/prelude-browser.js     | 1320 ++++++++++++++++++++++++++++++++++++++++
 lib/Func.js                    |   65 ++
 lib/List.js                    |  686 +++++++++++++++++++++
 lib/Num.js                     |  130 ++++
 lib/Obj.js                     |  154 +++++
 lib/Str.js                     |   92 +++
 lib/index.js                   |  178 ++++++
 package.json                   |   52 ++
 package.json.ls                |   48 ++
 preroll.ls                     |    9 +
 src/Func.ls                    |   25 +
 src/List.ls                    |  336 ++++++++++
 src/Num.ls                     |   83 +++
 src/Obj.ls                     |   60 ++
 src/Str.ls                     |   48 ++
 src/index.ls                   |   59 ++
 test/Func.ls                   |   71 +++
 test/List.ls                   |  884 +++++++++++++++++++++++++++
 test/Num.ls                    |  255 ++++++++
 test/Obj.ls                    |  145 +++++
 test/Str.ls                    |  259 ++++++++
 test/browser.html              |    5 +
 test/index.ls                  |   53 ++
 30 files changed, 5233 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d8b5eeb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.swp
+node_modules
+coverage
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..20fd86b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+  - 0.10
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..c2de12d
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,99 @@
+# 1.1.2
+- add `Func.memoize`
+- fix `zip-all` and `zip-with-all` corner case (no input)
+- build with LiveScript 1.4.0
+
+# 1.1.1
+- curry `unique-by`, `minimum-by`
+
+# 1.1.0
+- added `List` functions: `maximum-by`, `minimum-by`, `unique-by`
+- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices`
+- added `Str` functions: `capitalize`, `camelize`, `dasherize`
+- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)``
+- exported `Str.repeat` through main `prelude` object
+- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one
+- fixed issue with `fix`
+- improved code coverage
+
+# 1.0.3
+- build browser versions
+
+# 1.0.2
+- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects
+
+# 1.0.1
+- bug fixes for `drop-while` and `take-while`
+
+# 1.0.0
+* massive update - separated functions into separate modules
+* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list
+* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that
+* browser version now using browserify - use `prelude = require('prelude-ls')`
+* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply`
+* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists`
+* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs`
+* removed `cons`, `append` - use the concat operator
+* removed `compose` - use the compose operator
+* removed `obj-to-func` - use partially applied access (eg. `(obj.)`)
+* removed `length` - use `(.length)`
+* `sort-by` renamed to `sort-with`
+* added new `sort-by`
+* removed `compare` - just use the new `sort-by`
+* `break-it` renamed `break-list`, (`Str.break-str` for the string version)
+* added `Str.repeat` which creates a new string by repeating the input n times
+* `unfold` as alias to `unfoldr` is no longer used
+* fixed up style and compiled with LiveScript 1.1.1
+* use Make instead of Slake
+* greatly improved tests
+
+# 0.6.0
+* fixed various bugs
+* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions
+* added `unfoldr` (alias `unfold`)
+* calling `replicate` with a string now returns a list of strings
+* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying
+* added `sort`, `sortBy`, and `compare`
+
+# 0.5.0
+* removed `lookup` - use (.prop)
+* removed `call` - use (.func arg1, arg2)
+* removed `pluck` - use map (.prop), xs
+* fixed buys wtih `head` and `last`
+* added non-minifed browser version, as `prelude-browser.js`
+* renamed `prelude-min.js` to `prelude-browser-min.js`
+* renamed `zip` to `zipAll`
+* renamed `zipWith` to `zipAllWith`
+* added `zip`, a curried zip that takes only two arguments
+* added `zipWith`, a curried zipWith that takes only two arguments
+
+# 0.4.0
+* added `parition` function
+* added `curry` function
+* removed `elem` function (use `in`)
+* removed `notElem` function (use `not in`)
+
+# 0.3.0
+* added `listToObject`
+* added `unique`
+* added `objToFunc`
+* added support for using strings in map and the like
+* added support for using objects in map and the like
+* added ability to use objects instead of functions in certain cases
+* removed `error` (just use throw)
+* added `tau` constant
+* added `join`
+* added `values`
+* added `keys`
+* added `partial`
+* renamed `log` to `ln`
+* added alias to `head`: `first`
+* added `installPrelude` helper
+
+# 0.2.0
+* removed functions that simply warp operators as you can now use operators as functions in LiveScript
+* `min/max` are now curried and take only 2 arguments
+* added `call`
+
+# 0.1.0
+* initial public release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..525b118
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) George Zahariev
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c3193a3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,56 @@
+default: all
+
+SRC = $(shell find src -name "*.ls" -type f | sort)
+LIB = $(SRC:src/%.ls=lib/%.js)
+LS = node_modules/livescript
+LSC = node_modules/.bin/lsc
+BROWSERIFY = node_modules/.bin/browserify
+UGLIFYJS = node_modules/.bin/uglifyjs
+MOCHA = node_modules/.bin/mocha
+MOCHA2 = node_modules/.bin/_mocha
+ISTANBUL = node_modules/.bin/istanbul
+
+lib:
+	mkdir -p lib/
+
+lib/%.js: src/%.ls lib
+	$(LSC) --output lib --bare --compile "$<"
+
+browser:
+	mkdir browser/
+
+prelude-browser.js: $(LIB) browser preroll.ls
+	{ $(LSC) ./preroll.ls ; $(BROWSERIFY) -r ./lib/index.js:prelude-ls ; } > browser/prelude-browser.js
+
+prelude-browser-min.js: browser/prelude-browser.js
+	$(UGLIFYJS) browser/prelude-browser.js --mangle --comments "all" > browser/prelude-browser-min.js
+
+package.json: package.json.ls
+	$(LSC) --compile package.json.ls
+
+.PHONY: build build-browser test coverage dev-install loc clean
+
+all: build
+
+build: $(LIB) package.json
+
+build-browser: prelude-browser.js prelude-browser-min.js
+
+test: build
+	$(MOCHA) --reporter dot --ui tdd --compilers ls:$(LS)
+
+coverage: build
+	$(ISTANBUL) cover $(MOCHA2) -- --reporter dot --ui tdd --compilers ls:$(LS)
+
+dev-install: package.json
+	npm install .
+
+loc:
+	wc --lines src/*
+
+clean:
+	rm -f ./*.js
+	rm -rf lib
+	rm -rf browser
+	rm -rf coverage
+	rm -f package.json
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fabc212
--- /dev/null
+++ b/README.md
@@ -0,0 +1,15 @@
+# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls)
+
+is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, <a href="http://livescript.net">LiveScript</a>.
+
+See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more.
+
+You can install via npm `npm install prelude-ls`
+
+### Development
+
+`make test` to test
+
+`make build` to build `lib` from `src`
+
+`make build-browser` to build browser versions
diff --git a/browser/prelude-browser-min.js b/browser/prelude-browser-min.js
new file mode 100644
index 0000000..1ca6430
--- /dev/null
+++ b/browser/prelude-browser-min.js
@@ -0,0 +1,18 @@
+// Generated by LiveScript 1.2.0
+// prelude.ls 1.1.2
+// Copyright (c) George Zahariev
+// Released under the MIT License
+// https://raw.githubusercontent.com/gkz/prelude-ls/master/LICENSE
+require=function n(r,t,e){function u(o,a){if(!t[o]){if(!r[o]){var c=typeof require=="function"&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=t[o]={exports:{}};r[o][0].call(f.exports,function(n){var t=r[o][1][n];return u(t?t:n)},f,f.exports,n,r,t,e)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<e.length;o++)u(e[o]);return u}({1:[function(n,r,t){
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f=[].slice,l={}.toString;e=s(function(n,r){return n.apply(null,r)});u=function(n){return s(n)};i=s(function(n,r,t){return n(t,r)});o=function(n){return function(r){return function(){return n(r(r)).apply(null,arguments)}}(function(r){return function(){return n(r(r)).apply(null,arguments)}})};a=s(function(n,r,t,e){return n(r(t),r(e))});c=function(n){var r;r={};return function(){var t,e,u;t=f.call(arguments);e=function(){var n,r,e,i=[];for(n=0,e=(r=t).length;n<e;++n){u=r[n]; [...]
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f,l,s,p,h,g,v,m,d,y,j,x,b,M,z,k,w,W,q,B,L,I,A,T,N,O,S,C,P,F,Z,E,U,R,V,_,D,G,H,J,K,Q,X,Y,$,nn,rn,tn,en,un,on,an,cn,fn,ln,sn,pn,hn,gn,vn,mn,dn,yn,jn={}.toString,xn=[].slice;e=bn(function(n,r){var t,e,u;for(t=0,e=r.length;t<e;++t){u=r[t];n(u)}return r});u=bn(function(n,r){var t,e,u,i=[];for(t=0,e=r.length;t<e;++t){u=r[t];i.push(n(u))}return i});i=function(n){var r,t,e,u=[];for(r=0,t=n.length;r<t;++r){e=n[r];if(e){u.push(e)}}return u};o=bn(function(n,r){var t,e,u,i=[];for(t=0 [...]
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f,l,s,p,h,g,v,m,d,y,j,x,b,M,z,k,w,W,q,B,L,I,A,T,N,O;e=S(function(n,r){return n>r?n:r});u=S(function(n,r){return n<r?n:r});i=function(n){return-n};o=Math.abs;a=function(n){if(n<0){return-1}else if(n>0){return 1}else{return 0}};c=S(function(n,r){return~~(n/r)});f=S(function(n,r){return n%r});l=S(function(n,r){return Math.floor(n/r)});s=S(function(n,r){var t;return(n%(t=r)+t)%t});p=function(n){return 1/n};h=Math.PI;g=h*2;v=Math.exp;m=Math.sqrt;d=Math.log;y=S(function(n,r){re [...]
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f,l,s,p,h,g,v,m;e=function(n){var r,t,e=[];for(r in n){t=n[r];e.push(t)}return e};u=function(n){var r,t=[];for(r in n){t.push(r)}return t};i=function(n){var r,t,e,u={};for(r=0,t=n.length;r<t;++r){e=n[r];u[e[0]]=e[1]}return u};o=function(n){var r,t,e=[];for(r in n){t=n[r];e.push([r,t])}return e};a=d(function(n,r){var t,e,u,i,o={};for(t=0,e=n.length;t<e;++t){u=t;i=n[t];o[i]=r[u]}return o});c=function(n){var r,t,e,u;r=[];t=[];for(e in n){u=n[e];r.push(e);t.push(u)}return[r,t [...]
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f,l,s,p,h,g,v;e=m(function(n,r){return r.split(n)});u=m(function(n,r){return r.join(n)});i=function(n){if(!n.length){return[]}return n.split("\n")};o=function(n){return n.join("\n")};a=function(n){if(!n.length){return[]}return n.split(/[ ]+/)};c=function(n){return n.join(" ")};f=function(n){return n.split("")};l=function(n){return n.join("")};s=function(n){return n.split("").reverse().join("")};p=m(function(n,r){var t,e;t="";for(e=0;e<n;++e){t+=r}return t});h=function(n){ [...]
+// Generated by LiveScript 1.4.0
+var e,u,i,o,a,c,f,l,s,p={}.toString;e=n("./Func.js");u=n("./List.js");i=n("./Obj.js");o=n("./Str.js");a=n("./Num.js");c=function(n){return n};f=h(function(n,r){return p.call(r).slice(8,-1)===n});l=h(function(n,r){var t,e=[];for(t=0;t<n;++t){e.push(r)}return e});o.empty=u.empty;o.slice=u.slice;o.take=u.take;o.drop=u.drop;o.splitAt=u.splitAt;o.takeWhile=u.takeWhile;o.dropWhile=u.dropWhile;o.span=u.span;o.breakStr=u.breakList;s={Func:e,List:u,Obj:i,Str:o,Num:a,id:c,isType:f,replicate:l};s.e [...]
diff --git a/browser/prelude-browser.js b/browser/prelude-browser.js
new file mode 100644
index 0000000..2082679
--- /dev/null
+++ b/browser/prelude-browser.js
@@ -0,0 +1,1320 @@
+// Generated by LiveScript 1.2.0
+
+// prelude.ls 1.1.2
+// Copyright (c) George Zahariev
+// Released under the MIT License
+// https://raw.githubusercontent.com/gkz/prelude-ls/master/LICENSE
+require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+// Generated by LiveScript 1.4.0
+var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString;
+apply = curry$(function(f, list){
+  return f.apply(null, list);
+});
+curry = function(f){
+  return curry$(f);
+};
+flip = curry$(function(f, x, y){
+  return f(y, x);
+});
+fix = function(f){
+  return function(g){
+    return function(){
+      return f(g(g)).apply(null, arguments);
+    };
+  }(function(g){
+    return function(){
+      return f(g(g)).apply(null, arguments);
+    };
+  });
+};
+over = curry$(function(f, g, x, y){
+  return f(g(x), g(y));
+});
+memoize = function(f){
+  var memo;
+  memo = {};
+  return function(){
+    var args, key, arg;
+    args = slice$.call(arguments);
+    key = (function(){
+      var i$, ref$, len$, results$ = [];
+      for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
+        arg = ref$[i$];
+        results$.push(arg + toString$.call(arg).slice(8, -1));
+      }
+      return results$;
+    }()).join('');
+    return memo[key] = key in memo
+      ? memo[key]
+      : f.apply(null, args);
+  };
+};
+module.exports = {
+  curry: curry,
+  flip: flip,
+  fix: fix,
+  apply: apply,
+  over: over,
+  memoize: memoize
+};
+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){
+// Generated by LiveScript 1.4.0
+var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, 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, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, z [...]
+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 = 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){
+  return xs[0];
+};
+tail = function(xs){
+  if (!xs.length) {
+    return;
+  }
+  return xs.slice(1);
+};
+last = function(xs){
+  return xs[xs.length - 1];
+};
+initial = function(xs){
+  if (!xs.length) {
+    return;
+  }
+  return xs.slice(0, -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;
+};
+uniqueBy = curry$(function(f, xs){
+  var seen, i$, len$, x, val, results$ = [];
+  seen = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    x = xs[i$];
+    val = f(x);
+    if (in$(val, seen)) {
+      continue;
+    }
+    seen.push(val);
+    results$.push(x);
+  }
+  return results$;
+});
+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){
+  var i$, x;
+  for (i$ = xs.length - 1; i$ >= 0; --i$) {
+    x = xs[i$];
+    memo = f(x, memo);
+  }
+  return memo;
+});
+foldr1 = curry$(function(f, xs){
+  return foldr(f, xs[xs.length - 1], xs.slice(0, -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 = 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){
+  return xs.concat().sort(f);
+});
+sortBy = curry$(function(f, xs){
+  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, i$, len$, x;
+  sum = 0;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    x = xs[i$];
+    sum += x;
+  }
+  return sum / xs.length;
+};
+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;
+};
+maximumBy = curry$(function(f, 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 (f(x) > f(max)) {
+      max = x;
+    }
+  }
+  return max;
+});
+minimumBy = curry$(function(f, 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 (f(x) < f(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 {
+    return xs.slice(0, n);
+  }
+});
+drop = curry$(function(n, xs){
+  if (n <= 0) {
+    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$(p, not$), 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 = undefined;
+  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 = undefined;
+  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$;
+  }
+};
+at = curry$(function(n, xs){
+  if (n < 0) {
+    return xs[xs.length + n];
+  } else {
+    return xs[n];
+  }
+});
+elemIndex = curry$(function(el, xs){
+  var i$, len$, i, x;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (x === el) {
+      return i;
+    }
+  }
+});
+elemIndices = curry$(function(el, xs){
+  var i$, len$, i, x, results$ = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (x === el) {
+      results$.push(i);
+    }
+  }
+  return results$;
+});
+findIndex = curry$(function(f, xs){
+  var i$, len$, i, x;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (f(x)) {
+      return i;
+    }
+  }
+});
+findIndices = curry$(function(f, xs){
+  var i$, len$, i, x, results$ = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (f(x)) {
+      results$.push(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,
+  uniqueBy: uniqueBy,
+  sort: sort,
+  sortWith: sortWith,
+  sortBy: sortBy,
+  sum: sum,
+  product: product,
+  mean: mean,
+  average: average,
+  concat: concat,
+  concatMap: concatMap,
+  flatten: flatten,
+  maximum: maximum,
+  minimum: minimum,
+  maximumBy: maximumBy,
+  minimumBy: minimumBy,
+  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,
+  at: at,
+  elemIndex: elemIndex,
+  elemIndices: elemIndices,
+  findIndex: findIndex,
+  findIndices: findIndices
+};
+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, xs){
+  var i = -1, l = xs.length >>> 0;
+  while (++i < l) if (x === xs[i]) return true;
+  return false;
+}
+function compose$() {
+  var functions = arguments;
+  return function() {
+    var i, result;
+    result = functions[0].apply(this, arguments);
+    for (i = 1; i < functions.length; ++i) {
+      result = functions[i](result);
+    }
+    return result;
+  };
+}
+function not$(x){ return !x; }
+},{}],3:[function(require,module,exports){
+// Generated by LiveScript 1.4.0
+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){
+// Generated by LiveScript 1.4.0
+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, resultObj$ = {};
+  for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
+    x = object[i$];
+    resultObj$[x[0]] = x[1];
+  }
+  return resultObj$;
+};
+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, resultObj$ = {};
+  for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
+    i = i$;
+    key = keys[i$];
+    resultObj$[key] = values[i];
+  }
+  return resultObj$;
+});
+objToLists = function(object){
+  var keys, values, key, value;
+  keys = [];
+  values = [];
+  for (key in object) {
+    value = object[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, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    resultObj$[k] = f(x);
+  }
+  return resultObj$;
+});
+compact = function(object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (x) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+};
+filter = curry$(function(f, object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (f(x)) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+});
+reject = curry$(function(f, object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (!f(x)) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+});
+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();
+}
+},{}],5:[function(require,module,exports){
+// Generated by LiveScript 1.4.0
+var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
+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 result, i$;
+  result = '';
+  for (i$ = 0; i$ < n; ++i$) {
+    result += str;
+  }
+  return result;
+});
+capitalize = function(str){
+  return str.charAt(0).toUpperCase() + str.slice(1);
+};
+camelize = function(it){
+  return it.replace(/[-_]+(.)?/g, function(arg$, c){
+    return (c != null ? c : '').toUpperCase();
+  });
+};
+dasherize = function(str){
+  return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
+    return lower + "-" + (upper.length > 1
+      ? upper
+      : upper.toLowerCase());
+  }).replace(/^([A-Z]+)/, function(arg$, upper){
+    if (upper.length > 1) {
+      return upper + "-";
+    } else {
+      return upper.toLowerCase();
+    }
+  });
+};
+module.exports = {
+  split: split,
+  join: join,
+  lines: lines,
+  unlines: unlines,
+  words: words,
+  unwords: unwords,
+  chars: chars,
+  unchars: unchars,
+  reverse: reverse,
+  repeat: repeat,
+  capitalize: capitalize,
+  camelize: camelize,
+  dasherize: dasherize
+};
+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();
+}
+},{}],"prelude-ls":[function(require,module,exports){
+module.exports=require('bcmc1g');
+},{}],"bcmc1g":[function(require,module,exports){
+// Generated by LiveScript 1.4.0
+var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
+Func = require('./Func.js');
+List = require('./List.js');
+Obj = require('./Obj.js');
+Str = require('./Str.js');
+Num = require('./Num.js');
+id = function(x){
+  return x;
+};
+isType = curry$(function(type, x){
+  return toString$.call(x).slice(8, -1) === type;
+});
+replicate = curry$(function(n, x){
+  var i$, results$ = [];
+  for (i$ = 0; i$ < n; ++i$) {
+    results$.push(x);
+  }
+  return results$;
+});
+Str.empty = List.empty;
+Str.slice = List.slice;
+Str.take = List.take;
+Str.drop = List.drop;
+Str.splitAt = List.splitAt;
+Str.takeWhile = List.takeWhile;
+Str.dropWhile = List.dropWhile;
+Str.span = List.span;
+Str.breakStr = List.breakList;
+prelude = {
+  Func: Func,
+  List: List,
+  Obj: Obj,
+  Str: Str,
+  Num: Num,
+  id: id,
+  isType: isType,
+  replicate: replicate
+};
+prelude.each = List.each;
+prelude.map = List.map;
+prelude.filter = List.filter;
+prelude.compact = List.compact;
+prelude.reject = List.reject;
+prelude.partition = List.partition;
+prelude.find = List.find;
+prelude.head = List.head;
+prelude.first = List.first;
+prelude.tail = List.tail;
+prelude.last = List.last;
+prelude.initial = List.initial;
+prelude.empty = List.empty;
+prelude.reverse = List.reverse;
+prelude.difference = List.difference;
+prelude.intersection = List.intersection;
+prelude.union = List.union;
+prelude.countBy = List.countBy;
+prelude.groupBy = List.groupBy;
+prelude.fold = List.fold;
+prelude.foldl = List.foldl;
+prelude.fold1 = List.fold1;
+prelude.foldl1 = List.foldl1;
+prelude.foldr = List.foldr;
+prelude.foldr1 = List.foldr1;
+prelude.unfoldr = List.unfoldr;
+prelude.andList = List.andList;
+prelude.orList = List.orList;
+prelude.any = List.any;
+prelude.all = List.all;
+prelude.unique = List.unique;
+prelude.uniqueBy = List.uniqueBy;
+prelude.sort = List.sort;
+prelude.sortWith = List.sortWith;
+prelude.sortBy = List.sortBy;
+prelude.sum = List.sum;
+prelude.product = List.product;
+prelude.mean = List.mean;
+prelude.average = List.average;
+prelude.concat = List.concat;
+prelude.concatMap = List.concatMap;
+prelude.flatten = List.flatten;
+prelude.maximum = List.maximum;
+prelude.minimum = List.minimum;
+prelude.maximumBy = List.maximumBy;
+prelude.minimumBy = List.minimumBy;
+prelude.scan = List.scan;
+prelude.scanl = List.scanl;
+prelude.scan1 = List.scan1;
+prelude.scanl1 = List.scanl1;
+prelude.scanr = List.scanr;
+prelude.scanr1 = List.scanr1;
+prelude.slice = List.slice;
+prelude.take = List.take;
+prelude.drop = List.drop;
+prelude.splitAt = List.splitAt;
+prelude.takeWhile = List.takeWhile;
+prelude.dropWhile = List.dropWhile;
+prelude.span = List.span;
+prelude.breakList = List.breakList;
+prelude.zip = List.zip;
+prelude.zipWith = List.zipWith;
+prelude.zipAll = List.zipAll;
+prelude.zipAllWith = List.zipAllWith;
+prelude.at = List.at;
+prelude.elemIndex = List.elemIndex;
+prelude.elemIndices = List.elemIndices;
+prelude.findIndex = List.findIndex;
+prelude.findIndices = List.findIndices;
+prelude.apply = Func.apply;
+prelude.curry = Func.curry;
+prelude.flip = Func.flip;
+prelude.fix = Func.fix;
+prelude.over = Func.over;
+prelude.split = Str.split;
+prelude.join = Str.join;
+prelude.lines = Str.lines;
+prelude.unlines = Str.unlines;
+prelude.words = Str.words;
+prelude.unwords = Str.unwords;
+prelude.chars = Str.chars;
+prelude.unchars = Str.unchars;
+prelude.repeat = Str.repeat;
+prelude.capitalize = Str.capitalize;
+prelude.camelize = Str.camelize;
+prelude.dasherize = Str.dasherize;
+prelude.values = Obj.values;
+prelude.keys = Obj.keys;
+prelude.pairsToObj = Obj.pairsToObj;
+prelude.objToPairs = Obj.objToPairs;
+prelude.listsToObj = Obj.listsToObj;
+prelude.objToLists = Obj.objToLists;
+prelude.max = Num.max;
+prelude.min = Num.min;
+prelude.negate = Num.negate;
+prelude.abs = Num.abs;
+prelude.signum = Num.signum;
+prelude.quot = Num.quot;
+prelude.rem = Num.rem;
+prelude.div = Num.div;
+prelude.mod = Num.mod;
+prelude.recip = Num.recip;
+prelude.pi = Num.pi;
+prelude.tau = Num.tau;
+prelude.exp = Num.exp;
+prelude.sqrt = Num.sqrt;
+prelude.ln = Num.ln;
+prelude.pow = Num.pow;
+prelude.sin = Num.sin;
+prelude.tan = Num.tan;
+prelude.cos = Num.cos;
+prelude.acos = Num.acos;
+prelude.asin = Num.asin;
+prelude.atan = Num.atan;
+prelude.atan2 = Num.atan2;
+prelude.truncate = Num.truncate;
+prelude.round = Num.round;
+prelude.ceiling = Num.ceiling;
+prelude.floor = Num.floor;
+prelude.isItNaN = Num.isItNaN;
+prelude.even = Num.even;
+prelude.odd = Num.odd;
+prelude.gcd = Num.gcd;
+prelude.lcm = Num.lcm;
+prelude.VERSION = '1.1.2';
+module.exports = prelude;
+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();
+}
+},{"./Func.js":1,"./List.js":2,"./Num.js":3,"./Obj.js":4,"./Str.js":5}]},{},[])
\ No newline at end of file
diff --git a/lib/Func.js b/lib/Func.js
new file mode 100644
index 0000000..b80c9b1
--- /dev/null
+++ b/lib/Func.js
@@ -0,0 +1,65 @@
+// Generated by LiveScript 1.4.0
+var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString;
+apply = curry$(function(f, list){
+  return f.apply(null, list);
+});
+curry = function(f){
+  return curry$(f);
+};
+flip = curry$(function(f, x, y){
+  return f(y, x);
+});
+fix = function(f){
+  return function(g){
+    return function(){
+      return f(g(g)).apply(null, arguments);
+    };
+  }(function(g){
+    return function(){
+      return f(g(g)).apply(null, arguments);
+    };
+  });
+};
+over = curry$(function(f, g, x, y){
+  return f(g(x), g(y));
+});
+memoize = function(f){
+  var memo;
+  memo = {};
+  return function(){
+    var args, key, arg;
+    args = slice$.call(arguments);
+    key = (function(){
+      var i$, ref$, len$, results$ = [];
+      for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
+        arg = ref$[i$];
+        results$.push(arg + toString$.call(arg).slice(8, -1));
+      }
+      return results$;
+    }()).join('');
+    return memo[key] = key in memo
+      ? memo[key]
+      : f.apply(null, args);
+  };
+};
+module.exports = {
+  curry: curry,
+  flip: flip,
+  fix: fix,
+  apply: apply,
+  over: over,
+  memoize: memoize
+};
+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();
+}
\ No newline at end of file
diff --git a/lib/List.js b/lib/List.js
new file mode 100644
index 0000000..5790816
--- /dev/null
+++ b/lib/List.js
@@ -0,0 +1,686 @@
+// Generated by LiveScript 1.4.0
+var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, 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, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, z [...]
+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 = 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){
+  return xs[0];
+};
+tail = function(xs){
+  if (!xs.length) {
+    return;
+  }
+  return xs.slice(1);
+};
+last = function(xs){
+  return xs[xs.length - 1];
+};
+initial = function(xs){
+  if (!xs.length) {
+    return;
+  }
+  return xs.slice(0, -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;
+};
+uniqueBy = curry$(function(f, xs){
+  var seen, i$, len$, x, val, results$ = [];
+  seen = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    x = xs[i$];
+    val = f(x);
+    if (in$(val, seen)) {
+      continue;
+    }
+    seen.push(val);
+    results$.push(x);
+  }
+  return results$;
+});
+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){
+  var i$, x;
+  for (i$ = xs.length - 1; i$ >= 0; --i$) {
+    x = xs[i$];
+    memo = f(x, memo);
+  }
+  return memo;
+});
+foldr1 = curry$(function(f, xs){
+  return foldr(f, xs[xs.length - 1], xs.slice(0, -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 = 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){
+  return xs.concat().sort(f);
+});
+sortBy = curry$(function(f, xs){
+  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, i$, len$, x;
+  sum = 0;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    x = xs[i$];
+    sum += x;
+  }
+  return sum / xs.length;
+};
+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;
+};
+maximumBy = curry$(function(f, 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 (f(x) > f(max)) {
+      max = x;
+    }
+  }
+  return max;
+});
+minimumBy = curry$(function(f, 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 (f(x) < f(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 {
+    return xs.slice(0, n);
+  }
+});
+drop = curry$(function(n, xs){
+  if (n <= 0) {
+    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$(p, not$), 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 = undefined;
+  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 = undefined;
+  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$;
+  }
+};
+at = curry$(function(n, xs){
+  if (n < 0) {
+    return xs[xs.length + n];
+  } else {
+    return xs[n];
+  }
+});
+elemIndex = curry$(function(el, xs){
+  var i$, len$, i, x;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (x === el) {
+      return i;
+    }
+  }
+});
+elemIndices = curry$(function(el, xs){
+  var i$, len$, i, x, results$ = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (x === el) {
+      results$.push(i);
+    }
+  }
+  return results$;
+});
+findIndex = curry$(function(f, xs){
+  var i$, len$, i, x;
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (f(x)) {
+      return i;
+    }
+  }
+});
+findIndices = curry$(function(f, xs){
+  var i$, len$, i, x, results$ = [];
+  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
+    i = i$;
+    x = xs[i$];
+    if (f(x)) {
+      results$.push(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,
+  uniqueBy: uniqueBy,
+  sort: sort,
+  sortWith: sortWith,
+  sortBy: sortBy,
+  sum: sum,
+  product: product,
+  mean: mean,
+  average: average,
+  concat: concat,
+  concatMap: concatMap,
+  flatten: flatten,
+  maximum: maximum,
+  minimum: minimum,
+  maximumBy: maximumBy,
+  minimumBy: minimumBy,
+  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,
+  at: at,
+  elemIndex: elemIndex,
+  elemIndices: elemIndices,
+  findIndex: findIndex,
+  findIndices: findIndices
+};
+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, xs){
+  var i = -1, l = xs.length >>> 0;
+  while (++i < l) if (x === xs[i]) return true;
+  return false;
+}
+function compose$() {
+  var functions = arguments;
+  return function() {
+    var i, result;
+    result = functions[0].apply(this, arguments);
+    for (i = 1; i < functions.length; ++i) {
+      result = functions[i](result);
+    }
+    return result;
+  };
+}
+function not$(x){ return !x; }
\ No newline at end of file
diff --git a/lib/Num.js b/lib/Num.js
new file mode 100644
index 0000000..0e25be7
--- /dev/null
+++ b/lib/Num.js
@@ -0,0 +1,130 @@
+// Generated by LiveScript 1.4.0
+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();
+}
\ No newline at end of file
diff --git a/lib/Obj.js b/lib/Obj.js
new file mode 100644
index 0000000..f0a921f
--- /dev/null
+++ b/lib/Obj.js
@@ -0,0 +1,154 @@
+// Generated by LiveScript 1.4.0
+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, resultObj$ = {};
+  for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
+    x = object[i$];
+    resultObj$[x[0]] = x[1];
+  }
+  return resultObj$;
+};
+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, resultObj$ = {};
+  for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
+    i = i$;
+    key = keys[i$];
+    resultObj$[key] = values[i];
+  }
+  return resultObj$;
+});
+objToLists = function(object){
+  var keys, values, key, value;
+  keys = [];
+  values = [];
+  for (key in object) {
+    value = object[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, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    resultObj$[k] = f(x);
+  }
+  return resultObj$;
+});
+compact = function(object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (x) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+};
+filter = curry$(function(f, object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (f(x)) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+});
+reject = curry$(function(f, object){
+  var k, x, resultObj$ = {};
+  for (k in object) {
+    x = object[k];
+    if (!f(x)) {
+      resultObj$[k] = x;
+    }
+  }
+  return resultObj$;
+});
+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();
+}
\ No newline at end of file
diff --git a/lib/Str.js b/lib/Str.js
new file mode 100644
index 0000000..eb9a1ac
--- /dev/null
+++ b/lib/Str.js
@@ -0,0 +1,92 @@
+// Generated by LiveScript 1.4.0
+var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
+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 result, i$;
+  result = '';
+  for (i$ = 0; i$ < n; ++i$) {
+    result += str;
+  }
+  return result;
+});
+capitalize = function(str){
+  return str.charAt(0).toUpperCase() + str.slice(1);
+};
+camelize = function(it){
+  return it.replace(/[-_]+(.)?/g, function(arg$, c){
+    return (c != null ? c : '').toUpperCase();
+  });
+};
+dasherize = function(str){
+  return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
+    return lower + "-" + (upper.length > 1
+      ? upper
+      : upper.toLowerCase());
+  }).replace(/^([A-Z]+)/, function(arg$, upper){
+    if (upper.length > 1) {
+      return upper + "-";
+    } else {
+      return upper.toLowerCase();
+    }
+  });
+};
+module.exports = {
+  split: split,
+  join: join,
+  lines: lines,
+  unlines: unlines,
+  words: words,
+  unwords: unwords,
+  chars: chars,
+  unchars: unchars,
+  reverse: reverse,
+  repeat: repeat,
+  capitalize: capitalize,
+  camelize: camelize,
+  dasherize: dasherize
+};
+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();
+}
\ No newline at end of file
diff --git a/lib/index.js b/lib/index.js
new file mode 100644
index 0000000..391cb2e
--- /dev/null
+++ b/lib/index.js
@@ -0,0 +1,178 @@
+// Generated by LiveScript 1.4.0
+var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
+Func = require('./Func.js');
+List = require('./List.js');
+Obj = require('./Obj.js');
+Str = require('./Str.js');
+Num = require('./Num.js');
+id = function(x){
+  return x;
+};
+isType = curry$(function(type, x){
+  return toString$.call(x).slice(8, -1) === type;
+});
+replicate = curry$(function(n, x){
+  var i$, results$ = [];
+  for (i$ = 0; i$ < n; ++i$) {
+    results$.push(x);
+  }
+  return results$;
+});
+Str.empty = List.empty;
+Str.slice = List.slice;
+Str.take = List.take;
+Str.drop = List.drop;
+Str.splitAt = List.splitAt;
+Str.takeWhile = List.takeWhile;
+Str.dropWhile = List.dropWhile;
+Str.span = List.span;
+Str.breakStr = List.breakList;
+prelude = {
+  Func: Func,
+  List: List,
+  Obj: Obj,
+  Str: Str,
+  Num: Num,
+  id: id,
+  isType: isType,
+  replicate: replicate
+};
+prelude.each = List.each;
+prelude.map = List.map;
+prelude.filter = List.filter;
+prelude.compact = List.compact;
+prelude.reject = List.reject;
+prelude.partition = List.partition;
+prelude.find = List.find;
+prelude.head = List.head;
+prelude.first = List.first;
+prelude.tail = List.tail;
+prelude.last = List.last;
+prelude.initial = List.initial;
+prelude.empty = List.empty;
+prelude.reverse = List.reverse;
+prelude.difference = List.difference;
+prelude.intersection = List.intersection;
+prelude.union = List.union;
+prelude.countBy = List.countBy;
+prelude.groupBy = List.groupBy;
+prelude.fold = List.fold;
+prelude.foldl = List.foldl;
+prelude.fold1 = List.fold1;
+prelude.foldl1 = List.foldl1;
+prelude.foldr = List.foldr;
+prelude.foldr1 = List.foldr1;
+prelude.unfoldr = List.unfoldr;
+prelude.andList = List.andList;
+prelude.orList = List.orList;
+prelude.any = List.any;
+prelude.all = List.all;
+prelude.unique = List.unique;
+prelude.uniqueBy = List.uniqueBy;
+prelude.sort = List.sort;
+prelude.sortWith = List.sortWith;
+prelude.sortBy = List.sortBy;
+prelude.sum = List.sum;
+prelude.product = List.product;
+prelude.mean = List.mean;
+prelude.average = List.average;
+prelude.concat = List.concat;
+prelude.concatMap = List.concatMap;
+prelude.flatten = List.flatten;
+prelude.maximum = List.maximum;
+prelude.minimum = List.minimum;
+prelude.maximumBy = List.maximumBy;
+prelude.minimumBy = List.minimumBy;
+prelude.scan = List.scan;
+prelude.scanl = List.scanl;
+prelude.scan1 = List.scan1;
+prelude.scanl1 = List.scanl1;
+prelude.scanr = List.scanr;
+prelude.scanr1 = List.scanr1;
+prelude.slice = List.slice;
+prelude.take = List.take;
+prelude.drop = List.drop;
+prelude.splitAt = List.splitAt;
+prelude.takeWhile = List.takeWhile;
+prelude.dropWhile = List.dropWhile;
+prelude.span = List.span;
+prelude.breakList = List.breakList;
+prelude.zip = List.zip;
+prelude.zipWith = List.zipWith;
+prelude.zipAll = List.zipAll;
+prelude.zipAllWith = List.zipAllWith;
+prelude.at = List.at;
+prelude.elemIndex = List.elemIndex;
+prelude.elemIndices = List.elemIndices;
+prelude.findIndex = List.findIndex;
+prelude.findIndices = List.findIndices;
+prelude.apply = Func.apply;
+prelude.curry = Func.curry;
+prelude.flip = Func.flip;
+prelude.fix = Func.fix;
+prelude.over = Func.over;
+prelude.split = Str.split;
+prelude.join = Str.join;
+prelude.lines = Str.lines;
+prelude.unlines = Str.unlines;
+prelude.words = Str.words;
+prelude.unwords = Str.unwords;
+prelude.chars = Str.chars;
+prelude.unchars = Str.unchars;
+prelude.repeat = Str.repeat;
+prelude.capitalize = Str.capitalize;
+prelude.camelize = Str.camelize;
+prelude.dasherize = Str.dasherize;
+prelude.values = Obj.values;
+prelude.keys = Obj.keys;
+prelude.pairsToObj = Obj.pairsToObj;
+prelude.objToPairs = Obj.objToPairs;
+prelude.listsToObj = Obj.listsToObj;
+prelude.objToLists = Obj.objToLists;
+prelude.max = Num.max;
+prelude.min = Num.min;
+prelude.negate = Num.negate;
+prelude.abs = Num.abs;
+prelude.signum = Num.signum;
+prelude.quot = Num.quot;
+prelude.rem = Num.rem;
+prelude.div = Num.div;
+prelude.mod = Num.mod;
+prelude.recip = Num.recip;
+prelude.pi = Num.pi;
+prelude.tau = Num.tau;
+prelude.exp = Num.exp;
+prelude.sqrt = Num.sqrt;
+prelude.ln = Num.ln;
+prelude.pow = Num.pow;
+prelude.sin = Num.sin;
+prelude.tan = Num.tan;
+prelude.cos = Num.cos;
+prelude.acos = Num.acos;
+prelude.asin = Num.asin;
+prelude.atan = Num.atan;
+prelude.atan2 = Num.atan2;
+prelude.truncate = Num.truncate;
+prelude.round = Num.round;
+prelude.ceiling = Num.ceiling;
+prelude.floor = Num.floor;
+prelude.isItNaN = Num.isItNaN;
+prelude.even = Num.even;
+prelude.odd = Num.odd;
+prelude.gcd = Num.gcd;
+prelude.lcm = Num.lcm;
+prelude.VERSION = '1.1.2';
+module.exports = prelude;
+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();
+}
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..5507d3c
--- /dev/null
+++ b/package.json
@@ -0,0 +1,52 @@
+{
+  "name": "prelude-ls",
+  "version": "1.1.2",
+  "author": "George Zahariev <z at georgezahariev.com>",
+  "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
+  "keywords": [
+    "prelude",
+    "livescript",
+    "utility",
+    "ls",
+    "coffeescript",
+    "javascript",
+    "library",
+    "functional",
+    "array",
+    "list",
+    "object",
+    "string"
+  ],
+  "main": "lib/",
+  "files": [
+    "lib/",
+    "README.md",
+    "LICENSE"
+  ],
+  "homepage": "http://preludels.com",
+  "bugs": "https://github.com/gkz/prelude-ls/issues",
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE"
+    }
+  ],
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/gkz/prelude-ls.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "devDependencies": {
+    "livescript": "~1.4.0",
+    "uglify-js": "~2.4.12",
+    "mocha": "~2.2.4",
+    "istanbul": "~0.2.4",
+    "browserify": "~3.24.13",
+    "sinon": "~1.10.2"
+  }
+}
diff --git a/package.json.ls b/package.json.ls
new file mode 100644
index 0000000..daecb4b
--- /dev/null
+++ b/package.json.ls
@@ -0,0 +1,48 @@
+name: 'prelude-ls'
+version: '1.1.2'
+
+author: 'George Zahariev <z at georgezahariev.com>'
+
+description: "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript."
+
+keywords:
+  'prelude'
+  'livescript'
+  'utility'
+  'ls'
+  'coffeescript'
+  'javascript'
+  'library'
+  'functional'
+  'array'
+  'list'
+  'object'
+  'string'
+
+main: 'lib/'
+files:
+  'lib/'
+  'README.md'
+  'LICENSE'
+
+homepage: 'http://preludels.com'
+bugs: 'https://github.com/gkz/prelude-ls/issues'
+licenses:
+  * type: 'MIT'
+    url: 'https://raw.github.com/gkz/prelude-ls/master/LICENSE'
+  ...
+engines:
+  node: '>= 0.8.0'
+repository:
+  type: 'git'
+  url: 'git://github.com/gkz/prelude-ls.git'
+scripts:
+  test: "make test"
+
+dev-dependencies:
+  livescript: '~1.4.0'
+  'uglify-js': '~2.4.12'
+  mocha: '~2.2.4'
+  istanbul: '~0.2.4'
+  browserify: '~3.24.13'
+  sinon: '~1.10.2'
diff --git a/preroll.ls b/preroll.ls
new file mode 100644
index 0000000..81f9b17
--- /dev/null
+++ b/preroll.ls
@@ -0,0 +1,9 @@
+version = require './lib' .VERSION
+console.log """
+// Generated by LiveScript 1.2.0
+
+// prelude.ls #version
+// Copyright (c) George Zahariev
+// Released under the MIT License
+// https://raw.githubusercontent.com/gkz/prelude-ls/master/LICENSE
+"""
diff --git a/src/Func.ls b/src/Func.ls
new file mode 100644
index 0000000..f7a4219
--- /dev/null
+++ b/src/Func.ls
@@ -0,0 +1,25 @@
+apply = (f, list) -->
+  f.apply null, list
+
+curry = (f) ->
+  curry$ f # using util method curry$ from livescript
+
+flip = (f, x, y) --> f y, x
+
+fix = (f) ->
+  ( (g) -> -> f(g g) ...arguments ) do
+    (g) -> -> f(g g) ...arguments
+
+over = (f, g, x, y) --> f (g x), (g y)
+
+memoize = (f) ->
+  memo = {}
+  (...args) ->
+    key = [arg + typeof! arg for arg in args].join ''
+    memo[key] = if key of memo then memo[key] else f ...args
+
+#? wrap
+
+module.exports = {
+  curry, flip, fix, apply, over, memoize
+}
diff --git a/src/List.ls b/src/List.ls
new file mode 100644
index 0000000..353732a
--- /dev/null
+++ b/src/List.ls
@@ -0,0 +1,336 @@
+each = (f, xs) -->
+  for x in xs
+    f x
+  xs
+
+map = (f, xs) -->
+  [f x for x in xs]
+
+compact = (xs) -->
+  [x for x in xs when x]
+
+filter = (f, xs) -->
+  [x for x in xs when f x]
+
+reject = (f, xs) -->
+  [x for x in xs when not f x]
+
+partition = (f, xs) -->
+  passed = []
+  failed = []
+  for x in xs
+    (if f x then passed else failed).push x
+  [passed, failed]
+
+find = (f, xs) -->
+  for x in xs when f x
+    return x
+  void
+
+head = first = (xs) ->
+  xs.0
+
+tail = (xs) ->
+  return void unless xs.length
+  xs.slice 1
+
+last = (xs) ->
+  xs[*-1]
+
+initial = (xs) ->
+  return void unless xs.length
+  xs.slice 0, -1
+
+empty = (xs) ->
+  not xs.length
+
+reverse = (xs) ->
+  xs.concat!.reverse!
+
+unique = (xs) ->
+  result = []
+  for x in xs when x not in result
+    result.push x
+  result
+
+unique-by = (f, xs) -->
+  seen = []
+  for x in xs
+    val = f x
+    continue if val in seen
+    seen.push val
+    x
+
+fold = foldl = (f, memo, xs) -->
+  for x in xs
+    memo = f memo, x
+  memo
+
+fold1 = foldl1 = (f, xs) -->
+  fold f, xs.0, xs.slice 1
+
+foldr = (f, memo, xs) -->
+  for x in xs by -1
+    memo = f x, memo
+  memo
+
+foldr1 = (f, xs) -->
+  foldr f, xs[*-1], xs.slice 0, -1
+
+unfoldr = (f, b) -->
+  result = []
+  x = b
+  while (f x)?
+    result.push that.0
+    x = that.1
+  result
+
+concat = (xss) ->
+  [].concat.apply [], xss
+
+concat-map = (f, xs) -->
+  [].concat.apply [], [f x for x in xs]
+
+flatten = (xs) -->
+  [].concat.apply [], [(if typeof! x is 'Array' then flatten x else x) for x in xs]
+
+difference = (xs, ...yss) ->
+  results = []
+  :outer for x in xs
+    for ys in yss
+      continue outer if x in ys
+    results.push x
+  results
+
+intersection = (xs, ...yss) ->
+  results = []
+  :outer for x in xs
+    for ys in yss
+      continue outer unless x in ys
+    results.push x
+  results
+
+union = (...xss) ->
+  results = []
+  for xs in xss
+    for x in xs
+      results.push x unless x in results
+  results
+
+count-by = (f, xs) -->
+  results = {}
+  for x in xs
+    key = f x
+    if key of results
+      results[key] += 1
+    else
+      results[key] = 1
+  results
+
+group-by = (f, xs) -->
+  results = {}
+  for x in xs
+    key = f x
+    if key of results
+      results[key].push x
+    else
+      results[key] = [x]
+  results
+
+and-list = (xs) ->
+  for x in xs when not x
+    return false
+  true
+
+or-list = (xs) ->
+  for x in xs when x
+    return true
+  false
+
+any = (f, xs) -->
+  for x in xs when f x
+    return true
+  false
+
+all = (f, xs) -->
+  for x in xs when not f x
+    return false
+  true
+
+sort = (xs) ->
+  xs.concat!.sort (x, y) ->
+    if x > y
+      1
+    else if x < y
+      -1
+    else
+      0
+
+sort-with = (f, xs) -->
+  xs.concat!.sort f
+
+sort-by = (f, xs) -->
+  xs.concat!.sort (x, y) ->
+    if (f x) > (f y)
+      1
+    else if (f x) < (f y)
+      -1
+    else
+      0
+
+sum = (xs) ->
+  result = 0
+  for x in xs
+    result += x
+  result
+
+product = (xs) ->
+  result = 1
+  for x in xs
+    result *= x
+  result
+
+mean = average = (xs) ->
+  sum = 0
+  for x in xs
+    sum += x
+  sum / xs.length
+
+maximum = (xs) ->
+  max = xs.0
+  for x in xs.slice 1 when x > max
+    max = x
+  max
+
+minimum = (xs) ->
+  min = xs.0
+  for x in xs.slice 1 when x < min
+    min = x
+  min
+
+maximum-by = (f, xs) -->
+  max = xs.0
+  for x in xs.slice 1 when (f x) > (f max)
+    max = x
+  max
+
+minimum-by = (f, xs) -->
+  min = xs.0
+  for x in xs.slice 1 when (f x) < (f min)
+    min = x
+  min
+
+scan = scanl = (f, memo, xs) -->
+  last = memo
+  [memo] ++ [last = f last, x for x in xs]
+
+scan1 = scanl1 = (f, xs) -->
+  return void unless xs.length
+  scan f, xs.0, xs.slice 1
+
+scanr = (f, memo, xs) -->
+  xs = xs.concat!.reverse!
+  (scan f, memo, xs).reverse!
+
+scanr1 = (f, xs) -->
+  return void unless xs.length
+  xs = xs.concat!.reverse!
+  (scan f, xs.0, xs.slice 1).reverse!
+
+slice = (x, y, xs) -->
+  xs.slice x, y
+
+take = (n, xs) -->
+  if n <= 0
+    xs.slice 0, 0
+  else
+    xs.slice 0, n
+
+drop = (n, xs) -->
+  if n <= 0
+    xs
+  else
+    xs.slice n
+
+split-at = (n, xs) --> [(take n, xs), (drop n, xs)]
+
+take-while = (p, xs) -->
+  len = xs.length
+  return xs unless len
+  i = 0
+  while i < len and p xs[i]
+    i += 1
+  xs.slice 0 i
+
+drop-while = (p, xs) -->
+  len = xs.length
+  return xs unless len
+  i = 0
+  while i < len and p xs[i]
+    i += 1
+  xs.slice i
+
+span = (p, xs) --> [(take-while p, xs), (drop-while p, xs)]
+
+break-list = (p, xs) --> span (not) << p, xs
+
+zip = (xs, ys) -->
+  result = []
+  len = ys.length
+  for x, i in xs
+    break if i is len
+    result.push [x, ys[i]]
+  result
+
+zip-with = (f, xs, ys) -->
+  result = []
+  len = ys.length
+  for x, i in xs
+    break if i is len
+    result.push f x, ys[i]
+  result
+
+zip-all = (...xss) ->
+  min-length = undefined
+  for xs in xss
+    min-length <?= xs.length
+  [[xs[i] for xs in xss] for i til min-length]
+
+zip-all-with = (f, ...xss) ->
+  min-length = undefined
+  for xs in xss
+    min-length <?= xs.length
+  [f.apply(null, [xs[i] for xs in xss]) for i til min-length]
+
+at = (n, xs) -->
+  if n < 0 then xs[xs.length + n] else xs[n]
+
+elem-index = (el, xs) -->
+  for x, i in xs when x is el
+    return i
+  void
+
+elem-indices = (el, xs) -->
+  [i for x, i in xs when x is el]
+
+find-index = (f, xs) -->
+  for x, i in xs when f x
+    return i
+  void
+
+find-indices = (f, xs) -->
+  [i for x, i in xs when f x]
+
+module.exports = {
+  each, map, filter, compact, reject, partition, find,
+  head, first, tail, last, initial, empty,
+  reverse, difference, intersection, union, count-by, group-by,
+  fold, fold1, foldl, foldl1, foldr, foldr1, unfoldr, and-list, or-list,
+  any, all, unique, unique-by, sort, sort-with, sort-by, sum, product, mean, average,
+  concat, concat-map, flatten,
+  maximum, minimum, maximum-by, minimum-by,
+  scan, scan1, scanl, scanl1, scanr, scanr1,
+  slice, take, drop, split-at, take-while, drop-while, span, break-list,
+  zip, zip-with, zip-all, zip-all-with,
+  at, elem-index, elem-indices, find-index, find-indices,
+}
diff --git a/src/Num.ls b/src/Num.ls
new file mode 100644
index 0000000..a2cdcdd
--- /dev/null
+++ b/src/Num.ls
@@ -0,0 +1,83 @@
+max = (>?)
+
+min = (<?)
+
+negate = (x) -> -x
+
+abs = Math.abs
+
+signum = (x) ->
+  if x < 0
+    -1
+  else if x > 0
+    1
+  else
+    0
+
+quot = (x, y) --> ~~(x / y)
+
+rem = (%)
+
+div = (x, y) --> Math.floor x / y
+
+mod = (%%)
+
+recip = (1 /)
+
+pi = Math.PI
+
+tau = pi * 2
+
+exp = Math.exp
+
+sqrt = Math.sqrt
+
+ln = Math.log
+
+pow = (^)
+
+sin = Math.sin
+
+tan = Math.tan
+
+cos = Math.cos
+
+asin = Math.asin
+
+acos = Math.acos
+
+atan = Math.atan
+
+atan2 = (x, y) --> Math.atan2 x, y
+
+truncate = (x) -> ~~x
+
+round = Math.round
+
+ceiling = Math.ceil
+
+floor = Math.floor
+
+is-it-NaN = (x) -> x isnt x
+
+even = (x) -> x % 2 == 0
+
+odd = (x) -> x % 2 != 0
+
+gcd = (x, y) -->
+  x = Math.abs x
+  y = Math.abs y
+  until y is 0
+    z = x % y
+    x = y
+    y = z
+  x
+
+lcm = (x, y) -->
+  Math.abs Math.floor (x / (gcd x, y) * y)
+
+module.exports = {
+  max, min, negate, abs, signum, quot, rem, div, mod, recip,
+  pi, tau, exp, sqrt, ln, pow, sin, tan, cos, acos, asin, atan, atan2,
+  truncate, round, ceiling, floor, is-it-NaN, even, odd, gcd, lcm,
+}
diff --git a/src/Obj.ls b/src/Obj.ls
new file mode 100644
index 0000000..11fd74d
--- /dev/null
+++ b/src/Obj.ls
@@ -0,0 +1,60 @@
+values = (object) ->
+  [x for , x of object]
+
+keys = (object) ->
+  [x for x of object]
+
+pairs-to-obj= (object) ->
+  {[x.0, x.1] for x in object}
+
+obj-to-pairs = (object) ->
+  [[key, value] for key, value of object]
+
+lists-to-obj= (keys, values) -->
+  {[key, values[i]] for key, i in keys}
+
+obj-to-lists = (object) ->
+  keys = []
+  values = []
+  for key, value of object
+    keys.push key
+    values.push value
+  [keys, values]
+
+empty = (object) ->
+  for x of object then return false
+  true
+
+each = (f, object) -->
+  for , x of object then f x
+  object
+
+map = (f, object) -->
+  {[k, f x] for k, x of object}
+
+compact = (object) -->
+  {[k, x] for k, x of object when x}
+
+filter = (f, object) -->
+  {[k, x] for k, x of object when f x}
+
+reject = (f, object) -->
+  {[k, x] for k, x of object when not f x}
+
+partition = (f, object) -->
+  passed = {}
+  failed = {}
+  for k, x of object
+    (if f x then passed else failed)[k] = x
+  [passed, failed]
+
+find = (f, object) -->
+  for , x of object when f x then return x
+  void
+
+module.exports = {
+  values, keys,
+  pairs-to-obj, obj-to-pairs, lists-to-obj, obj-to-lists,
+
+  empty, each, map, filter, compact, reject, partition, find,
+}
diff --git a/src/Str.ls b/src/Str.ls
new file mode 100644
index 0000000..c202795
--- /dev/null
+++ b/src/Str.ls
@@ -0,0 +1,48 @@
+split = (sep, str) -->
+  str.split sep
+
+join = (sep, xs) -->
+  xs.join sep
+
+lines = (str) ->
+  return [] unless str.length
+  str.split '\n'
+
+unlines = (.join '\n')
+
+words = (str) ->
+  return [] unless str.length
+  str.split /[ ]+/
+
+unwords = (.join ' ')
+
+chars = (.split '')
+
+unchars = (.join '')
+
+reverse = (str) ->
+  str.split '' .reverse!.join ''
+
+repeat = (n, str) -->
+  result = ''
+  for til n
+    result += str
+  result
+
+capitalize = (str) ->
+  (str.char-at 0).to-upper-case! + str.slice 1
+
+camelize = (.replace /[-_]+(.)?/g, (, c) -> (c ? '').to-upper-case!)
+
+# convert camelCase to camel-case, and setJSON to set-JSON
+dasherize = (str) ->
+    str
+      .replace /([^-A-Z])([A-Z]+)/g, (, lower, upper) ->
+         "#{lower}-#{if upper.length > 1 then upper else upper.to-lower-case!}"
+      .replace /^([A-Z]+)/, (, upper) ->
+         if upper.length > 1 then "#upper-" else upper.to-lower-case!
+
+module.exports = {
+  split, join, lines, unlines, words, unwords, chars, unchars, reverse,
+  repeat, capitalize, camelize, dasherize,
+}
diff --git a/src/index.ls b/src/index.ls
new file mode 100644
index 0000000..06a423d
--- /dev/null
+++ b/src/index.ls
@@ -0,0 +1,59 @@
+require! [
+  './Func.js'
+  './List.js'
+  './Obj.js'
+  './Str.js'
+  './Num.js'
+]
+
+id = (x) -> x
+
+is-type = (type, x) --> typeof! x is type
+
+replicate = (n, x) -->
+  [x for til n]
+
+
+Str <<< List{
+  empty, slice, take, drop, split-at, take-while, drop-while, span, break-str: break-list
+}
+
+prelude = {
+  Func, List, Obj, Str, Num,
+  id, is-type
+  replicate,
+}
+prelude <<< List{
+  each, map, filter, compact, reject, partition, find,
+  head, first, tail, last, initial, empty,
+  reverse, difference, intersection, union, count-by, group-by,
+  fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, and-list, or-list,
+  any, all, unique, unique-by, sort, sort-with, sort-by, sum, product, mean, average,
+  concat, concat-map, flatten,
+  maximum, minimum, maximum-by, minimum-by,
+  scan, scanl, scan1, scanl1, scanr, scanr1,
+  slice, take, drop, split-at, take-while, drop-while, span, break-list,
+  zip, zip-with, zip-all, zip-all-with,
+  at, elem-index, elem-indices, find-index, find-indices,
+}
+prelude <<< Func{
+  apply, curry, flip, fix, over,
+}
+prelude <<< Str{
+  split, join, lines, unlines, words, unwords, chars, unchars,
+  repeat, capitalize, camelize, dasherize,
+}
+# not importing all of Obj's functions
+prelude <<< Obj{
+  values, keys,
+  pairs-to-obj, obj-to-pairs, lists-to-obj, obj-to-lists,
+}
+prelude <<< Num{
+  max, min, negate, abs, signum, quot, rem, div, mod, recip,
+  pi, tau, exp, sqrt, ln, pow, sin, tan, cos, acos, asin, atan, atan2,
+  truncate, round, ceiling, floor, is-it-NaN, even, odd, gcd, lcm,
+}
+
+prelude.VERSION = '1.1.2'
+
+module.exports = prelude
diff --git a/test/Func.ls b/test/Func.ls
new file mode 100644
index 0000000..cd8bf8d
--- /dev/null
+++ b/test/Func.ls
@@ -0,0 +1,71 @@
+require! \sinon
+{apply, curry, flip, fix, over, memoize} = require '..' .Func
+{strict-equal: eq, not-strict-equal: not-eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'apply' ->
+  test 'empty list' ->
+    f = -> 1
+    eq 1, apply f, []
+
+  test 'a couple of args' ->
+    eq 5, apply (+), [2 3]
+
+  test 'curried' ->
+    f = apply (+)
+    eq 5, f [2 3]
+
+suite 'curry' ->
+  test 'simple function' ->
+    add = (x, y) -> x + y
+    add-curried = curry add
+    add-four = add-curried 4
+    eq 6 add-four 2
+
+suite 'flip' ->
+  test 'minus op' ->
+    eq 10, (flip (-)) 5 15
+
+suite 'fix' ->
+  test 'single arg' ->
+    eq 89, (fix (fib) -> (n) ->
+      | n <= 1      => 1
+      | otherwise   => fib(n-1) + fib(n-2))(10)
+
+  test 'multi-arg variation' ->
+    eq 89, (fix (fib) -> (n, minus=0) ->
+      | (n - minus) <= 1 => 1
+      | otherwise        => fib(n, minus+1) + fib(n, minus+2))(10)
+
+suite 'over' ->
+  test 'basic' ->
+    f = (==) `over` (-> it)
+    ok f 2 2
+    ok not f 2 3
+
+  test 'with accessor function' ->
+    same-length = (==) `over` (.length)
+    ok same-length [1 2 3] [4 5 6]
+    ok not same-length [1 2] [4 5 6]
+
+suite 'memoize' ->
+  spy = f = null
+
+  setup ->
+    spy := sinon.spy -> &
+    f := memoize spy
+
+  test 'only 1 call when using the same arguments' ->
+    [0 to 10].for-each -> f!
+    ok spy.called-once
+
+  test 'call again when using different arguments' ->
+    f \mung
+    f \mung
+    f '1,2'
+    f [1 2]
+    ok spy.called-thrice
+
+  test 'that the correct values are returned' ->
+    eq f(\mung), f(\mung)
+    eq f(\mung \face), f(\mung \face)
+    not-eq f(\mung), f(\mung \face)
diff --git a/test/List.ls b/test/List.ls
new file mode 100644
index 0000000..e76cc6f
--- /dev/null
+++ b/test/List.ls
@@ -0,0 +1,884 @@
+{
+  id
+  Num: {even, odd, floor, is-it-NaN}
+  List: {
+    each, map, filter, compact, reject, partition, find,
+    head, first, tail, last, initial, empty,
+    reverse, difference, intersection, union, count-by, group-by,
+    fold, fold1, foldl, foldl1, foldr, foldr1, unfoldr, and-list, or-list,
+    any, all, unique, unique-by, sort, sort-with, sort-by, sum, product, mean, average,
+    concat, concat-map, flatten,
+    maximum, minimum, maximum-by, minimum-by,
+    scan, scan1, scanl, scanl1, scanr, scanr1,
+    slice, take, drop, split-at, take-while, drop-while, span, break-list,
+    zip, zip-with, zip-all, zip-all-with,
+    at, elem-index, elem-indices, find-index, find-indices,
+  }
+} = require '..'
+{strict-equal: eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'each' ->
+  test 'empty list as input' ->
+    deep-eq [], each id, []
+
+  test 'side effects affect input (and thus result)' ->
+    deep-eq [[1],[2]] each (.pop!), [[1 5] [2 6]]
+
+  test 'curried' ->
+    f = each (.pop!)
+    deep-eq [[1],[2]], f [[1 5] [2 6]]
+
+suite 'map' ->
+  test 'empty list as input' ->
+    deep-eq [], map id, []
+
+  test 'mapping over array' ->
+    deep-eq [2 3 4], map (+ 1), [1 2 3]
+
+  test 'curried' ->
+    f = map (+ 1)
+    deep-eq [2 3 4], f [1 2 3]
+
+suite 'compact' ->
+  test 'empty list as input' ->
+    deep-eq [], compact []
+
+  test 'compacting array' ->
+    deep-eq [1 true 'ha'], compact [0 1 false true '' 'ha']
+
+suite 'filter' ->
+  test 'empty list as input' ->
+    deep-eq [], filter id, []
+
+  test 'filtering array' ->
+    deep-eq [2, 4], filter even, [1 to 5]
+
+  test 'filter on true returns original list' ->
+    deep-eq [1 2 3], filter (-> true), [1 2 3]
+
+  test 'filter on false returns empty list' ->
+    deep-eq [], filter (-> false), [1 2 3]
+
+  test 'curried' ->
+    f = filter even
+    deep-eq [2, 4], f [1 to 5]
+
+suite 'reject' ->
+  test 'empty list as input' ->
+    deep-eq [], reject id, []
+
+  test 'reject list' ->
+    deep-eq [1 3 5], reject even, [1 to 5]
+
+  test 'reject on true returns empty list' ->
+    deep-eq [], reject (-> true), [1 2 3]
+
+  test 'reject on true returns original list' ->
+    deep-eq [1 2 3], reject (-> false), [1 2 3]
+
+  test 'curried' ->
+    f = reject even
+    deep-eq [1 3 5], f [1 to 5]
+
+suite 'partition' ->
+  test 'empty list as input' ->
+    deep-eq [[],[]], partition id, []
+
+  test 'partition list' ->
+    deep-eq [[76 88 77 90],[49 58 43]], partition (>60), [49 58 76 43 88 77 90]
+
+  test 'partition on true returns original list as passing, empty list as failing' ->
+    deep-eq [[1 2 3],[]], partition (-> true), [1 2 3]
+
+  test 'partition on false returns empty list as failing, empty list as passing' ->
+    deep-eq [[], [1 2 3]], partition (-> false), [1 2 3]
+
+  test 'curried' ->
+    f = partition (>60)
+    deep-eq [[76 88 77 90],[49 58 43]], f [49 58 76 43 88 77 90]
+
+suite 'find' ->
+  test 'empty list as input' ->
+    eq void, find id, []
+
+  test 'find from list' ->
+    eq 4, find even, [3 1 4 8 6]
+
+  test 'finding nothing when function always false' ->
+    eq void, find (-> false), [1 2 3]
+
+  test 'find first item when function always true' ->
+    eq 1, find (-> true), [1 2 3]
+
+  test 'curried' ->
+    f = find even
+    eq 4, f [3 1 4 8 6]
+
+suite 'list portions' ->
+  list = [1 2 3 4 5]
+
+  suite 'head' ->
+    test 'empty list as input' ->
+      eq void, head []
+
+    test 'list' ->
+      eq 1, head list
+
+    test 'first as alias' ->
+      eq first, head
+
+  suite 'tail' ->
+    test 'empty list as input' ->
+      eq void, tail []
+
+    test 'list' ->
+      deep-eq [2 3 4 5], tail list
+
+    test 'one element list' ->
+      deep-eq [], tail [1]
+
+  suite 'last' ->
+    test 'empty list as input' ->
+      eq void, last []
+
+    test 'list' ->
+      eq 5, last list
+
+    test 'one element list' ->
+      eq 1, last [1]
+
+  suite 'initial' ->
+    test 'empty list as input' ->
+      eq void, initial []
+
+    test 'list' ->
+      deep-eq [1 2 3 4], initial list
+
+    test 'one element list' ->
+      deep-eq [], initial [1]
+
+suite 'empty' ->
+  test 'empty list as input' ->
+    ok empty []
+
+  test 'non-empty list as input' ->
+    ok not empty [1]
+
+suite 'reverse' ->
+  test 'empty list as input' ->
+    deep-eq [], reverse []
+
+  test 'reverse list, it is unmodified' ->
+    list = [1 2 3 4 5]
+    deep-eq [5 4 3 2 1], reverse list
+    deep-eq [1 2 3 4 5], list
+
+suite 'unique' ->
+  test 'empty list as input' ->
+    deep-eq [], unique []
+
+  test 'unique list' ->
+    deep-eq [1,2,3,4,5,6], unique [1 1 2 3 3 4 5 5 5 5 5 6 6 6 6]
+
+  test 'mixed string/num' ->
+    deep-eq ['1' 1 2 4 5], unique ['1' 1 2 4 5 5]
+
+suite 'unique-by' ->
+  test 'empty list as input' ->
+    deep-eq [], unique-by id, []
+
+  test 'basic' ->
+    deep-eq [1,2,3,4,5,6], unique-by id, [1 1 2 3 3 4 5 5 5 5 5 6 6 6 6]
+
+  test 'accessor' ->
+    deep-eq [[] [1 2 3] [4] [5 6]], unique-by (.length), [[], [1 2 3], [4], [5 6], [7], [8 9 10]]
+
+  test 'curried' ->
+    deep-eq [1,2,3,4,5,6], (unique-by id) [1 1 2 3 3 4 5 5 5 5 5 6 6 6 6]
+
+suite 'fold' ->
+  test 'empty list as input' ->
+    eq 0, fold (+), 0, []
+
+  test 'list as input' ->
+    eq 12, fold (+), 0, [1 2 3 6]
+
+  test 'foldl is alias' ->
+    eq fold, foldl
+
+  test 'curried' ->
+    f = fold (+)
+    eq 12, f 0, [1 2 3 6]
+
+    g = fold (+), 0
+    eq 12 g [1 2 3 6]
+
+suite 'fold1' ->
+  test 'empty list as input' ->
+    eq void, fold1 (+), []
+
+  test 'list as input' ->
+    eq 12, fold1 (+), [1 2 3 6]
+
+  test 'foldl1 as alais' ->
+    eq fold1, foldl1
+
+  test 'curried' ->
+    f = fold1 (+)
+    eq 12, f [1 2 3 6]
+
+suite 'foldr' ->
+  test 'empty list as input' ->
+    eq 0, foldr (+), 0, []
+
+  test 'list as input' ->
+    eq 7, foldr (-), 9, [1 2 3 4]
+    eq 'abcde', foldr (+), 'e', <[ a b c d ]>
+
+  test 'curried' ->
+    f = foldr (-)
+    eq 7, f 9, [1 2 3 4]
+
+    g = foldr (-), 9
+    eq 7, g [1 2 3 4]
+
+suite 'foldr1' ->
+  test 'empty list as input' ->
+    eq void, foldr1 (+), []
+
+  test 'list as input' ->
+    eq 7, foldr1 (-), [1 2 3 4 9]
+    eq 'abcde', foldr1 (+), <[ a b c d e ]>
+
+  test 'curried' ->
+    f = foldr1 (-)
+    eq 7, f [1 2 3 4 9]
+
+suite 'unfoldr' ->
+  test 'complex case' ->
+    deep-eq [10,9,8,7,6,5,4,3,2,1], unfoldr (-> if it == 0 then null else [it, it - 1]), 10
+
+  test 'returning null right away results in a one item list' ->
+    deep-eq [], unfoldr (-> null), 'a'
+
+  test 'curried' ->
+    f = unfoldr (-> if it == 0 then null else [it, it - 1])
+    deep-eq [10,9,8,7,6,5,4,3,2,1], f 10
+
+suite 'concat' ->
+  test 'empty list as input' ->
+    deep-eq [], concat []
+
+  test 'multiple lists' ->
+    deep-eq [1,2,3,4,5,6], concat [[1 2] [3 4] [5 6]]
+
+suite 'concat-map' ->
+  test 'empty list as input' ->
+    deep-eq [], concat-map id, []
+
+  test 'using mapping and concatinating' ->
+    deep-eq [1,1,2,1,2,3], concat-map (-> [1 to it]), [1 2 3]
+
+  test 'curried' ->
+    f = concat-map (-> [1 to it])
+    deep-eq [1,1,2,1,2,3], f [1 2 3]
+
+suite 'flatten' ->
+  test 'empty list as input' ->
+    deep-eq [], flatten []
+
+  test 'nested lists as input' ->
+    deep-eq [1,2,3,4,5], flatten [1, [[2], 3], [4, [[5]]]]
+
+  test 'lists with strings' ->
+    deep-eq ['a','b','c','d','e'], flatten ['a', [['b'], 'c'], ['d', [['e']]]]
+
+suite 'difference' ->
+  test 'empty list(s) as input' ->
+    deep-eq [], difference []
+    deep-eq [], difference [] []
+
+  test 'subtract nothing' ->
+    deep-eq [1 2 3], difference [1 2 3]
+    deep-eq [1 2 3], difference [1 2 3] []
+
+  test 'subtract single element' ->
+    deep-eq [2 3], difference [1 2 3] [1]
+
+  test 'subtract multiple elements' ->
+    deep-eq [1 3 4], difference [1 2 3 4 5] [5 2 10] [9]
+
+suite 'intersection' ->
+  test 'empty list(s) as input' ->
+    deep-eq [], intersection []
+    deep-eq [], intersection [] []
+
+  test 'no common elements' ->
+    deep-eq [],intersection [2 3] [9 8] [12 1] [99]
+
+  test 'some common elements' ->
+    deep-eq [1 2], intersection [1 2 3] [101 2 1 10] [2 1] [-1 0 1 2]
+
+  test 'all common elements' ->
+    deep-eq [1 2 3], intersection [1 2 3] [2 1 3] [3 1 2]
+
+suite 'union' ->
+  test 'empty list(s) as input' ->
+    deep-eq [], union []
+    deep-eq [], union [] []
+
+  test 'list and empty list' ->
+    deep-eq [1 2 3], union [1 2 3] []
+
+  test 'with various' ->
+    deep-eq [1 5 7 3], union [1 5 7] [3 5] []
+
+suite 'count-by' ->
+  test 'empty list as input' ->
+    deep-eq [], count-by id, []
+
+  test 'list of numbers' ->
+    deep-eq {4: 1, 6: 2}, count-by floor, [4.2, 6.1, 6.4]
+
+  test 'list of strings' ->
+    deep-eq {3: 2, 5: 1}, count-by (.length), <[ one two three ]>
+
+  test 'curried' ->
+    f = count-by floor
+    deep-eq {4: 1, 6: 2}, f [4.2, 6.1, 6.4]
+
+suite 'group-by' ->
+  test 'empty list as input' ->
+    deep-eq [], group-by id, []
+
+  test 'list of numbers' ->
+    deep-eq {4: [4.2], 6: [6.1 6.4]}, group-by floor, [4.2, 6.1, 6.4]
+
+  test 'list of strings' ->
+    deep-eq {3: <[ one two ]>, 5: <[ three ]>}, group-by (.length), <[ one two three ]>
+
+  test 'curried' ->
+    f = group-by floor
+    deep-eq {4: [4.2], 6: [6.1 6.4]}, f [4.2, 6.1, 6.4]
+
+suite 'and-list' ->
+  test 'empty list as input' ->
+    ok and-list []
+
+  test 'true' ->
+    ok and-list [true, 2 + 2 == 4]
+
+  test 'false' ->
+    ok not and-list [true true false true]
+
+suite 'or-list' ->
+  test 'empty list as input' ->
+    ok not or-list []
+
+  test 'true' ->
+    ok or-list [false false false true false]
+
+  test 'false' ->
+    ok not or-list [false, 2 + 2 == 3]
+
+suite 'any' ->
+  test 'empty list as input' ->
+    ok not any id, []
+
+  test 'true' ->
+    ok any even, [1 4 3]
+
+  test 'false' ->
+    ok not any even, [1 3 7 5]
+
+  test 'curried' ->
+    f = any even
+    ok f [1 4 3]
+
+suite 'all' ->
+  test 'empty list as input' ->
+    ok all even, []
+
+  test 'true' ->
+    ok all even, [2 4 6]
+
+  test 'false' ->
+    ok not all even, [2 5 6]
+
+  test 'curried' ->
+    f = all even
+    ok f [2 4 6]
+
+suite 'sort' ->
+  test 'empty list as input' ->
+    deep-eq [], sort []
+
+  test 'single digit numbers' ->
+    deep-eq [1,2,3,4,5,6], sort [3 1 5 2 4 6]
+
+  test 'multi digit numbers' ->
+    deep-eq [2,5,6,12,334,4999], sort [334 12 5 2 4999 6]
+
+  test 'same digits' ->
+    deep-eq [1 2 2 2 3], sort [2 3 2 1 2]
+
+suite 'sort-with' ->
+  f = (x, y) ->
+    | x.length > y.length => 1
+    | x.length < y.length => -1
+    | otherwise           => 0
+
+  test 'empty list as input' ->
+    deep-eq [], sort-with id, []
+
+  test 'complex case' ->
+    deep-eq ['one','two','three'], sort-with f, <[ three one two ]>
+
+  test 'curried' ->
+    g = sort-with f
+    deep-eq ['one','two','three'], g <[ three one two ]>
+
+suite 'sort-by' ->
+  arr =
+    'hey'
+    'a'
+    'there'
+    'hey'
+    'ha'
+
+  test 'empty list as input' ->
+    deep-eq [], sort-by id, []
+
+  test 'complex case' ->
+    deep-eq ['a', 'ha', 'hey', 'hey', 'there'], sort-by (.length), arr
+
+  test 'curried' ->
+    f = sort-by (.length)
+    deep-eq ['a', 'ha', 'hey', 'hey', 'there'], f arr
+
+suite 'sum' ->
+  test 'empty list as input' ->
+    eq 0, sum []
+
+  test 'list as input' ->
+    eq 10, sum [1 2 3 4]
+
+  test 'negative numbers' ->
+    eq -2, sum [1 -2 3 -4]
+
+suite 'product' ->
+  test 'empty list as input' ->
+    eq 1, product []
+
+  test 'list as input' ->
+    eq 24, product [1 2 3 4]
+
+  test 'negative numbers' ->
+    eq -6, product [1 -2 3]
+
+suite 'mean' ->
+  test 'empty list as input' ->
+    ok is-it-NaN mean []
+
+  test 'list as input' ->
+    eq 4, mean [2 3 4 5 6]
+
+  test 'average as alias' ->
+    eq mean, average
+
+suite 'maximum' ->
+  test 'empty list as input' ->
+    eq void, maximum []
+
+  test 'single element list' ->
+    eq 1, maximum [1]
+
+  test 'multi element list' ->
+    eq 6, maximum [1 2 6 4 5]
+
+suite 'minimum' ->
+  test 'empty list as input' ->
+    eq void, minimum []
+
+  test 'single element list' ->
+    eq 1, minimum [1]
+
+  test 'multi element list' ->
+    eq 2, minimum [4 3 2 6 9]
+
+  test 'list of strings' ->
+    eq 'a', minimum ['c', 'e', 'a', 'd', 'b']
+
+suite 'maximum-by' ->
+  test 'empty list as input' ->
+    eq void, maximum-by id, []
+
+  test 'single element list' ->
+    eq 1, maximum-by id, [1]
+
+  test 'multi element list' ->
+    eq 'long-string', maximum-by (.length), <[ hi there I am a really long-string ]>
+
+  test 'curried' ->
+    eq 2, (maximum-by id) [1 2 0]
+
+suite 'minimum-by' ->
+  test 'empty list as input' ->
+    eq void, minimum-by id, []
+
+  test 'single element list' ->
+    eq 1, minimum-by id, [1]
+
+  test 'multi element list' ->
+    eq 'I', minimum-by (.length), <[ hi there I am a really long-string ]>
+
+  test 'curried' ->
+    eq 0, (minimum-by id) [1 2 0]
+
+suite 'scan' ->
+  test 'empty list as input' ->
+    deep-eq [null], scan id, null, []
+
+  test 'complex case' ->
+    deep-eq [4,9,20,43], scan ((x, y) -> 2 * x + y), 4, [1 2 3]
+
+  test 'scanl as alias' ->
+    eq scan, scanl
+
+  test 'curried' ->
+    f = scan ((x, y) -> 2 * x + y)
+    deep-eq [4,9,20,43], f 4, [1 2 3]
+
+    g = scan ((x, y) -> 2 * x + y), 4
+    deep-eq [4,9,20,43], g [1 2 3]
+
+suite 'scan1' ->
+  test 'empty list as input' ->
+    deep-eq void, scan1 id, []
+
+  test 'complex case' ->
+    deep-eq [1,3,6,10], scan1 (+), [1 2 3 4]
+
+  test 'scanl1 as alias' ->
+    eq scan1, scanl1
+
+  test 'curried' ->
+    f = scan1 (+)
+    deep-eq [1,3,6,10], f [1 2 3 4]
+
+suite 'scanr' ->
+  test 'empty list as input' ->
+    deep-eq [null], scanr id, null, []
+
+  test 'complex case' ->
+    deep-eq [15,14,12,9,5], scanr (+), 5, [1 2 3 4]
+
+  test 'curried' ->
+    f = scanr (+)
+    deep-eq [15,14,12,9,5], f 5, [1 2 3 4]
+
+    g = scanr (+), 5
+    deep-eq [15,14,12,9,5], g [1 2 3 4]
+
+suite 'scanr1' ->
+  test 'empty list as input' ->
+    deep-eq void, scanr1 id, []
+
+  test 'complex case' ->
+    deep-eq [10,9,7,4], scanr1 (+), [1 2 3 4]
+
+  test 'curried' ->
+    f = scanr1 (+)
+    deep-eq [10,9,7,4], f [1 2 3 4]
+
+suite 'slice' ->
+  test 'zero to zero' ->
+    deep-eq [], slice 0 0 [1 2 3 4 5]
+
+  test 'empty lsit as input' ->
+    deep-eq [], slice  2 3 []
+
+  test 'parts' ->
+    deep-eq [3 4], slice 2 4 [1 2 3 4 5]
+
+  test 'curried' ->
+    f = slice 2
+    deep-eq [3 4], f 4 [1 2 3 4 5]
+
+    g = slice 2 4
+    deep-eq [3 4], g [1 2 3 4 5]
+
+suite 'take' ->
+  test 'empty list as input' ->
+    deep-eq [], take 3 []
+
+  test 'zero on list' ->
+    deep-eq [], take 0 [1 2 3 4 5]
+
+  test 'negative number' ->
+    deep-eq [], take -1 [1 2 3 4 5]
+
+  test 'too big number' ->
+    deep-eq [1 2 3 4 5], take 9 [1 2 3 4 5]
+
+  test 'list' ->
+    deep-eq [1 2 3], take 3 [1 2 3 4 5]
+
+  test 'curried' ->
+    f = take 3
+    deep-eq [1 2 3], f [1 2 3 4 5]
+
+suite 'drop' ->
+  test 'empty list as input' ->
+    deep-eq [], drop 3 []
+
+  test 'zero on list' ->
+    deep-eq [1 2 3 4 5], drop 0 [1 2 3 4 5]
+
+  test 'negative number' ->
+    deep-eq [1 2 3 4 5], drop -1 [1 2 3 4 5]
+
+  test 'too big number' ->
+    deep-eq [], drop 9 [1 2 3 4 5]
+
+  test 'list' ->
+    deep-eq [4 5], drop 3 [1 2 3 4 5]
+
+  test 'curried' ->
+    f = drop 3
+    deep-eq [4 5], f [1 2 3 4 5]
+
+suite 'split-at' ->
+  test 'empty list as input' ->
+    deep-eq [[], []], split-at 3 []
+
+  test 'zero on list' ->
+    deep-eq [[], [1 2 3 4 5]], split-at 0 [1 2 3 4 5]
+
+  test 'negative number' ->
+    deep-eq [[], [1 2 3 4 5]], split-at -1 [1 2 3 4 5]
+
+  test 'too big number' ->
+    deep-eq [[1 2 3 4 5], []], split-at 9 [1 2 3 4 5]
+
+  test 'list' ->
+    deep-eq [[1 2 3], [4 5]], split-at 3 [1 2 3 4 5]
+
+  test 'curried' ->
+    f = split-at 3
+    deep-eq [[1 2 3], [4 5]], f [1 2 3 4 5]
+
+suite 'take-while' ->
+  test 'empty list as input' ->
+    deep-eq [], take-while id, []
+
+  test 'list' ->
+    deep-eq [1 3 5], take-while odd, [1 3 5 4 8 7 9]
+
+  test 'all pass' ->
+    deep-eq [42], take-while (== 42), [42]
+    deep-eq [2 4 8], take-while even, [2 4 8]
+
+  test 'all fail' ->
+    deep-eq [], take-while (== 7), [42]
+    deep-eq [], take-while odd, [2 4 8]
+
+  test 'curried' ->
+    f = take-while odd
+    deep-eq [1 3 5], f [1 3 5 4 8 7 9]
+
+suite 'drop-while' ->
+  test 'empty list as input' ->
+    deep-eq [], drop-while id, []
+
+  test 'list' ->
+    deep-eq [7 9 10], drop-while even, [2 4 6 7 9 10]
+
+  test 'all pass' ->
+    deep-eq [], drop-while (== 42), [42]
+    deep-eq [], drop-while even, [2 4 8]
+
+  test 'all-fail' ->
+    deep-eq [42], drop-while (== 7), [42]
+    deep-eq [2 4 8], drop-while odd, [2 4 8]
+
+  test 'curried' ->
+    f = drop-while even
+    deep-eq [7 9 10], f [2 4 6 7 9 10]
+
+suite 'span' ->
+  test 'empty list as input' ->
+    deep-eq [[], []], span id, []
+
+  test 'list' ->
+    deep-eq [[2 4 6], [7 9 10]], span even, [2 4 6 7 9 10]
+
+  test 'curried' ->
+    f = span even
+    deep-eq [[2 4 6], [7 9 10]], f [2 4 6 7 9 10]
+
+suite 'break-list' ->
+  test 'empty list as input' ->
+    deep-eq [[], []], break-list id, []
+
+  test 'list' ->
+    deep-eq [[1 2], [3 4 5]], break-list (== 3), [1 2 3 4 5]
+
+  test 'curried' ->
+    f = break-list (== 3)
+    deep-eq [[1 2], [3 4 5]], f [1 2 3 4 5]
+
+suite 'zip' ->
+  test 'empty lists as input' ->
+    deep-eq [], zip [] []
+
+  test 'equal length lists' ->
+    deep-eq [[1 4], [2 5]], zip [1 2] [4 5]
+
+  test 'first list shorter' ->
+    deep-eq [[1 4], [2 5]], zip [1 2] [4 5 6]
+
+  test 'second list shorter' ->
+    deep-eq [[1 4], [2 5]], zip [1 2 3] [4 5]
+
+  test 'curried' ->
+    f = zip [1 2]
+    deep-eq [[1 4], [2 5]], f [4 5]
+
+suite 'zip-with' ->
+  test 'empty lists as input' ->
+    deep-eq [], zip-with id, [], []
+
+  test 'equal length lists' ->
+    deep-eq [4 4 4], zip-with (+), [1 2 3], [3 2 1]
+
+  test 'first list shorter' ->
+    deep-eq [5 7], zip-with (+), [1 2], [4 5 6]
+
+  test 'second list shorter' ->
+    deep-eq [5 7], zip-with (+), [1 2 3] [4 5]
+
+  test 'curried' ->
+    f = zip-with (+)
+    deep-eq [4 4 4], f [1 2 3], [3 2 1]
+
+    g = zip-with (+), [1 2 3]
+    deep-eq [4 4 4], g [3 2 1]
+
+suite 'zip-all' ->
+  test 'no lists as input' ->
+    deep-eq [], zip-all!
+
+  test 'empty lists as input' ->
+    deep-eq [], zip-all [] [] []
+
+  test 'equal length lists' ->
+    deep-eq [[1 4 7], [2 5 8], [3 6 9]], zip-all [1 2 3] [4 5 6] [7 8 9]
+
+  test 'first list shorter' ->
+    deep-eq [[1 4 7], [2 5 8]], zip-all [1 2] [4 5 6] [7 8 9]
+
+  test 'second list shorter' ->
+    deep-eq [[1 4 7], [2 5 8]], zip-all [1 2 3] [4 5] [7 8 9]
+
+  test 'third list shorter' ->
+    deep-eq [[1 4 7], [2 5 8]], zip-all [1 2 3] [4 5 6] [7 8]
+
+suite 'zip-all-with' ->
+  test 'nothing as input' ->
+    deep-eq [], zip-all-with!
+
+  test 'no lists as input' ->
+    deep-eq [], zip-all-with id
+
+  test 'empty lists as input' ->
+    deep-eq [], zip-all-with id, [], []
+
+  test 'equal length lists' ->
+    deep-eq [5 5 5], zip-all-with (-> &0 + &1 + &2), [1 2 3], [3 2 1], [1 1 1]
+
+  test 'first list shorter' ->
+    deep-eq [5 7], zip-all-with (+), [1 2], [4 5 6]
+
+  test 'second list shorter' ->
+    deep-eq [5 7], zip-all-with (+), [1 2 3] [4 5]
+
+suite 'at' ->
+  test 'empty list as input' ->
+    eq void, at 0, []
+
+  test 'positive n' ->
+    eq 2, at 1, [1 2 3]
+
+  test 'negative n' ->
+    eq 3, at -1, [1 2 3]
+
+  test 'not defined at index' ->
+    eq void, at 10, [1 2 3]
+
+  test 'curried' ->
+    eq 2, (at 1) [1 2 3]
+
+suite 'elem-index' ->
+  test 'empty list as input' ->
+    eq void, elem-index 2, []
+
+  test 'basic' ->
+    eq 1, elem-index 2, [1 2 3]
+
+  test 'multiple' ->
+    eq 1, elem-index 2, [1 2 3 2 1]
+
+  test 'not there' ->
+    eq void, elem-index 5, [1 2 3]
+
+  test 'curried' ->
+    eq 1, (elem-index 2) [1 2 3]
+
+suite 'elem-indices' ->
+  test 'empty list as input' ->
+    deep-eq [], elem-indices 2, []
+
+  test 'single' ->
+    deep-eq [1], elem-indices 2, [1 2 3]
+
+  test 'multiple' ->
+    deep-eq [1, 3], elem-indices 2, [1 2 3 2 1]
+
+  test 'not there' ->
+    deep-eq [], elem-indices 5, [1 2 3]
+
+  test 'curried' ->
+    deep-eq [1], (elem-indices 2) [1 2 3]
+
+suite 'find-index' ->
+  test 'empty list as input' ->
+    eq void, find-index id, []
+
+  test 'basic' ->
+    eq 1, find-index (== 2), [1 2 3]
+
+  test 'multiple' ->
+    eq 1, find-index even, [1 2 3 4]
+
+  test 'not there' ->
+    eq void, find-index odd, [2 4 6]
+
+  test 'curried' ->
+    eq 1, (find-index (== 2)) [1 2 3]
+
+suite 'find-indices' ->
+  test 'empty list as input' ->
+    deep-eq [], find-indices id, []
+
+  test 'basic' ->
+    deep-eq [1], find-indices (== 2), [1 2 3]
+
+  test 'multiple' ->
+    deep-eq [1, 3], find-indices even, [1 2 3 4]
+
+  test 'not there' ->
+    deep-eq [], find-indices odd, [2 4 6]
+
+  test 'curried' ->
+    deep-eq [1], (find-indices (== 2)) [1 2 3]
diff --git a/test/Num.ls b/test/Num.ls
new file mode 100644
index 0000000..20b5180
--- /dev/null
+++ b/test/Num.ls
@@ -0,0 +1,255 @@
+{
+  max, min, negate, abs, signum, quot, rem, div, mod, recip,
+  pi, tau, exp, sqrt, ln, pow, sin, tan, cos, acos, asin, atan, atan2,
+  truncate, round, ceiling, floor, is-it-NaN, even, odd, gcd, lcm,
+} = require '..'
+{strict-equal: eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'max' ->
+  test 'numbers' ->
+    eq 3, max 3 3
+    eq 3, max 2 3
+    eq 3, max 3 2
+
+  test 'characters' ->
+    eq \b, max \a \b
+
+  test 'curried' ->
+    f = max 2
+    eq 3, f 3
+
+suite 'min' ->
+  test 'numbers' ->
+    eq 0, min 9 0
+
+  test 'characters' ->
+    eq \a, min \a \b
+
+  test 'curried' ->
+    f = min 9
+    eq 0, f 0
+
+suite 'negate' ->
+  test 'zero' ->
+    eq 0, negate 0
+
+  test 'negative number' ->
+    eq -2, negate 2
+
+  test 'positive number' ->
+    eq 3, negate -3
+
+suite 'abs' ->
+  test 'zero' ->
+    eq 0, abs 0
+
+  test 'negative number' ->
+    eq 4 abs -4
+
+  test 'positive number' ->
+    eq 4 abs  4
+
+suite 'signum' ->
+  test 'zero' ->
+    eq 0  signum 0
+
+  test 'negative number' ->
+    eq -1 signum -5.3
+
+  test 'positive number' ->
+    eq 1  signum 8
+
+suite 'quot' ->
+  test 'simple' ->
+    eq -6, quot -20 3
+
+  test 'curried' ->
+    f = quot -20
+    eq -6, f 3
+
+suite 'rem' ->
+  test 'simple' ->
+    eq -2, rem -20 3
+
+  test 'curried' ->
+    f = rem -20
+    eq -2, f 3
+
+suite 'div' ->
+  test 'simple' ->
+    eq -7, div -20 3
+
+  test 'curried' ->
+    f = div -20
+    eq -7, f 3
+
+suite 'mod' ->
+  test 'simple' ->
+    eq 1, mod -20 3
+
+  test 'curried' ->
+    f = mod -20
+    eq 1, f 3
+
+suite 'recip' ->
+  test 'zero' ->
+    eq Infinity, recip 0
+
+  test 'larger than 1' ->
+    eq 0.5, recip 2
+
+  test 'between 0 and 1' ->
+    eq 2, recip 0.5
+
+suite 'pi' ->
+  test 'constant' ->
+    eq 3.141592653589793, pi
+
+suite 'tau' ->
+  test 'constant' ->
+    eq 6.283185307179586, tau
+
+suite 'exp' ->
+  test 'simple' ->
+    eq 2.718281828459045, exp 1
+
+suite 'sqrt' ->
+  test 'negative numbers' ->
+    ok is-it-NaN sqrt -1
+
+  test 'simple' ->
+    eq 2 sqrt 4
+
+suite 'ln' ->
+  test 'simple' ->
+    eq 0.6931471805599453, ln 2
+
+suite 'pow' ->
+  test 'simple' ->
+    eq 4, pow 2 2
+    eq 4, pow -2 2
+
+  test 'with negative numbers' ->
+    eq 0.25, pow 2 -2
+
+  test 'between one and zero' ->
+    eq 4, pow 16 0.5
+
+  test 'curried' ->
+    f = pow 2
+    eq 4, f 2
+
+suite 'sin' ->
+  test 'zero' ->
+    eq 0, sin 0
+
+  test 'pi/2' ->
+    eq 1, sin pi/2
+
+suite 'tan' ->
+  test 'zero' ->
+    eq 0, tan 0
+
+suite 'cos' ->
+  test 'zero' ->
+    eq 1, cos 0
+
+  test 'pi' ->
+    eq -1, cos pi
+
+suite 'acos' ->
+  test 'number' ->
+    eq 1.4706289056333368, acos 0.1
+
+suite 'asin' ->
+  test 'number' ->
+    eq 1.5707963267948966, asin 1
+
+suite 'atan' ->
+  test 'number' ->
+    eq 0.7853981633974483, atan 1
+
+suite 'atan2' ->
+  test 'number' ->
+    eq 0.4636476090008061, atan2 1 2
+
+  test 'curried' ->
+    f = atan2 1
+    eq 0.4636476090008061, f 2
+
+suite 'truncate' ->
+  test 'zero' ->
+    eq 0, truncate 0
+
+  test 'positive number' ->
+    eq  1 truncate  1.5
+
+  test 'negative number' ->
+    eq -1 truncate -1.5
+
+suite 'round' ->
+  test 'up' ->
+    eq 1 round 0.6
+    eq 1 round 0.5
+
+  test 'down' ->
+    eq 0 round 0.4
+
+suite 'ceiling' ->
+  test 'zero' ->
+    eq 0, ceiling 0
+
+  test 'positive number' ->
+    eq 1, ceiling 0.1
+
+  test 'negative number' ->
+    eq 0, ceiling -0.9
+
+suite 'floor' ->
+  test 'zero' ->
+    eq 0, floor 0
+
+  test 'positive number' ->
+    eq 0, floor 0.9
+
+  test 'negative number' ->
+    eq -1, floor -0.1
+
+suite 'is-it-NaN' ->
+  test 'true' ->
+    ok is-it-NaN Math.sqrt -1
+
+  test 'false' ->
+    ok not is-it-NaN '0'
+
+suite 'even' ->
+  test 'true' ->
+    ok even 0
+    ok even -2
+
+  test 'false' ->
+    ok not even 7
+
+suite 'odd' ->
+  test 'true' ->
+    ok odd 3
+
+  test 'false' ->
+    ok not odd -4
+    ok not odd 0
+
+suite 'gcd' ->
+  test 'some numbers' ->
+    eq 6, gcd 12 18
+
+  test 'curried' ->
+    f = gcd 12
+    eq 6, f 18
+
+suite 'lcm' ->
+  test 'some numbers' ->
+    eq 36, lcm 12 18
+
+  test 'curried' ->
+    f = lcm 12
+    eq 36, f 18
diff --git a/test/Obj.ls b/test/Obj.ls
new file mode 100644
index 0000000..85b7431
--- /dev/null
+++ b/test/Obj.ls
@@ -0,0 +1,145 @@
+{
+  id
+  Obj: {
+    values, keys,
+    pairs-to-obj, obj-to-pairs, lists-to-obj, obj-to-lists,
+    empty, each, map, filter, compact, reject, partition, find,
+  }
+} = require '..'
+{strict-equal: eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'values' ->
+  test 'empty object as input' ->
+    deep-eq [], values {}
+
+  test 'object as input' ->
+    deep-eq [1 2 3], values sadf: 1, asdf: 2, fdas: 3
+
+suite 'keys' ->
+  test 'empty object as input' ->
+    deep-eq [], keys {}
+
+  test 'object as input' ->
+    deep-eq <[ sadf asdf fdas ]>, keys sadf: 1, asdf: 2, fdas: 3
+
+suite 'pairs-to-obj' ->
+  test 'empty list as input' ->
+    deep-eq {}, pairs-to-obj []
+
+  test 'pairs as input' ->
+    deep-eq {a: 'b', c: 'd', e: 1}, pairs-to-obj [['a' 'b'] ['c' 'd'] ['e' 1]]
+
+suite 'obj-to-pairs' ->
+  test 'empty object as input' ->
+    deep-eq [], obj-to-pairs {}
+
+  test 'object as input' ->
+    deep-eq [['a' 'b'] ['c' 'd'] ['e' 1]], obj-to-pairs {a: 'b', c: 'd', e: 1}
+
+suite 'lists-to-obj' ->
+  test 'empty lists as input' ->
+    deep-eq {}, lists-to-obj [] []
+
+  test 'two lists of the same length' ->
+    deep-eq  {a: 1, b: 2, c: 3}, lists-to-obj <[ a b c ]> [1 2 3]
+
+  test 'first list is shorter' ->
+    deep-eq  {a: 1, b: 2}, lists-to-obj <[ a b ]> [1 2 3]
+
+  test 'first list is longer' ->
+    deep-eq  {a: 1, b: 2, c: void}, lists-to-obj <[ a b c ]> [1 2]
+
+  test 'curried' ->
+    f = lists-to-obj <[ a b c ]>
+    deep-eq  {a: 1, b: 2, c: 3}, f [1 2 3]
+
+suite 'obj-to-lists' ->
+  test 'empty object as input' ->
+    deep-eq [[], []], obj-to-lists {}
+
+  test 'two lists of the same length' ->
+    deep-eq [<[ a b c ]>, [1 2 3]], obj-to-lists {a: 1, b: 2, c: 3}
+
+suite 'empty' ->
+  test 'empty object as input' ->
+    ok empty {}
+
+  test 'non-empty object as input' ->
+    ok not empty {x: 1}
+
+suite 'each' ->
+  test 'empty object as input' ->
+    deep-eq {}, each id, {}
+
+  test 'iterate over object values' ->
+    count = 4
+    each (-> count += it), {a: 1, b: 2, c: 3}
+    eq 10 count
+
+  test 'curried' ->
+    count = 4
+    f = each (-> count += it)
+    f {a: 1, b: 2, c: 3}
+    eq 10 count
+
+suite 'map' ->
+  test 'empty object as input' ->
+    deep-eq {}, map id, {}
+
+  test 'mapping over object' ->
+    deep-eq {a:2, b:4}, map (* 2), {a:1, b:2}
+
+  test 'curried' ->
+    f = map (* 2)
+    deep-eq {a:2, b:4}, f {a:1, b:2}
+
+suite 'compact' ->
+  test 'empty object as input' ->
+    deep-eq {}, compact {}
+
+  test 'compacting object' ->
+    deep-eq {b: 1, e: 'ha'}, compact {a: 0, b: 1, c: false, d: '', e: 'ha'}
+
+suite 'filter' ->
+  test 'empty object as input' ->
+    deep-eq {}, filter id, {}
+
+  test 'filtering object' ->
+    deep-eq {b: 2}, filter (== 2), {a:1, b:2}
+
+  test 'curried' ->
+    f = filter (== 2)
+    deep-eq {b: 2}, f {a:1, b:2}
+
+suite 'reject' ->
+  test 'empty object as input' ->
+    deep-eq {}, reject id, {}
+
+  test 'reject object' ->
+    deep-eq {a: 1}, reject (==2), {a:1, b:2}
+
+  test 'curried' ->
+    f = reject (== 2)
+    deep-eq {a: 1}, f {a:1, b:2}
+
+suite 'partition' ->
+  test 'empty object as input' ->
+    deep-eq [{}, {}], partition id, {}
+
+  test 'partition object' ->
+    deep-eq [{b: 2}, {a: 1, c: 3}], partition (==2), {a:1, b:2, c:3}
+
+  test 'curried' ->
+    f = partition (== 2)
+    deep-eq [{b: 2}, {a: 1, c: 3}], f {a:1, b:2, c:3}
+
+suite 'find' ->
+  test 'empty object as input' ->
+    eq void, find id, {}
+
+  test 'find from object' ->
+    eq 2, find (==2), {a:1, b:2}
+
+  test 'curried' ->
+    f = find (== 2)
+    eq 2, f {a:1, b:2}
diff --git a/test/Str.ls b/test/Str.ls
new file mode 100644
index 0000000..107248a
--- /dev/null
+++ b/test/Str.ls
@@ -0,0 +1,259 @@
+{
+  id
+  Str: {
+    split, join, lines, unlines, words, unwords, chars, unchars, empty, reverse
+    repeat, capitalize, camelize, dasherize
+    slice, take, drop, split-at, take-while, drop-while, span, break-str
+  }
+} = require '..'
+{strict-equal: eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'split' ->
+  test 'empty string as input' ->
+    deep-eq [], split '' ''
+
+  test 'string of some length' ->
+    deep-eq <[ 1 2 3 ]>, split '|' '1|2|3'
+
+  test 'curried' ->
+    f = split '|'
+    deep-eq <[ 1 2 3 ]>, f '1|2|3'
+
+suite 'join' ->
+  test 'empty list as input' ->
+    eq '' join '', []
+
+  test 'list as input' ->
+    eq '1,2,3', join ',' [1 2 3]
+
+  test 'empty string as seperator' ->
+    eq '123', join '' [1 2 3]
+
+  test 'curried' ->
+    f = join ','
+    eq '1,2,3', f [1 2 3]
+
+suite 'lines' ->
+  test 'empty string as input' ->
+    deep-eq [], lines ''
+
+  test 'string as input' ->
+    deep-eq <[ one two three ]>, lines 'one\ntwo\nthree'
+
+suite 'unlines' ->
+  test 'empty array as input' ->
+    eq '', unlines []
+
+  test 'array as input' ->
+    eq 'one\ntwo\nthree', unlines [\one \two \three]
+
+suite 'words' ->
+  test 'empty string as input' ->
+    deep-eq [], words ''
+
+  test 'string as input' ->
+    deep-eq <[ what is this ]>, words 'what   is  this'
+
+suite 'unwords' ->
+  test 'empty array as input' ->
+    eq '', unwords []
+
+  test 'array as input' ->
+    eq 'what is this', unwords [\what \is \this]
+
+suite 'chars' ->
+  test 'empty string as input' ->
+    deep-eq [], chars ''
+
+  test 'string as input' ->
+    deep-eq <[ h e l l o ]>, chars 'hello'
+
+suite 'unchars' ->
+  test 'empty array as input' ->
+    eq '', unchars []
+
+  test 'array as input' ->
+    eq 'there', unchars ['t', 'h', 'e', 'r', 'e']
+
+suite 'empty' ->
+  test 'empty string as input' ->
+    ok empty ''
+
+  test 'string as input' ->
+    ok not empty 'a'
+
+suite 'reverse' ->
+  test 'empty string as input' ->
+    eq '', reverse ''
+
+  test 'a string' ->
+    eq 'cba', reverse 'abc'
+    eq 'olleh', reverse 'hello'
+
+suite 'repeat' ->
+  test 'zero times' ->
+    eq '' repeat 0 'hi'
+
+  test 'empty string as input' ->
+    eq '', repeat 2 ''
+
+  test 'a string several times' ->
+    eq 'aa', repeat 2 'a'
+    eq 'hihihi', repeat 3 'hi'
+    eq 'hihihihihihihihihihi', repeat 10 'hi'
+
+  test 'curried' ->
+    f = repeat 2
+    eq 'aa', f 'a'
+
+
+suite 'capitalize' ->
+  test 'empty string as input' ->
+    eq '', capitalize ''
+
+  test 'basic' ->
+    eq 'Foo', capitalize 'foo'
+
+suite 'camelize' ->
+  test 'empty string as input' ->
+    eq '', camelize ''
+
+  test 'no change' ->
+    eq 'fooBar', camelize 'fooBar'
+
+  test 'dashes' ->
+    eq 'fooBar', camelize 'foo-bar'
+
+  test 'underscore' ->
+    eq 'fooBar', camelize 'foo_bar'
+
+  test 'ending dash' ->
+    eq 'fooBar', camelize 'foo-bar-'
+
+  test 'more than one' ->
+    eq 'fooBar', camelize 'foo--bar'
+
+suite 'dasherize' ->
+  test 'empty string as input' ->
+    eq '', dasherize ''
+
+  test 'no change' ->
+    eq 'foo-bar', dasherize 'foo-bar'
+
+  test 'basic' ->
+    eq 'foo-bar', dasherize 'fooBar'
+
+  test 'with numbers' ->
+    eq 'f1-bar', dasherize 'f1Bar'
+
+  test 'repeated capitals' ->
+    eq 'set-JSON', dasherize 'setJSON'
+
+  test 'starting with capital' ->
+    eq 'foo-bar', dasherize 'FooBar'
+
+  test 'starting with repeated capitals' ->
+    eq 'JSON-get', dasherize 'JSONget'
+
+suite 'slice' ->
+  test 'zero to zero' ->
+    eq '', slice 0 0 'hello'
+
+  test 'empty string as input' ->
+    eq '', slice  2 3 ''
+
+  test 'parts' ->
+    eq 'll', slice 2 4 'hello'
+
+  test 'curried' ->
+    f = slice 2
+    eq 'll', f 4 'hello'
+
+    g = slice 2 4
+    eq 'll', g 'hello'
+
+suite 'take' ->
+  test 'empty string as input' ->
+    eq '', take 3 ''
+
+  test 'zero on string' ->
+    eq '', take 0 'abcde'
+
+  test 'string' ->
+    eq 'ab', take 2 'abcde'
+
+  test 'curried' ->
+    f = take 2
+    eq 'ab', f 'abcde'
+
+suite 'drop' ->
+  test 'empty string as input' ->
+    eq '', drop 3 ''
+
+  test 'zero on string' ->
+    eq 'abcde', drop 0 'abcde'
+
+  test 'string' ->
+    eq 'cde', drop 2 'abcde'
+
+  test 'curried' ->
+    f = drop 2
+    eq 'cde', f 'abcde'
+
+suite 'split-at' ->
+  test 'empty string as input' ->
+    deep-eq ['', ''], split-at 3 ''
+
+  test 'zero on string' ->
+    deep-eq ['', 'abcde'], split-at 0 'abcde'
+
+  test 'string' ->
+    deep-eq ['ab', 'cde'], split-at 2 'abcde'
+
+  test 'curried' ->
+    f = split-at 2
+    deep-eq ['ab', 'cde'], f 'abcde'
+
+suite 'take-while' ->
+  test 'empty string as input' ->
+    eq '', take-while id, ''
+
+  test 'string' ->
+    eq 'mmmmm', take-while (is 'm'), 'mmmmmhmm'
+
+  test 'curried' ->
+    f = take-while (is 'm')
+    eq 'mmmmm', f 'mmmmmhmm'
+
+suite 'drop-while' ->
+  test 'empty string as input' ->
+    eq '', drop-while id, ''
+
+  test 'string' ->
+    eq 'hmm', drop-while (is \m), 'mmmmmhmm'
+
+  test 'curried' ->
+    f = drop-while (is \m)
+    eq 'hmm', f 'mmmmmhmm'
+
+suite 'span' ->
+  test 'empty string as input' ->
+    deep-eq ['', ''], span id, ''
+
+  test 'string' ->
+    deep-eq ['mmmmm', 'hmm'], span (is \m), 'mmmmmhmm'
+
+  test 'curried' ->
+    f = span (is \m)
+    deep-eq ['mmmmm', 'hmm'], f 'mmmmmhmm'
+
+suite 'break-str' ->
+  test 'empty string as input' ->
+    deep-eq ['', ''], break-str id, ''
+
+  test 'string' ->
+    deep-eq ['mmmmm', 'hmm'], break-str (is \h), 'mmmmmhmm'
+
+  test 'curried' ->
+    f = break-str (is \h)
+    deep-eq ['mmmmm', 'hmm'], f 'mmmmmhmm'
diff --git a/test/browser.html b/test/browser.html
new file mode 100644
index 0000000..2902ad8
--- /dev/null
+++ b/test/browser.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<script src="../browser/prelude-browser.js"></script>
+<script>
+  window.prelude = require('prelude-ls');
+</script>
diff --git a/test/index.ls b/test/index.ls
new file mode 100644
index 0000000..2a15bb2
--- /dev/null
+++ b/test/index.ls
@@ -0,0 +1,53 @@
+{id, is-type, replicate, VERSION} = require '..'
+{strict-equal: eq, deep-equal: deep-eq, ok} = require 'assert'
+
+suite 'library' ->
+  test 'version' ->
+    eq VERSION, (require '../package.json').version
+
+suite 'id' ->
+  test 'number' ->
+    eq 5, id 5
+
+  test 'object is the same' ->
+    obj = {}
+    eq obj, id obj
+
+suite 'is-type' ->
+  test 'literals' ->
+    ok is-type 'Undefined' void
+    ok is-type 'Boolean' true
+    ok is-type 'Number' 1
+    ok is-type 'Number' 1.2
+    ok is-type 'String' 'asdfa'
+    ok is-type 'Object' {}
+    ok is-type 'Array' []
+
+    ok not is-type 'Boolean' 1
+
+  test 'constructors' ->
+    ok is-type 'Date' new Date
+
+  test 'classes' ->
+    class A
+
+    ok is-type 'Object' new A
+
+  test 'curried' ->
+    f = is-type 'Boolean'
+    ok f true
+
+suite 'replicate' ->
+  test 'zero as input' ->
+    deep-eq [], replicate 0 0
+    deep-eq [], replicate 0 'a'
+
+  test 'number as input' ->
+    deep-eq [3,3,3,3], replicate 4 3
+
+  test 'string as input' ->
+    deep-eq <[ a a a a ]>, replicate 4 'a'
+
+  test 'curried' ->
+    f = replicate 4
+    deep-eq [3,3,3,3], f 3

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-prelude-ls.git



More information about the Pkg-javascript-commits mailing list