rio-0.1.22.0: A standard library for Haskell

Safe Haskell | Safe-Inferred
Language | Haskell2010

RIO.ByteString

Description

Strict `ByteString`. Import as:

    import qualified RIO.ByteString as B

This module does not export any partial functions. For those, see RIO.ByteString.Partial

Synopsis

- data ByteString
- type StrictByteString = ByteString
- foldr :: (Word8 -> a -> a) -> a -> ByteString -> a
- map :: (Word8 -> Word8) -> ByteString -> ByteString
- mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
- reverse :: ByteString -> ByteString
- zip :: ByteString -> ByteString -> [(Word8, Word8)]
- filter :: (Word8 -> Bool) -> ByteString -> ByteString
- concat :: [ByteString] -> ByteString
- empty :: ByteString
- length :: ByteString -> Int
- singleton :: Word8 -> ByteString
- snoc :: ByteString -> Word8 -> ByteString
- index :: HasCallStack => ByteString -> Int -> Word8
- copy :: ByteString -> ByteString
- foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a
- foldr' :: (Word8 -> a -> a) -> a -> ByteString -> a
- foldl :: (a -> Word8 -> a) -> a -> ByteString -> a
- all :: (Word8 -> Bool) -> ByteString -> Bool
- null :: ByteString -> Bool
- (!?) :: ByteString -> Int -> Maybe Word8
- groupBy :: (Word8 -> Word8 -> Bool) -> ByteString -> [ByteString]
- group :: ByteString -> [ByteString]
- replicate :: Int -> Word8 -> ByteString
- cons :: Word8 -> ByteString -> ByteString
- take :: Int -> ByteString -> ByteString
- drop :: Int -> ByteString -> ByteString
- zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a]
- takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString
- dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString
- elem :: Word8 -> ByteString -> Bool
- notElem :: Word8 -> ByteString -> Bool
- find :: (Word8 -> Bool) -> ByteString -> Maybe Word8
- findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int
- concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString
- unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString
- unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> (ByteString, Maybe a)
- scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
- scanl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString
- splitAt :: Int -> ByteString -> (ByteString, ByteString)
- uncons :: ByteString -> Maybe (Word8, ByteString)
- unsnoc :: ByteString -> Maybe (ByteString, Word8)
- unzip :: [(Word8, Word8)] -> (ByteString, ByteString)
- partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- findIndices :: (Word8 -> Bool) -> ByteString -> [Int]
- elemIndex :: Word8 -> ByteString -> Maybe Int
- elemIndices :: Word8 -> ByteString -> [Int]
- any :: (Word8 -> Bool) -> ByteString -> Bool
- scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
- scanr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString
- pack :: [Word8] -> ByteString
- unpack :: ByteString -> [Word8]
- fromStrict :: ByteString -> ByteString
- toStrict :: ByteString -> ByteString
- append :: ByteString -> ByteString -> ByteString
- intersperse :: Word8 -> ByteString -> ByteString
- intercalate :: ByteString -> [ByteString] -> ByteString
- transpose :: [ByteString] -> [ByteString]
- mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
- inits :: ByteString -> [ByteString]
- tails :: ByteString -> [ByteString]
- stripPrefix :: ByteString -> ByteString -> Maybe ByteString
- stripSuffix :: ByteString -> ByteString -> Maybe ByteString
- split :: Word8 -> ByteString -> [ByteString]
- splitWith :: (Word8 -> Bool) -> ByteString -> [ByteString]
- isPrefixOf :: ByteString -> ByteString -> Bool
- isSuffixOf :: ByteString -> ByteString -> Bool
- elemIndexEnd :: Word8 -> ByteString -> Maybe Int
- count :: Word8 -> ByteString -> Int
- dropWhileEnd :: (Word8 -> Bool) -> ByteString -> ByteString
- isInfixOf :: ByteString -> ByteString -> Bool
- sort :: ByteString -> ByteString
- takeEnd :: Int -> ByteString -> ByteString
- dropEnd :: Int -> ByteString -> ByteString
- takeWhileEnd :: (Word8 -> Bool) -> ByteString -> ByteString
- breakEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- findIndexEnd :: (Word8 -> Bool) -> ByteString -> Maybe Int
- packZipWith :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString -> ByteString
- indexMaybe :: ByteString -> Int -> Maybe Word8
- initsNE :: ByteString -> NonEmpty ByteString
- spanEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- tailsNE :: ByteString -> NonEmpty ByteString
- breakSubstring :: ByteString -> ByteString -> (ByteString, ByteString)
- fromFilePath :: FilePath -> IO ByteString
- isValidUtf8 :: ByteString -> Bool
- toFilePath :: ByteString -> IO FilePath
- writeFile :: MonadIO m => FilePath -> ByteString -> m ()
- packCString :: MonadIO m => CString -> m ByteString
- packCStringLen :: MonadIO m => CStringLen -> m ByteString
- useAsCString :: MonadUnliftIO m => ByteString -> (CString -> m a) -> m a
- useAsCStringLen :: MonadUnliftIO m => ByteString -> (CStringLen -> m a) -> m a
- getLine :: MonadIO m => m ByteString
- getContents :: MonadIO m => m ByteString
- putStr :: MonadIO m => ByteString -> m ()
- interact :: MonadIO m => (ByteString -> ByteString) -> m ()
- readFile :: MonadIO m => FilePath -> m ByteString
- appendFile :: MonadIO m => FilePath -> ByteString -> m ()
- hGetLine :: MonadIO m => Handle -> m ByteString
- hGetContents :: MonadIO m => Handle -> m ByteString
- hGet :: MonadIO m => Handle -> Int -> m ByteString
- hGetSome :: MonadIO m => Handle -> Int -> m ByteString
- hGetNonBlocking :: MonadIO m => Handle -> Int -> m ByteString
- hPut :: MonadIO m => Handle -> ByteString -> m ()
- hPutNonBlocking :: MonadIO m => Handle -> ByteString -> m ByteString
- hPutStr :: MonadIO m => Handle -> ByteString -> m ()

