We discussed in the iterators lesson how Python iterators relate to Haskell lists. If you’re familiar with the
itertools module, these next few lessons are to help you get started quickly with Haskell’s
Data.List module. We will also discuss a few of Python’s built-in functions.Python built-in functions All of the functions that we discuss here return iterators.
In all of the Python code examples, we assume that everything from
itertools is imported:
We’ll start by introducing
itertools.islice because we’ll need to use
islice to demonstrate some of the other