Add a functional style map–reduce sequential version.