
1 Sep
2013
1 Sep
'13
2:45 p.m.
On Sun, 01 Sep 2013 17:16:49 +0400, Henning Thielemann
Yeah, the signatures for mapM_ and mapM would respectively be
mapM_ :: Monad m => (Word8 -> m b) -> ByteString -> m ()
This one should not be a big problem, but could be done by calling mapM_ on the result of ByteString.unpack.
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.