Skip to content

Instantly share code, notes, and snippets.

@mbj
Created November 28, 2014 00:30
Show Gist options
  • Save mbj/fa6d60c9e94be5e0ba5f to your computer and use it in GitHub Desktop.
Save mbj/fa6d60c9e94be5e0ba5f to your computer and use it in GitHub Desktop.
curry
irb(main):018:0> def foo(a, b)
irb(main):019:1> "#{a}-#{b}"
irb(main):020:1> end
=> :foo
irb(main):021:0> [1,2,3].map(&self.method(:foo).to_proc.curry[2])
=> ["2-1", "2-2", "2-3"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment