Skip to content

Instantly share code, notes, and snippets.

@kmerenkov
Created June 21, 2013 05:06
Show Gist options
  • Save kmerenkov/5828983 to your computer and use it in GitHub Desktop.
Save kmerenkov/5828983 to your computer and use it in GitHub Desktop.
Inspired by clojure/comp
fs = [lambda x: x*x, lambda y: y+y, lambda z: str(z)]
comp = lambda fs, arg: reduce(lambda x, y: y(x), fs, arg)
comp(fs, 5) # returns '50', i.e. str((5*5)+(5*5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment