[Haskell-cafe] Monomorphic containers, Functor/Foldable/Traversable WAS: mapM_ for bytestring

Michael Snoyman michael at snoyman.com
Tue Sep 17 07:48:53 CEST 2013


On Tue, Sep 17, 2013 at 4:25 AM, John Lato <jwlato at gmail.com> wrote:

> On Mon, Sep 16, 2013 at 4:57 AM, Michael Snoyman <michael at snoyman.com>wrote:
>
>>
>> I think I just made a bad assumption about what you were proposing. If I
>> was going to introduce a typeclass like this, I'd want it to support `Set`,
>> since IME it's the most commonly used polymorphic `map` operation that has
>> constraints. (Note that HashMap and Map are in fact Functors, since mapping
>> only affects their values, which are unconstrained.) I don't really have
>> any strong feelings on this topic, just that it would be nice to have *
>> some* kind of a map-like function that worked on Set and HashSet.
>>
>
> Ok, understood.  I most often use this with Data.Vector.Unboxed and
> Data.Vector.Storable, and that it would be useful for Set didn't really
> occur to me.
>
> Given that, I agree that a non-Functor name is a workable choice.
>
>

OK, I've added both LooseMap, and storable vector instances:

https://github.com/snoyberg/mono-traversable/commit/3f1c78eb12433a1e65d53b51a7fe1eb69ff80eec

Does that look reasonable?

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130917/3f9a74c9/attachment.htm>


More information about the Haskell-Cafe mailing list