Results 40 comments of RJ Garcia

@lstrojny regarding auto currying, how hard would it be to just maintain curried versions of certain functions in a separate namespace under `curried` or something similar? `use function Functional\{map, curried\map};

@lstrojny , check out what I’ve done with krakphp/fn. I auto generate curried versions of functions. https://github.com/krakphp/fn

This was also done in krak/fn library: https://github.com/krakphp/fn The constants there are auto generated which make it very easy to keep in sync.

This works as well: ```php function cycle($iterable, $num = INF) { if (is_array($iterable)) { for ($i = 0; $i < $num; $i++) { yield from $iterable; } return; } //...

@vkurdin the to and from Pairs takes care of that. the testCycleIter shows that the keys aren't being lost/overwitten as well.

Y, there's no way around that. Some iters are rewindable, some aren't, but it's impossible to distinguish from the two. So the only way this implementation is to work is...

https://github.com/krakphp/fn/blob/add-psalm-support/src/fn.php#L924

@SamMousa I tend to agree with @jvasseur , I think the only way you could do fluent collection like stuff would be if you provided macros like laravel's collection package...

In the lib I mentioned, the curried functions are automatically generated. So it's an automated process that uses php parser to generate the code. Which is something you could do...

https://github.com/krakphp/fn/blob/master/Makefile#L5 https://github.com/krakphp/fn/blob/master/make-curried.php