# Documentation

data ByteString #

#### Instances

Instances details

Data ByteString |

Instance details

Defined in Data.ByteString.Internal.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteString -> c ByteString #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteString #

toConstr :: ByteString -> Constr #

dataTypeOf :: ByteString -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteString) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteString) #

gmapT :: (forall b. Data b => b -> b) -> ByteString -> ByteString #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteString -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteString -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

IsString ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods fromString :: String -> ByteString #
Monoid ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString #
Semigroup ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods (<>) :: ByteString -> ByteString -> ByteString # sconcat :: NonEmpty ByteString -> ByteString stimes :: Integral b => b -> ByteString -> ByteString
IsList ByteString |
Instance details Defined in Data.ByteString.Internal.Type Associated Types type Item ByteString Methods fromList :: [Item ByteString] -> ByteString fromListN :: Int -> [Item ByteString] -> ByteString toList :: ByteString -> [Item ByteString]
Read ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods readsPrec :: Int -> ReadS ByteString readList :: ReadS [ByteString] readPrec :: ReadPrec ByteString readListPrec :: ReadPrec [ByteString]
Show ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods showsPrec :: Int -> ByteString -> ShowS show :: ByteString -> String # showList :: [ByteString] -> ShowS
NFData ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods rnf :: ByteString -> () #
Eq ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods (==) :: ByteString -> ByteString -> Bool # (/=) :: ByteString -> ByteString -> Bool #
Ord ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods compare :: ByteString -> ByteString -> Ordering # (<) :: ByteString -> ByteString -> Bool # (<=) :: ByteString -> ByteString -> Bool # (>) :: ByteString -> ByteString -> Bool # (>=) :: ByteString -> ByteString -> Bool # max :: ByteString -> ByteString -> ByteString # min :: ByteString -> ByteString -> ByteString #
Hashable ByteString |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> ByteString -> Int # hash :: ByteString -> Int #
Lift ByteString |
Instance details Defined in Data.ByteString.Internal.Type Methods lift :: Quote m => ByteString -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString
type Item ByteString |
Instance details Defined in Data.ByteString.Internal.Type type Item ByteString = Word8

type StrictByteString = ByteString #

foldr :: (Word8 -> a -> a) -> a -> ByteString -> a #

map :: (Word8 -> Word8) -> ByteString -> ByteString #

mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString) #

reverse :: ByteString -> ByteString #

zip :: ByteString -> ByteString -> [(Word8, Word8)] #

filter :: (Word8 -> Bool) -> ByteString -> ByteString #

concat :: [ByteString] -> ByteString #

empty :: ByteString #

length :: ByteString -> Int #

singleton :: Word8 -> ByteString #

snoc :: ByteString -> Word8 -> ByteString #

index :: HasCallStack => ByteString -> Int -> Word8 #

copy :: ByteString -> ByteString #

foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a #

foldr' :: (Word8 -> a -> a) -> a -> ByteString -> a #

foldl :: (a -> Word8 -> a) -> a -> ByteString -> a #

all :: (Word8 -> Bool) -> ByteString -> Bool #

null :: ByteString -> Bool #

(!?) :: ByteString -> Int -> Maybe Word8 #

groupBy :: (Word8 -> Word8 -> Bool) -> ByteString -> [ByteString] #

group :: ByteString -> [ByteString] #

replicate :: Int -> Word8 -> ByteString #

cons :: Word8 -> ByteString -> ByteString #

take :: Int -> ByteString -> ByteString #

drop :: Int -> ByteString -> ByteString #

zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a] #

takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString #

dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString #

elem :: Word8 -> ByteString -> Bool #

