Ruby blocks can be curried
This can be done with Proc#curry
:
add = proc { |x, y| x + y }
add3 = add.curry[3] # add3 is a new Proc
add3[5] # 8
This can be done with Proc#curry
:
add = proc { |x, y| x + y }
add3 = add.curry[3] # add3 is a new Proc
add3[5] # 8