public function __construct(callable $mapFn = null) { if (is_null($mapFn)) { $this->mapFn = $this->identity(); } else { $this->mapFn = $mapFn; } }