function curry(func) {
  var argsLength = func.length;

  function given(argsSoFar) {
    return function _curry() {
      for (var _len8 = arguments.length, params = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
        params[_key8] = arguments[_key8];
      }

      var passedArgsSoFar = argsSoFar.concat(params);
      var result;

      if (passedArgsSoFar.length >= argsLength) {
        result = func.apply(this, passedArgsSoFar);
      } else {
        result = given(passedArgsSoFar);
      }

      return result;
    };
  }

  return given([]);
}
Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
to the arguments defined in `func` then function will be invoked.
Arguments are added to the stack in direction from the left to the right.

@example
```
var replace = curry(function(find, replace, string) {
  return string.replace(find, replace);
});

// returns function with bounded first argument
var replace = replace('foo')

// returns replaced string - all arguments was passed so function was invoked
replace('bar', 'Some test with foo...');

```

@param {Function} func Function to currying.
@returns {Function}