rio-0.1.22.0: A standard library for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

RIO.ByteString.Lazy.Partial

Description

Lazy ByteString partial functions. Import as:

import qualified RIO.ByteString.Lazy.Partial as BL'
Synopsis

Basic interface

head :: HasCallStack => ByteString -> Word8 Source #

O(1) Extract the first element of a ByteString, which must be non-empty.

This is a partial function, consider using uncons instead.

last :: HasCallStack => ByteString -> Word8 Source #

O(n/c) Extract the last element of a ByteString, which must be finite and non-empty.

This is a partial function, consider using unsnoc instead.

tail :: HasCallStack => ByteString -> ByteString Source #

O(1) Extract the elements after the head of a ByteString, which must be non-empty.

This is a partial function, consider using uncons instead.

init :: HasCallStack => ByteString -> ByteString Source #

O(n/c) Returns all the elements of a ByteString except the last one.

This is a partial function, consider using unsnoc instead.

Reducing ByteStrings (folds)

foldl1 :: HasCallStack => (Word8 -> Word8 -> Word8) -> ByteString -> Word8 Source #

foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty ByteStrings.

foldl1' :: HasCallStack => (Word8 -> Word8 -> Word8) -> ByteString -> Word8 Source #

foldl1' is like foldl1, but strict in the accumulator.

foldr1 :: HasCallStack => (Word8 -> Word8 -> Word8) -> ByteString -> Word8 Source #

foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty ByteStrings

Special folds

maximum :: HasCallStack => ByteString -> Word8 Source #

O(n) maximum returns the maximum value from a ByteString

minimum :: HasCallStack => ByteString -> Word8 Source #

O(n) minimum returns the minimum value from a ByteString