react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / escodegen / node_modules / optionator / node_modules / prelude-ls / lib / Func.js
80737 views// Generated by LiveScript 1.4.01var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString;2apply = curry$(function(f, list){3return f.apply(null, list);4});5curry = function(f){6return curry$(f);7};8flip = curry$(function(f, x, y){9return f(y, x);10});11fix = function(f){12return function(g){13return function(){14return f(g(g)).apply(null, arguments);15};16}(function(g){17return function(){18return f(g(g)).apply(null, arguments);19};20});21};22over = curry$(function(f, g, x, y){23return f(g(x), g(y));24});25memoize = function(f){26var memo;27memo = {};28return function(){29var args, key, arg;30args = slice$.call(arguments);31key = (function(){32var i$, ref$, len$, results$ = [];33for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {34arg = ref$[i$];35results$.push(arg + toString$.call(arg).slice(8, -1));36}37return results$;38}()).join('');39return memo[key] = key in memo40? memo[key]41: f.apply(null, args);42};43};44module.exports = {45curry: curry,46flip: flip,47fix: fix,48apply: apply,49over: over,50memoize: memoize51};52function curry$(f, bound){53var context,54_curry = function(args) {55return f.length > 1 ? function(){56var params = args ? args.concat() : [];57context = bound ? context || this : this;58return params.push.apply(params, arguments) <59f.length && arguments.length ?60_curry.call(context, params) : f.apply(context, params);61} : f;62};63return _curry();64}6566