public static function reduce(array $xs, \Closure $fn, $initial)
    {
        foreach ($xs as $key => $value) {
            $initial = $fn($initial, $key, $value);
        }
        return $initial;
    }