public function filter(callable $callback) { return new Self(Fp\filter($callback, $this->values())); }
public function testFilterWithCollection() { $this->assertEquals([2, 4], Fp\filter(is_even_makker(), new Fp\Collection\Collection([1, 2, 3, 4]))->values()); }
public function testTransducing() { $transduced = $this->collection->transduce(Fp\compose(Fp\map(square_makker()), Fp\filter(is_even_makker())), Fp\appending())->values(); $this->assertEquals([4, 16], $transduced); }