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.

  1. concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString

    bytestring Data.ByteString

    Map a function over a ByteString and concatenate the results

  2. primMapByteStringBounded :: BoundedPrim Word8 -> StrictByteString -> Builder

    bytestring 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
    

  3. primMapByteStringFixed :: FixedPrim Word8 -> StrictByteString -> Builder

    bytestring 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.

  4. primMapLazyByteStringBounded :: BoundedPrim Word8 -> LazyByteString -> Builder

    bytestring Data.ByteString.Builder.Prim

    Chunk-wise application of primMapByteStringBounded.

  5. primMapLazyByteStringFixed :: FixedPrim Word8 -> LazyByteString -> Builder

    bytestring Data.ByteString.Builder.Prim

    Heavy inlining. Encode all bytes of a LazyByteString from left-to-right with a FixedPrim.

  6. 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

    mconcat . map (primBounded w)
    
    or
    foldMap (primBounded w)
    
    because it moves several variables out of the inner loop.

  7. primMapListFixed :: FixedPrim a -> [a] -> Builder

    bytestring Data.ByteString.Builder.Prim

    Encode a list of values from left-to-right with a FixedPrim.

  8. contramapB :: (b -> a) -> BoundedPrim a -> BoundedPrim b

    bytestring 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)
    

  9. contramapF :: (b -> a) -> FixedPrim a -> FixedPrim b

    bytestring 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)
    

  10. concatMap :: (Char -> ByteString) -> ByteString -> ByteString

    bytestring Data.ByteString.Char8

    Map a function over a ByteString and concatenate the results

Page 402 of many | Previous | Next