public function map(callable $callback) { return new Self(Fp\map($callback, $this->values())); }
public function testMapWithCollection() { $this->assertEquals([1, 4, 9], Fp\map(square_makker(), new Fp\Collection\Collection([1, 2, 3]))->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); }