Hoogle Search
Within LTS Haskell 24.41 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
concatMap :: (Word8 -> ByteString) -> ByteString -> ByteStringbytestring Data.ByteString Map a function over a ByteString and concatenate the results
primMapByteStringBounded :: BoundedPrim Word8 -> StrictByteString -> Builderbytestring Data.ByteString.Builder.Prim Create a Builder that encodes each Word8 of a StrictByteString using a BoundedPrim. For example, we can write a Builder that filters a StrictByteString as follows.
import qualified Data.ByteString.Builder.Prim as P
filterBS p = P.condB p (P.liftFixedToBounded P.word8) P.emptyB
primMapByteStringFixed :: FixedPrim Word8 -> StrictByteString -> Builderbytestring Data.ByteString.Builder.Prim Heavy inlining. Encode all bytes of a StrictByteString 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.StrictByteString -> Builder mapToBuilder f = primMapByteStringFixed (contramapF f word8)
We can also use it to hex-encode a StrictByteString as shown by the byteStringHex example above.primMapLazyByteStringBounded :: BoundedPrim Word8 -> LazyByteString -> Builderbytestring Data.ByteString.Builder.Prim Chunk-wise application of primMapByteStringBounded.
primMapLazyByteStringFixed :: FixedPrim Word8 -> LazyByteString -> Builderbytestring Data.ByteString.Builder.Prim Heavy inlining. Encode all bytes of a LazyByteString from left-to-right with a FixedPrim.
primMapListBounded :: BoundedPrim a -> [a] -> Builderbytestring 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
mconcat . map (primBounded w)
orfoldMap (primBounded w)
because it moves several variables out of the inner loop.primMapListFixed :: FixedPrim a -> [a] -> Builderbytestring Data.ByteString.Builder.Prim Encode a list of values from left-to-right with a FixedPrim.
contramapB :: (b -> a) -> BoundedPrim a -> BoundedPrim bbytestring Data.ByteString.Builder.Prim.Internal Change a BoundedPrim such that it first applies a function to the value to be encoded. Note that BoundedPrims are Contravariant http://hackage.haskell.org/package/contravariant. Hence, the following laws hold.
contramapB id = id contramapB f . contramapB g = contramapB (g . f)
contramapF :: (b -> a) -> FixedPrim a -> FixedPrim bbytestring Data.ByteString.Builder.Prim.Internal Change a primitives such that it first applies a function to the value to be encoded. Note that primitives are Contravariant http://hackage.haskell.org/package/contravariant. Hence, the following laws hold.
contramapF id = id contramapF f . contramapF g = contramapF (g . f)
concatMap :: (Char -> ByteString) -> ByteString -> ByteStringbytestring Data.ByteString.Char8 Map a function over a ByteString and concatenate the results