MonadZip for Data.Tree

wren romano winterkoninkje at
Sun Jan 8 05:27:12 UTC 2017

On Thu, Dec 29, 2016 at 10:54 PM, Edward Kmett <ekmett at> wrote:
> As for what I have against munzip as a member, it is a boring, unnecessary
> member with no interesting definitions. It has to be equivalent to fmap fst
> &&& fmap snd to pass the laws and free theorems involved.

The one nice thing is that munzip can perform (fmap fst &&& fmap snd)
in a single pass, rather than taking two passes. This is why we have
all those combined functions in containers like insertLookup,
updateLookup, etc. Though, yes, I'd much rather have a more generic
version which works for any pair/set of functions rather than
hardcoding (fst,snd).

Live well,

More information about the Libraries mailing list