def takeWhile(): return Sequence.iterate(1, lambda k: k * 2).take_while(lambda k: k < 20) def skipWhile(): return Sequence.range(0, 10).skip_while(lambda k: k < 6)
def iterate(): return Sequence.iterate(0, lambda k: k + 1, lambda k: k < 5) def empty(): return Sequence.empty()
def take(): return Sequence.iterate(0, lambda k: k + 2).take(6) def skip(): return Sequence.range(0, 6).skip(3)