A multi-function compose

/ Published in: Python
Save to your folder(s)

Since the version of compose() that ships with functional only allows you to compose two functions, I present this version that composes n functions.

Copy this code and paste it in your HTML
  1. from functional import partial, compose
  3. multi_compose = partial(reduce, compose)

URL: http://oakwinter.com/code/functional/documentation/cookbook.html

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.