Skip to content

Instantly share code, notes, and snippets.

@flazz
Created May 23, 2011 23:45
Show Gist options
  • Save flazz/987878 to your computer and use it in GitHub Desktop.
Save flazz/987878 to your computer and use it in GitHub Desktop.
ruby lambda composition (for v1.9)
# 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