consider this code
def fx, y x + y end g = lambda(&method(:f)).curry.(1) g.(2) # => 3
the expression for g too hard to read. Can this be simplified?
g
I think the shortest (and most readable!) You can get is
g = method(:f).to_proc.curry[1] g[2] # => 3
If you are using Ruby 2.2.0 or later, you can use the # curry method :
def f(x, y) x + y end g = method(:f).curry[1] pg[2] # => 3