Map -text +bytestring

map :: (Char -> Char) -> ByteString -> ByteString
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
O(n) map f xs is the ByteString obtained by applying f to each element of xs
map :: (Word8 -> Word8) -> ByteString -> ByteString
bytestring Data.ByteString.Lazy
O(n) map f xs is the ByteString obtained by applying f to each element of xs.
map :: (Word8 -> Word8) -> ByteString -> ByteString
bytestring Data.ByteString
O(n) map f xs is the ByteString obtained by applying f to each element of xs. This function is subject to array fusion.
mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Lazy.Char8
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Char8
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.
mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Lazy
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.
mapAccumR :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.
mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.
concatMap :: (Char -> ByteString) -> ByteString -> ByteString
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
Map a function over a ByteString and concatenate the results
concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
Map a function over a ByteString and concatenate the results
primMapByteStringBounded :: BoundedPrim Word8 -> ByteString -> Builder
bytestring Data.ByteString.Builder.Prim
Create a Builder that encodes each Word8 of a strict ByteString using a BoundedPrim. For example, we can write a Builder that filters a strict ByteString as follows. > import Data.ByteString.Builder.Primas P (word8, condB, emptyB) > filterBS p = P.condB p P.word8 P.emptyB
primMapByteStringFixed :: FixedPrim Word8 -> (ByteString -> Builder)
bytestring Data.ByteString.Builder.Prim
Heavy inlining. Encode all bytes of a strict ByteString from left-to-right with a FixedPrim. This function is quite versatile. For example, we can use it to construct a Builder that maps every byte before copying it to the buffer to be filled. > mapToBuilder :: (Word8 -> Word8) -> S.ByteString -> Builder > mapToBuilder f = encodeByteStringWithF (contramapF f word8) We can also use it to hex-encode a strict ByteString as shown by the byteStringHex example above.
primMapLazyByteStringBounded :: BoundedPrim Word8 -> ByteString -> Builder
bytestring Data.ByteString.Builder.Prim
Chunk-wise application of primMapByteStringBounded.
primMapLazyByteStringFixed :: FixedPrim Word8 -> (ByteString -> Builder)
bytestring Data.ByteString.Builder.Prim
Heavy inlining. Encode all bytes of a lazy ByteString from left-to-right with a FixedPrim.
primMapListBounded :: BoundedPrim a -> [a] -> Builder
bytestring Data.ByteString.Builder.Prim
Create a Builder that encodes a list of values consecutively using a BoundedPrim for each element. This function is more efficient than the canonical > filter p = > B.toLazyByteString . > E.encodeLazyByteStringWithF (E.ifF p E.word8) E.emptyF) > mconcat . map (primBounded w) or > foldMap (primBounded w) because it moves several variables out of the inner loop.
primMapListFixed :: FixedPrim a -> ([a] -> Builder)
bytestring Data.ByteString.Builder.Prim
Encode a list of values from left-to-right with a FixedPrim.