[Issue 13473] std.algorithm.expand

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 31 14:47:55 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=13473

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12 at gmail.com

--- Comment #3 from Seb <greensunny12 at gmail.com> ---
> Aren't all cases of "expand" reducible to "recurrence"? Do you have an example where this isn't possible / is too ugly?

The closest pedant that D has to unfoldr (apart from recurrence) is its
Generator:

---
import std.experimental.all;
void main()
{
    new Generator!int({
        foreach (i; 0 .. 10)
            yield(i);
    }).writeln;
}
---

https://run.dlang.io/is/DQgDN3

So I'm not sure if there's anything actionable to be taken from this issue?

--


More information about the Digitalmars-d-bugs mailing list