#75 and #87 covered most of this. Already generators: cycle, iterate,
range, repeat.
Remaining:
Where a generator would break existing consumers, keep the eager version and
add a *-suffixed generator sibling rather than changing the return type.
The replicate mis-tick is what prompted #125.
#75 and #87 covered most of this. Already generators:
cycle,iterate,range,repeat.Remaining:
replicate— still eager (Array(n).fill(x, 0, n)returnsT[], inpackages/fjl/src/list/replicate.ts). next:iterate,repeat,replicate, andcyclemethods should just be generators #75 marked this done, but it wasnever converted.
unfoldr— accumulates intoconst out = [] as A[]and returnsA[](
packages/fjl/src/list/unfoldr.ts); a generator lets callers stop early.scanl/scanl1/scanr/scanr1andzip*/unzip*, and recordwhich should stay eager. A documented decision counts as done.
Where a generator would break existing consumers, keep the eager version and
add a
*-suffixed generator sibling rather than changing the return type.The
replicatemis-tick is what prompted #125.