mapM_ for bytestring

Artyom Kazak yom at
Sun Sep 1 21:09:35 CEST 2013

On Sun, 01 Sep 2013 22:55:10 +0400, Henning Thielemann
<lemming at> wrote:

>> As I’ve said, mapM_ through ByteString.unpack is four times slower than
>> the hand-written version. I find it unacceptable that a simple counting
>> sort *can’t* be written efficiently for ByteString without importing
>> Data.ByteString.Unsafe, Foreign.Ptr and friends.
> A possible solution might be fusion rules for ByteString.unpack and  
> mapM_.

Except that such rules would require a hand-written version of mapM_  

I agree that it can be written, it’s just that I don’t see why it should  
be in some obscure place instead of Data.ByteString.

More information about the Libraries mailing list