src/fn/Map.php
public function limit($limit, $offset = 0): self
    {
        $from = max($offset, 0);
        $to   = $from + max($limit, 0);
        return $this->then(function($value) use($from, $to) {
            static $count = 0;
            if ($count < $from) {
                $value = null;
            } else if ($to > 0 && $count >= $to) {
                $value = mapBreak();
            }
            $count++;
            return $value;
        });
    }
public function limit($limit, $offset = 0): self
    {
        $from = max($offset, 0);
        $to   = $from + max($limit, 0);
        return $this->then(function($value) use($from, $to) {
            static $count = 0;
            if ($count < $from) {
                $value = null;
            } else if ($to > 0 && $count >= $to) {
                $value = mapBreak();
            }
            $count++;
            return $value;
        });
    }
@param int $limit
@param int $offset

@return static