Skip to content

Instantly share code, notes, and snippets.

@bohde
Created February 7, 2012 06:16
Show Gist options
  • Select an option

  • Save bohde/1757619 to your computer and use it in GitHub Desktop.

Select an option

Save bohde/1757619 to your computer and use it in GitHub Desktop.
from itertools import takewhile
def combinator_style(xs):
return Combinators(xs).chain().R(
takewhile, lambda x: x < 7
).R(
filter, lambda x: x < 2
).R(
map, lambda x: 4 * x
).value()
assert combinator_style(range(10)) == [0, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment