Skip to content

Instantly share code, notes, and snippets.

@tokland
tokland / gist:406204
Created May 19, 2010 11:29
Equivalent implementation in Python of a Haskell code:
#!/usr/bin/python
#
# See http://stackoverflow.com/questions/1016997/generate-from-generators
#
# Equivalent implementation in Python of this Haskell code:
#
# grandKids generation kidsFunc val =
# iterate (concatMap kidsFunc) [val] !! generation
from itertools import chain, islice, imap