function chain(\Closure $func, $default = null)
    {
        $i    = 0;
        $prev = $default;
        foreach ($this->getIterator() as $key => $val) {
            if ($i++ !== 0)
                $prev = $func($val, $key, $prev);
            else
                // use default value of argument of given closure
                $prev = $func($val, $key);

        }

        return $prev;
    }