Currying and map-reduce