One way to implement map-invert

Hi there,

Here's an example for reduce-kv.

Cheers,
Tushar