Skip to content

Instantly share code, notes, and snippets.

/chain.py
Created Jan 5, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.