Proposal: add unzips for Data.Sequence

David Feuer david.feuer at gmail.com
Fri Jan 12 04:54:29 UTC 2018


We don't strictly *need* to add either of these functions. Users can use
munzip from the MonadZip instance, and we can add a rewrite rule to turn

    munzip (fmap f xs)

into

    Data.Sequence.Internal.unzipWith f xs

On the other hand, MonadZip isn't a terribly well-known class, and
unzipWith has always struck me as an obvious analogue of zipWith.

On Jan 11, 2018 10:32 PM, "Ivan Lazar Miljenovic" <ivan.miljenovic at gmail.com>
wrote:

> On 12 January 2018 at 13:28, David Feuer <david.feuer at gmail.com> wrote:
> > Paolo G. Giarrusso (Blaisorblade) would like to add an unzip function to
> > Data.Sequence. I agree. I propose adding
> >
> >   unzip :: Seq (a,b) -> (Seq a, Seq b)
> >
> >   unzipWith :: (x -> (a, b)) -> Seq x -> (Seq a, Seq b)
> >
> > Does anyone object?
>
> I see no problem with this.  Though I think it's worth pointing out
> that Data.List doesn't have unzipWith (though unzipWith f = unzip .
> map f).
>
> --
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> http://IvanMiljenovic.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180111/ab2abc1a/attachment.html>


More information about the Libraries mailing list