Data.Functor.unzipF (Was: Data.Map.unzip?)
Joachim Breitner
mail at joachim-breitner.de
Sat Dec 6 10:46:46 UTC 2014
Hi,
right, any any other container having special requirements on the contained type, e.g. Data.Set.
Greetings,
Joachim
Am 6. Dezember 2014 03:18:09 MEZ, schrieb John Lato <jwlato at gmail.com>:
>Data.Vector.Unboxed.Vector is unzippable and not a Functor. That's the
>only case I can think of now.
>
>On 15:24, Fri, Dec 5, 2014 David Feuer <david.feuer at gmail.com> wrote:
>
>> Oh, you're right, there probably isn't anything unzippable that's not
>a
>> functor, unless you go really wild. So could we just add unzip to the
>> Functor class?
>> On Dec 5, 2014 5:49 PM, "Joachim Breitner" <mail at joachim-breitner.de>
>> wrote:
>>
>>> Hi,
>>>
>>>
>>> Am Freitag, den 05.12.2014, 17:38 -0500 schrieb David Feuer:
>>>
>>> >
>>> > Am Freitag, den 05.12.2014, 14:09 -0800 schrieb Eric
>Mertens:
>>> > > 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)
>>> >
>>> > yes, I guess that would be sufficient. Something for
>>> > Data.Functor?
>>> >
>>> > This looks like it should be the default implementation of an
>>> > Unzippable class, rather than a standalone function.
>>> >
>>>
>>> Clearly, every Functor isunzippable.
>>>
>>> What do you expect to be Unzippable that is not a functor?
>>>
>>> Or are you worried about performance, and allow better
>implementations?
>>> Then I hope we can do that without touching the desired API, e.g.
>using
>>> RULEs.
>>>
>>> Greetings,
>>> Joachim
>>>
>>> --
>>> Joachim “nomeata” Breitner
>>> mail at joachim-breitner.de • http://www.joachim-breitner.de/
>>> Jabber: nomeata at joachim-breitner.de • GPG-Key: 0xF0FBF51F
>>> Debian Developer: nomeata at debian.org
>>>
>>>
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://www.haskell.org/mailman/listinfo/libraries
>>>
>>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
More information about the Libraries
mailing list