Created
November 28, 2014 00:30
-
-
Save mbj/fa6d60c9e94be5e0ba5f to your computer and use it in GitHub Desktop.
curry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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