diff --git a/README.md b/README.md index c7e575c..8e1736a 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,15 @@ We should explore how to make this more ergonomic and functional. let digits = Iterator.concat(lows, [4, 5], highs); ``` -For the (rare) case of infinite iterators of iterators, use `flatMap` with the identity function. +For the (rare) case of infinite iterators of iterators, use [`Iterator.prototype.flatMap`](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator.prototype.flatmap) with the identity function. ```js -function* p() { +function* selfCountingSequenceHelper() { for (let n = 1;; ++n) { yield Array(n).fill(n); } } -let repeatedNats = p().flatMap(x => x); +let selfCountingSequence = selfCountingSequenceHelper().flatMap(x => x) ``` ## prior art