public static function forAverage(callable $num): self {
        return new self(
                function() { return [0, 0]; },
                function(&$result, $arg) use($num) { $result[0] += $num($arg); $result[1]++; },
                function($result) { return $result[0] / $result[1]; }
        );
    }