pawaclawczyk / scalp

Some Scala useful classes ported to PHP.
18 stars 1 forks source link

Function currying. #22

Closed pawaclawczyk closed 7 years ago

pawaclawczyk commented 7 years ago

Resolves #21

shadowhand commented 7 years ago

It may also be desirable to have a curryRight function that fills arguments from right to left, for the sake of completeness. One possible example:

$isValid = curryRight('in_array', ['a', 'b', 'c']);

assert($isValid('a') === true);
assert($isValid('x') === false);
pawaclawczyk commented 7 years ago

I will note down the proposition of curryRight, but at this moment I'm not sure about it. I would rather use partial function application.