Hoogle Search
Within LTS Haskell 24.43 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
byteStringBytes :: ByteString -> Unfoldr Word8deferred-folds DeferredFolds.Unfoldr Bytes of a bytestring
byteStringOf :: forall (st :: ZeroBitType) e a . ParserT st e a -> ParserT st e ByteStringflatparse FlatParse.Basic Return the ByteString consumed by a parser. Note: it's more efficient to use spanOf and withSpan instead.
byteStringOf :: forall (st :: ZeroBitType) r e a . ParserT st r e a -> ParserT st r e ByteStringflatparse FlatParse.Stateful Return the ByteString consumed by a parser. Note: it's more efficient to use spanOf and withSpan instead.
byteStringToInteger :: ByteString -> Integerinteger-conversion Data.Integer.Conversion Convert ByteString to Integer. Semantically same as BS.foldl' (acc c -> acc * 10 + toInteger c - 48) 0, but this is more efficient.
>>> byteStringToInteger "123456789" 123456789
For non-decimal inputs some nonsense is calculated>>> byteStringToInteger "foobar" 6098556
-
Efficiently parse and produce common integral and fractional numbers. The bytestring-lexing package offers extremely efficient ByteString parsers for some common lexemes: namely integral and fractional numbers. In addition, it provides efficient serializers for (some of) the formats it parses. As of version 0.3.0, bytestring-lexing offers the best-in-show parsers for integral values. (According to the Warp web server's benchmark of parsing the Content-Length field of HTTP headers.) And as of version 0.5.0 it offers (to my knowledge) the best-in-show parser for fractional/floating numbers. Some benchmarks for this package can be found at: https://github.com/wrengr/bytestring-lexing/tree/master/bench/html
bytestring16 :: Word16 -> ByteStringnetwork-byte-order Network.ByteOrder >>> let w = foldl' (\x y -> x * 256 + y) 0 [5,6] :: Word16 >>> unpack $ bytestring16 w [5,6]
bytestring32 :: Word32 -> ByteStringnetwork-byte-order Network.ByteOrder >>> let w = foldl' (\x y -> x * 256 + y) 0 [5,6,7,8] :: Word32 >>> unpack $ bytestring32 w [5,6,7,8]
bytestring64 :: Word64 -> ByteStringnetwork-byte-order Network.ByteOrder >>> let w = foldl' (\x y -> x * 256 + y) 0 [1,2,3,4,5,6,7,8] :: Word64 >>> unpack $ bytestring64 w [1,2,3,4,5,6,7,8]
bytestring8 :: Word8 -> ByteStringnetwork-byte-order Network.ByteOrder >>> let w = 5 :: Word8 >>> unpack $ bytestring8 w [5]
bytestringBE :: ByteString -> Pair NatRepr BVbv-sized Data.BitVector.Sized Construct a BV from a big-endian bytestring.
>>> case bytestringBE (BS.pack [0, 1, 1]) of p -> (fstPair p, sndPair p) (24,BV 257)