Skip to content

Instantly share code, notes, and snippets.

@kvoss
Created December 12, 2013 07:53
Show Gist options
  • Save kvoss/7924571 to your computer and use it in GitHub Desktop.
Save kvoss/7924571 to your computer and use it in GitHub Desktop.
Python: something functional
def zipWith (f, xs, ys):
lf = lambda (a,b) : f(a,b)
args = zip (xs, ys)
rs = map (lf, args)
return rs
def compose (fs):
def f (x):
for f in fs [::-1]:
x = f (x)
return x
return f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment