Skip to content

Commit

Permalink
added keys and partial funcs, build all
Browse files Browse the repository at this point in the history
  • Loading branch information
gkz committed Jun 11, 2012
1 parent 9c49801 commit a985ffc
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion prelude-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion prelude.js
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2012 George Zahariev
// Released under the MIT License
// raw.github.com/gkz/prelude-ls/master/LICNSE
var objToFunc, each, map, filter, reject, find, pluck, head, tail, last, initial, empty, values, length, cons, append, join, reverse, foldl, fold, foldl1, fold1, foldr, foldr1, andList, orList, any, all, unique, sum, product, average, mean, concat, concatMap, listToObj, maximum, minimum, scanl, scan, scanl1, scan1, scanr, scanr1, replicate, take, drop, splitAt, takeWhile, dropWhile, span, breakIt, elem, notElem, lookup, call, zip, zipWith, compose, id, flip, lines, unlines, words, unwords, max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, log, pow, sin, tan, cos, asin, atan, atan2, acos, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm, __toString = {}.toString, __slice = [].slice;
var objToFunc, each, map, filter, reject, find, pluck, head, tail, last, initial, empty, values, keys, length, cons, append, join, reverse, foldl, fold, foldl1, fold1, foldr, foldr1, andList, orList, any, all, unique, sum, product, average, mean, concat, concatMap, listToObj, maximum, minimum, scanl, scan, scanl1, scan1, scanr, scanr1, replicate, take, drop, splitAt, takeWhile, dropWhile, span, breakIt, elem, notElem, lookup, call, zip, zipWith, compose, partial, id, flip, lines, unlines, words, unwords, max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, log, pow, sin, tan, cos, asin, atan, atan2, acos, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm, __toString = {}.toString, __slice = [].slice;
exports.objToFunc = objToFunc = function(obj){
return function(key){
return obj[key];
Expand Down Expand Up @@ -175,6 +175,13 @@ exports.values = values = function(obj){
}
return __results;
};
exports.keys = keys = function(obj){
var x, __results = [];
for (x in obj) {
__results.push(x);
}
return __results;
};
exports.length = length = function(xs){
if (__toString.call(xs).slice(8, -1) === 'Object') {
xs = values(xs);
Expand Down Expand Up @@ -492,6 +499,15 @@ exports.compose = compose = function(){
return args[0];
};
};
exports.partial = partial = function(f){
var initArgs;
initArgs = __slice.call(arguments, 1);
return function(){
var args;
args = __slice.call(arguments);
return f.apply(this, (initArgs).concat(args));
};
};
exports.id = id = function(x){
return x;
};
Expand Down

0 comments on commit a985ffc

Please sign in to comment.