Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module exports all the partial functions from Data.ByteString.Lazy
Synopsis
- head :: ByteString -> Word8
- last :: ByteString -> Word8
- tail :: ByteString -> ByteString
- init :: ByteString -> ByteString
- foldl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
- foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
- foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
- maximum :: ByteString -> Word8
- minimum :: ByteString -> Word8
Basic interface
head :: ByteString -> Word8 #
O(1) Extract the first element of a ByteString, which must be non-empty.
last :: ByteString -> Word8 #
O(n/c) Extract the last element of a ByteString, which must be finite and non-empty.
tail :: ByteString -> ByteString #
O(1) Extract the elements after the head of a ByteString, which must be non-empty.
init :: ByteString -> ByteString #
O(n/c) Return all the elements of a ByteString
except the last one.
Reducing ByteString
s (folds)
foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8 #
'foldl1\'' is like foldl1
, but strict in the accumulator.
foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8 #
foldr1
is a variant of foldr
that has no starting value argument,
and thus must be applied to non-empty ByteString
s
Special folds
maximum :: ByteString -> Word8 #
O(n) maximum
returns the maximum value from a ByteString
minimum :: ByteString -> Word8 #
O(n) minimum
returns the minimum value from a ByteString