public function __construct(callable $generator, int|callable $count) { $this->generator = $generator(...); $this->count = \is_int($count) ? $count : $count(...); }