Code Explainers

Code explainers tagged #procs

ruby
# Curry a multi-argument lambda so it can be applied one argument at a time.
add = ->(a, b, c) { a + b + c }
 
# Proc#curry returns a curried version that collects arguments incrementally.

Currying lambdas and methods in Ruby

currying closures partial-application
Intermediate 7 steps