MonadZip for Data.Tree

David Feuer david.feuer at gmail.com
Thu Dec 29 21:54:59 UTC 2016


MonadZip doesn't really explain how strict mzipWith and (especially)
munzip should be. For example, we could have

  munzip (Node (a, b) ts) = (Node a as, Node b bs)
    where (as, bs) = Data.List.unzip (map munzip ts)

or we could make some or all of the pattern matches lazy, or we could
use something lazier than Data.List.unzip, or we could make everything
completely spine-strict (surely unwise).

Does anyone have a particular preference, or a particular reason to
prefer one choice over others? If not, I think we should go with the
simple version above.

David Feuer


More information about the Libraries mailing list