private function _groupBy(&$result, $k, $v, $func)
    {
        if ($v instanceof self) {
            foreach ($v->each() as $kk => $vv) {
                $this->_groupBy($result, $kk, $vv, $func);
            }
        } else {
            $aggregate_key = call_user_func($func, $v, $k);
            $result[$aggregate_key][] = $v;
        }
    }