| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Control.Foldl.ByteString
Contents
Description
Folds for byte streams
- fold :: Fold ByteString a -> ByteString -> a
- head :: Fold ByteString (Maybe Word8)
- last :: Fold ByteString (Maybe Word8)
- null :: Fold ByteString Bool
- length :: Num n => Fold ByteString n
- any :: (Word8 -> Bool) -> Fold ByteString Bool
- all :: (Word8 -> Bool) -> Fold ByteString Bool
- maximum :: Fold ByteString (Maybe Word8)
- minimum :: Fold ByteString (Maybe Word8)
- elem :: Word8 -> Fold ByteString Bool
- notElem :: Word8 -> Fold ByteString Bool
- find :: (Word8 -> Bool) -> Fold ByteString (Maybe Word8)
- index :: Integral n => n -> Fold ByteString (Maybe Word8)
- elemIndex :: Num n => Word8 -> Fold ByteString (Maybe n)
- findIndex :: Num n => (Word8 -> Bool) -> Fold ByteString (Maybe n)
- count :: Num n => Word8 -> Fold ByteString n
- module Control.Foldl
- module Data.ByteString
- module Data.Word
Folding
fold :: Fold ByteString a -> ByteString -> a Source
Apply a strict left Fold to a lazy bytestring
Folds
head :: Fold ByteString (Maybe Word8) Source
Get the first byte of a byte stream or return Nothing if the stream is
empty
last :: Fold ByteString (Maybe Word8) Source
Get the last byte of a byte stream or return Nothing if the byte stream is
empty
length :: Num n => Fold ByteString n Source
Return the length of the byte stream in bytes
find :: (Word8 -> Bool) -> Fold ByteString (Maybe Word8) Source
(find predicate) returns the first byte that satisfies the predicate or
Nothing if no byte satisfies the predicate
index :: Integral n => n -> Fold ByteString (Maybe Word8) Source
(index n) returns the nth byte of the byte stream, or Nothing if the
stream has an insufficient number of bytes
elemIndex :: Num n => Word8 -> Fold ByteString (Maybe n) Source
(elemIndex w8) returns the index of the first byte that equals w8, or
Nothing if no byte matches
findIndex :: Num n => (Word8 -> Bool) -> Fold ByteString (Maybe n) Source
(findIndex predicate) returns the index of the first byte that satisfies
the predicate, or Nothing if no byte satisfies the predicate
Re-exports
Control.Foldl re-exports the Fold type
Data.ByteString re-exports the ByteString type
Data.Word re-exports the Word8 type
module Control.Foldl
module Data.ByteString
module Data.Word