Created
February 17, 2017 01:56
-
-
Save Prodge/f6588725621d3bda5223df98d08c240e to your computer and use it in GitHub Desktop.
Map implementation using reduce in Python
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 my_map(fn, coll): | |
reduce(lambda out, x: out + [fn(x)], coll, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment