Open dlangBugzillaToGithub opened 10 years ago
Aren't all cases of "expand" reducible to "recurrence"? Do you have an example where this isn't possible / is too ugly?
(In reply to hsteoh from comment #1)
> Aren't all cases of "expand" reducible to "recurrence"? Do you have an
> example where this isn't possible / is too ugly?
I think the functionality of recurrence is a superset of the functionality of this function expand. But expand looks more fundamental and cleaner.
> 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?
bearophile_hugs reported this on 2014-09-14T12:20:45Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=13473
CC List
Description