Pure vs. impure iterators in Go

TL;DR ¶ Go has now standardised iterators. Iterators are powerful. Being functions under the hood, iterators can be closures. The classification of iterators suggested by the documentation is ambiguous. Dividing iterators into two categories, &ldquo;pure&rdquo; and &ldquo;impure&rdquo;, seems to me preferrable. Whether iterators should be designed as &ldquo;pure&rdquo; whenever possible is…