Created
November 3, 2016 21:30
-
-
Save ajm188/a86dc29946488442aec8da4d0a911f3a to your computer and use it in GitHub Desktop.
This file contains 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
def compose(*functions): | |
assert functions | |
def f(*args, **kwargs): | |
return reduce(functions[1:], __call__, functions[0](*args, **kwargs)) | |
return f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment