Sam

Results 175 comments of Sam

Maybe in some cases distinct would work? http://reactivex.io/documentation/operators/distinct.html (I know this is not related to reactive, many of the concepts from reactive map very well to iterables though)

@nikic I agree that it cannot stream without keeping state. The advantage of having this as a stateful streaming implementation is that it still defers execution and thus memory usage...

This can actually be solved by just passing an invokable filter object to `filter`: For example this should work (untested code): ```php class GreedyArrayHashFilter { private array $history = [];...

Isn't this covered by `slice`? ```php slice($iterable, 15, 1) ```

Some ideas that could be implemented: - [ ] Early error checking; since we don't use generators we can often validate params before iteration starts. - [ ] Have `toIter()`...

@jvasseur can you be more specific? > I'm -1 here, having a fluent interface would be annoying when you need to mix function from this package with your own functions...

@ragboyjr thanks for the examples! I'm not sure I fully agree with the reasoning though. > The issue he's referring to is, let's say you built your own function like...

To extend the example assuming you don't have a clean reference to your function: ```php $fluent->map(...) ->via(function(Fluent $fluent): iterable { return chunkBy($fluent); }) ->slice(1, 6); ``` This ticks all my...

> In the lib I mentioned, the curried functions are automatically generated. We could even omit the functions and just use `__call()`, and then document them via PHPDoc. For me...

Yeah, they do it for static constructors. Anyway, I'm open to any solution for that _problem_, but still we need to decide if this fluent interface is something we want...