notElem :: Word8 -> ByteString -> Bool #

find :: (Word8 -> Bool) -> ByteString -> Maybe Word8 #

findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int #

concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString #

unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString #

unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> (ByteString, Maybe a) #

scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString #

scanl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString #

splitAt :: Int -> ByteString -> (ByteString, ByteString) #

uncons :: ByteString -> Maybe (Word8, ByteString) #

unsnoc :: ByteString -> Maybe (ByteString, Word8) #

unzip :: [(Word8, Word8)] -> (ByteString, ByteString) #

partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) #

span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) #

break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) #

findIndices :: (Word8 -> Bool) -> ByteString -> [Int] #

elemIndex :: Word8 -> ByteString -> Maybe Int #

elemIndices :: Word8 -> ByteString -> [Int] #

any :: (Word8 -> Bool) -> ByteString -> Bool #

scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString #

scanr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString #

pack :: [Word8] -> ByteString #

unpack :: ByteString -> [Word8] #

fromStrict :: ByteString -> ByteString #

toStrict :: ByteString -> ByteString #

append :: ByteString -> ByteString -> ByteString #

intersperse :: Word8 -> ByteString -> ByteString #

intercalate :: ByteString -> [ByteString] -> ByteString #

transpose :: [ByteString] -> [ByteString] #

mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString) #

inits :: ByteString -> [ByteString] #

tails :: ByteString -> [ByteString] #

stripPrefix :: ByteString -> ByteString -> Maybe ByteString #

stripSuffix :: ByteString -> ByteString -> Maybe ByteString #

split :: Word8 -> ByteString -> [ByteString] #

splitWith :: (Word8 -> Bool) -> ByteString -> [ByteString] #

isPrefixOf :: ByteString -> ByteString -> Bool #

isSuffixOf :: ByteString -> ByteString -> Bool #

elemIndexEnd :: Word8 -> ByteString -> Maybe Int #

count :: Word8 -> ByteString -> Int #

dropWhileEnd :: (Word8 -> Bool) -> ByteString -> ByteString #

isInfixOf :: ByteString -> ByteString -> Bool #

sort :: ByteString -> ByteString #

takeEnd :: Int -> ByteString -> ByteString #

dropEnd :: Int -> ByteString -> ByteString #

takeWhileEnd :: (Word8 -> Bool) -> ByteString -> ByteString #

breakEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) #

findIndexEnd :: (Word8 -> Bool) -> ByteString -> Maybe Int #

packZipWith :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString -> ByteString #

indexMaybe :: ByteString -> Int -> Maybe Word8 #

initsNE :: ByteString -> NonEmpty ByteString #

spanEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) #

tailsNE :: ByteString -> NonEmpty ByteString #

breakSubstring :: ByteString -> ByteString -> (ByteString, ByteString) #

fromFilePath :: FilePath -> IO ByteString #

isValidUtf8 :: ByteString -> Bool #

toFilePath :: ByteString -> IO FilePath #

writeFile :: MonadIO m => FilePath -> ByteString -> m () #

Lifted `writeFile`

packCString :: MonadIO m => CString -> m ByteString #

Lifted `packCString`

packCStringLen :: MonadIO m => CStringLen -> m ByteString #

Lifted `packCStringLen`

useAsCString :: MonadUnliftIO m => ByteString -> (CString -> m a) -> m a #

Unlifted `useAsCString`

useAsCStringLen :: MonadUnliftIO m => ByteString -> (CStringLen -> m a) -> m a #

Unlifted `useAsCStringLen`

getLine :: MonadIO m => m ByteString #

Lifted `getLine`

getContents :: MonadIO m => m ByteString #

Lifted `getContents`

putStr :: MonadIO m => ByteString -> m () #

Lifted `putStr`

interact :: MonadIO m => (ByteString -> ByteString) -> m () #

Lifted `interact`

readFile :: MonadIO m => FilePath -> m ByteString #

Lifted `readFile`

appendFile :: MonadIO m => FilePath -> ByteString -> m () #

Lifted `appendFile`

hGetLine :: MonadIO m => Handle -> m ByteString #

Lifted `hGetLine`

hGetContents :: MonadIO m => Handle -> m ByteString #

Lifted `hGetContents`

hGet :: MonadIO m => Handle -> Int -> m ByteString #

Lifted `hGet`

hGetSome :: MonadIO m => Handle -> Int -> m ByteString #

Lifted `hGetSome`

hGetNonBlocking :: MonadIO m => Handle -> Int -> m ByteString #

Lifted `hGetNonBlocking`

hPut :: MonadIO m => Handle -> ByteString -> m () #

Lifted `hPut`

hPutNonBlocking :: MonadIO m => Handle -> ByteString -> m ByteString #

Lifted `hPutNonBlocking`

hPutStr :: MonadIO m => Handle -> ByteString -> m () #

Lifted `hPutStr`