VimUnDopz]-.dv<%v0V;iq8 # Examples&P_Pp5_Pu(0exports.curry = function curry(target, length) {5_Pz(9module.exports = curry = function curry(target, length) {5_P})module.exports = curry5_P,+5_!P,5_"-P!#-C var rest = args.concat(Array.prototype.slice.call(arguments))5_ ""P!#-3 var rest = args.concat(slice.call(arguments))5_ P!.!-5_ P!. arity = arity || target.length5_ P!. arity = arity || f.length5_    vP. function curry(target, length) {5_    vPn. function curry(lambda, length) {5_   vPq  arity = arity || lambda.length5_,  vPw+--) })(target, length || target.length, [])5_,  vPy+--( })(target, arity || target.length, [])5_,   vP{+--( })(target, arity || lambda.length, [])5_  vP.-5_! ! -vP ". 2 return (function currier(target, length, args) { return function curried() {4 var rest = args.concat(slicer.call(arguments))1 // If all expected arguments are collected,& return (rest.length >= length ||L // or infinite number of arguments is expected and function was called // without arguments,@ (Infinity === length && arguments.length === 0)) ?P // carried function is invoked with all the arguments collected. OtherwiseK // new curried function is returned to continue collecting arguments.F target.apply(this, rest) : currier(target, length, rest) }( })(lambda, arity || lambda.length, [])5_! ! vP"function5_ 11v1P. 2function (function currier(target, length, args) { return function curried() {4 var rest = args.concat(slicer.call(arguments))1 // If all expected arguments are collected,& return (rest.length >= length ||L // or infinite number of arguments is expected and function was called // without arguments,@ (Infinity === length && arguments.length === 0)) ?P // carried function is invoked with all the arguments collected. OtherwiseK // new curried function is returned to continue collecting arguments.F target.apply(this, rest) : currier(target, length, rest) } })5_!  1v1P.2function (function currier(target, length, args) {5_ "!1v1P.5_!#"1v1P/})5_"$#1v1P/5_#%$1v1P0(function currier(target, length, args) {5_$'%1v1P0(function currier(lambda, length, args) {5_%)&'$1v1P0'function currier(lambda, arity, args) {5_'*() 1v1P 02 var rest = args.concat(slicer.call(arguments))5_)+* !1v1P 0$ return (rest.length >= length ||5_*,+ 1v1P 0> (Infinity === length && arguments.length === 0)) ?5_+-, : v P 0= (Infinity === arity && arguments.length === 0)) ?5_,.- #: v P 0# return (rest.length >= arity ||5_-/.: v P 1  05_.0/ : v P 1 var input = slicer.call()5_/10 D: v P 1S return (rest.length >= arity || (Infinity === arity && arguments.length === 0))5_021 3: v P 14 var rest = params.concat(slicer.call(arguments))5_132  vP 1J // or infinite number of arguments is expected and function was called // without arguments, ?5_243 / vP // // If all expected arguments are collected,5_354 7vP 1z // If all expected arguments are collected, // or infinite number of arguments is expected and function was called5_465 PvP# 1s // If all expected arguments are collected, or infinite number of arguments is expected and function was called5_576 vP$ 2* // is expected and function was calledwithout arguments, 2 // without arguments,5_687 vP'  5_798 =vP( 0= // is expected and function was called without arguments,5_8:9 vP* 0O return (rest.length >= arity || (Infinity === arity && input.length === 0))? 0 ?5_9;: ; O OvP/ /Q return (rest.length >= arity || (Infinity === arity && input.length === 0)) ?5_:<; N O OvP1 /R return (rest.length >= arity || (Infinity === arity && !input.length === 0)) ?5_;=<  O OvP6/D target.apply(this, rest) : currier(target, length, rest)5_<>= O OvP;/C target.apply(this, rest) : currier(target, length, rest)5_=?>& O OvPA/C lambda.apply(this, rest) : currier(target, length, rest)5_>@? O OvPC0( currier(target, length, rest)5_?A@! O OvPG0( currier(lambda, length, rest)5_@BA/  vP^.00- return (lambda, arity || lambda.length, [])5_ACB/ vPa.006 return currier()(lambda, arity || lambda.length, [])5_BDC vPk0function curry(lambda, arity) {5_CED vPl0function curry(lambda, arity) {5_DFE/3 vP.004 return currier(lambda, arity || lambda.length, [])5_EGF # vP 1  05_FHG  vP 1 if ()5_GIH  vP 1 if (params)5_HJI  vP 1 if (params) input.unshift()5_IKJ $ vP 1% if (params) input.unshift.apply()5_JLK  vP  # var rest = params.concat(input)5_KML   2vP 0L return (rest.length >= arity || (Infinity === arity && !input.length)) ?5_LNM %  2vP 1  05_MON   2vP 1 var passed = input.length5_NPO   2vP 1! var passed = input.length > 05_OQP "  2vP 1$ var terminate = input.length > 05_PRQI  vP 1M return (input.length >= arity || (Infinity === arity && !input.length)) ?5_QSR &  vP 1& var terminate = input.length === 05_RUS &7v7P 1' var terminate = input.length === 0 5_SVTU &7v7P 1= var terminate = Infinity === arity && input.length === 0 5_UWV &7v7P 1< var exectuen = Infinity === arity && input.length === 0 5_VXW &7v7P 1; var exectue = Infinity === arity && input.length === 0 5_WYX &7v7P 1< var executue = Infinity === arity && input.length === 0 5_XZYF&7v7P 1I return (input.length >= arity || (Infinity === arity && terminate)) ?5_Y[Z " v P%1% lambda.apply(this, rest) :5_Z\[/" v P' 1/ return (input.length >= arity || execute) ?5_[]\H" v P( 1H return (input.length >= arity || execute) ? lambda.apply(this, rest)5_\^] " v P- :5_]_^G" v P7 0J return (input.length >= arity || execute) ? lambda.apply(this, rest) :5_^`_&" v P;0' currier(lambda, arity, rest)5__a`" v PG 1  05_`ba " v Po 3 if 5_acb /" v P 3/ if desired arguments have being collected. 5_bdc " v P 45_ced M" v P  5  45_dfe " v P 6  55_egf" v P 6 5_fhg" v P7 65_gih" v P7 // 5_hji" v P7 // Trigger function 5_ikj*" v P7* // Function will be executed function 5_jlk$" v P7$ // Function will be executed if 5_kml," v P7, // Function will be executed if curried 5_lnm$" v P9 85_mon" v P9 // 5_npo" v P-9O // If all expected arguments are collected, or infinite number of arguments5_oqp." v P29Y // If all expected number of arguments are collected, or infinite number of arguments5_prq_" v P49_ // If all expected number of arguments has being collected, or infinite number of arguments5_qsr" v PP= // is expected and function was called without arguments.5_rts" v PR: 95_sut" v PV: // Otherwise 5_tvu" v PX: // Otherwise 5_uwv" v PbN // carried function is invoked with all the arguments collected. Otherwise5_vxw" v Pc I // new curried function is returned to continue collecting arguments.5_wyx " v Pg 8( // Otherwise continue curried.5_xzy " v Pu 80 Returns curried version of the given function.5_y{z(" v Pz 8G Returns function with implicit curried version of the given function.5_z|{H" v P~"8H Returns function with implicit currying version of the given function.5_{}|! " v P ": determined by `lambda.length` 5_|~}!." v P $:. determined by `lambda.length` unless it's 0.5_}~# " v P"$< Optionally 5_~#" v P"$<& Optionally `arity` can be overrided 5_#" v P"$<1 Optionally `arity` of curride can be overrided 5_#" v P"$<0 Optionally `arity` of curide can be overrided 5_#" v P "$<1 Optionally `arity` of curride can be overrided 5_# " v P "$<2 Optionally `arity` of curriede can be overrided 5_##" v P"$<1 Optionally `arity` of curried can be overrided 5_#," v P"$<7 Optionally `arity` of curried arguments be overrided 5_#1" v P"$; Optionally `arity` of curried arguments can be overrided 5_#<" v P"%<< Optionally `arity` of curried arguments can be overridden 5_$ " v P& #%= argument.5_%" v P)$% @param {Function} target5_%" v P)$% Function to curry.5_%" v P*$%2 @param {Number} [length=target.length||Infinity]5_%" v P*$%K Number of argument to curry. If not provided length of target function5_%" v P*$%K is used by default unless it's 0, in such case length will be infinity5_%" v P+$%M and function curry will stop once currier is executed without arguments.5_$" v P,$&75_&" v P-%'8 @examples5_&" v P0%'8 # examples5_&" v P%'8 # Examples5_8" v P>898:7:}5_7/" v PF688< return currier(lambda, arity || lambda.length || Infinity)5_" v PY98 "use strict";"var slicer = Array.prototype.slicemodule.exports = curry%function currier(λ, arity, params) { return function curried() { /**K Function either continues curring of the arguments or executes functionN if desired arguments have being collected. If function curried is variadicN then execution without arguments will finish curring and trigger function. **/& var input = slicer.call(arguments)L // Function will be executed if curried function is variadic and this is% // invoked without any arguments.; var execute = Infinity === arity && input.length === 0 < // Prepend all curried arguments to the given arguments.2 if (params) input.unshift.apply(input, params)N // If all expected number of arguments has being collected, or if functionP // is variadic and no arguments have being passed invoke a curried function.G return (input.length >= arity || execute) ? λ.apply(this, input) :) // Otherwise continue curried.$ currier(λ, arity, input) }}function curry(λ, arity) { /**M Returns function with implicit currying, which will continue currying untilK expected number of argument is collected. Expected number of arguments isI determined by `λ.length` unless it's 0. In later case function will beN assumed to be variadic and will be curried until invoked with `0` arguments.N Optionally `arity` of curried arguments can be overridden via second `arity` argument. # Examples% var sum = curry(function(a, b) { return a + b }) console.log(sum(2, 2)) // 4 console.log(sum(2)(4)) // 6! var sum = curry(function() {L return Array.prototype.reduce.call(arguments, function(sum, number) { return sum + number }, 0) })" console.log(sum(2, 2)()) // 4, console.log(sum(2, 4, 5)(-3)(1)()) // 9 **/4 return currier(λ, arity || λ.length || Infinity)}5_SUT &7v7P 17 var end = Infinity === arity && input.length === 0 5_')( 1v1P 02 var args = args.concat(slicer.call(arguments))5_%'&$1v1P0)function currier(lambda, arity, params) {5_    vP.function curry(lambda, arity) {5_    vP !.5_!  vP "/ param = []5_"  vP !#5_-,"vP,.5_","vP!--  return function curried() {2 var rest = args.concat(slicer.call(arguments))/ // If all expected arguments are collected,$ return (rest.length >= length ||J // or infinite number of arguments is expected and function was called // without arguments,> (Infinity === length && arguments.length === 0)) ?N // carried function is invoked with all the arguments collected. OtherwiseI // new curried function is returned to continue collecting arguments.D target.apply(this, rest) : currier(target, length, rest) }5_!,"vP "- var param = []5_#,"vP*"$-4 var rest = params.concat(slicer.call(arguments))5_! ,"vP> "- var params = []5_+,"vPZ*,-D lambda.apply(this, rest) : currier(target, length, rest)5