Data.Map.unzip?

David Feuer david.feuer at gmail.com
Fri Dec 5 22:17:04 UTC 2014


On Dec 5, 2014 5:09 PM, "Eric Mertens" <emertens at gmail.com> wrote:
>
> Would it be significantly better than just having/using the following
definition?
>
> unzipF :: Functor f => f (a, b) -> (f a, f b)
> unzipF x = (fmap fst x, fmap snd x)

It probably depends on how it's being used. Your way potentially does two
passes, and may keep some things live longer than necessary.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141205/72114dae/attachment.html>


More information about the Libraries mailing list