mapM_ for bytestring

Shachaf Ben-Kiki shachaf at gmail.com
Sun Sep 1 18:31:54 CEST 2013


On Sun, Sep 1, 2013 at 3:58 AM, Artyom Kazak <yom at artyom.me> wrote:
> Would this be an appropriate place to propose adding mapM_ (and then
> possibly mapM) to bytestring library?
>
> Was it suggested before? If yes, why was it rejected?
>

For what it's worth, this is exported by lens in
Data.ByteString.Lens.bytes (or
Data.ByteString.{Lazy,Strict}.Lens.bytes). The version exported by
lens by default traverses each chunk in a balanced tree shape rather
than left-to-right (which is probably not relevant to most use cases,
actually -- the result is the same). It also works around
<http://ghc.haskell.org/trac/ghc/ticket/7556>, which you'll want to
watch for if you're writing this yourself. Note that you can construct
mapM_ from mapM as discussed in another libraries@ thread recently (or
by using e.g. mapMOf_).

    Shachaf




More information about the Libraries mailing list