There are standard (pure) map functions for ByteString and Text:
map :: (Word8 -> Word8) -> ByteString -> ByteString
map :: (Char -> Char) -> Text -> Text
but I'm missing their monadic/applicative counterparts:
traverse :: (Applicative f) => (Word8 -> f Word8) -> ByteString -> f ByteString
traverse :: (Applicative f) => (Char -> f Char) -> Text -> f Text
(If we have traverse
we can define mapM f = unwrapMonad . traverse (WrapMonad . f)
.)
I tried looking through the packages, tried Hoogle, but I didn't find them. Did I overlook something? Or is there a reason why they're missing (like it's not possible/easy to define them efficiently)?