Created
May 23, 2011 23:45
-
-
Save flazz/987878 to your computer and use it in GitHub Desktop.
ruby lambda composition (for v1.9)
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
# compose lambdas f & g | |
# (f << g).(x) | |
class Proc | |
def <<(g) | |
-> x { self.(g.(x)) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment