public function flatten($depth = INF): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($depth) {
            $lowerDepth = $depth === INF ? INF : $depth - 1;
            foreach ($data as $key => $datum) {
                if ($lowerDepth >= 0 && is_iterable($datum)) {
                    $collection = $this::make($datum);

                    foreach ($collection->flatten($lowerDepth)->getIterator() as $item) {
                        yield $item;
                    }
                } else {
                    yield $datum;
                }
            }
        });
    }