
1 Sep
2013
1 Sep
'13
7:18 a.m.
Artyom Kazak wrote:
Would this be an appropriate place to propose adding mapM_ (and then possibly mapM) to bytestring library?
Err, mapM is defined as: mapM :: Monad m => (a -> m b) -> [a] -> m [b] in that the second parameter is a list. ByteStrings are not lists, they're chunks of bytes. Besides, you can just do: let bs = "This is a bytestring" mapM someFUnctions $ BS.unpack bs or define a function: mapBSM :: Monad m => (Char -> m a) -> ByteString -> m [a] mapBSM f bs = mapM f $ BS.unpack bs and similar for mapBSM_. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/