Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/0b9c7dbe5f0bbb6a88041f5e77a9f09b to your computer and use it in GitHub Desktop.
Save anonymous/0b9c7dbe5f0bbb6a88041f5e77a9f09b to your computer and use it in GitHub Desktop.
clojure `->`-style functional chaining
"functional chaining, inspired by https://stackoverflow.com/a/17122666/333294"
def chain(initial, func_list):
caller = lambda x, y: y(x)
return reduce(caller, func_list, initial)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment