rio-0.1.18.0: A standard library for Haskell

Safe Haskell | None
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
- singleton :: Word8 -> ByteString
- reverse :: ByteString -> ByteString
- all :: (Word8 -> Bool) -> ByteString -> Bool
- any :: (Word8 -> Bool) -> ByteString -> Bool
- append :: ByteString -> ByteString -> ByteString
- break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- breakEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- breakSubstring :: ByteString -> ByteString -> (ByteString, ByteString)
- concat :: [ByteString] -> ByteString
- concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString
- cons :: Word8 -> ByteString -> ByteString
- copy :: ByteString -> ByteString
- count :: Word8 -> ByteString -> Int
- drop :: Int -> ByteString -> ByteString
- dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString
- elem :: Word8 -> ByteString -> Bool
- elemIndex :: Word8 -> ByteString -> Maybe Int
- elemIndexEnd :: Word8 -> ByteString -> Maybe Int
- elemIndices :: Word8 -> ByteString -> [Int]
- empty :: ByteString
- filter :: (Word8 -> Bool) -> ByteString -> ByteString
- find :: (Word8 -> Bool) -> ByteString -> Maybe Word8
- findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int
- findIndices :: (Word8 -> Bool) -> ByteString -> [Int]
- foldl :: (a -> Word8 -> a) -> a -> ByteString -> a
- foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a
- foldr :: (Word8 -> a -> a) -> a -> ByteString -> a
- foldr' :: (Word8 -> a -> a) -> a -> ByteString -> a
- group :: ByteString -> [ByteString]
- groupBy :: (Word8 -> Word8 -> Bool) -> ByteString -> [ByteString]
- index :: ByteString -> Int -> Word8
- inits :: ByteString -> [ByteString]
- intercalate :: ByteString -> [ByteString] -> ByteString
- intersperse :: Word8 -> ByteString -> ByteString
- isInfixOf :: ByteString -> ByteString -> Bool
- isPrefixOf :: ByteString -> ByteString -> Bool
- isSuffixOf :: ByteString -> ByteString -> Bool
- length :: ByteString -> Int
- map :: (Word8 -> Word8) -> ByteString -> ByteString
- mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
- mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
- notElem :: Word8 -> ByteString -> Bool
- null :: ByteString -> Bool
- pack :: [Word8] -> ByteString
- partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- replicate :: Int -> Word8 -> ByteString
- scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
- scanl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString
- scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
- scanr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString
- snoc :: ByteString -> Word8 -> ByteString
- sort :: ByteString -> ByteString
- span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- spanEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
- split :: Word8 -> ByteString -> [ByteString]
- splitAt :: Int -> ByteString -> (ByteString, ByteString)
- splitWith :: (Word8 -> Bool) -> ByteString -> [ByteString]
- stripPrefix :: ByteString -> ByteString -> Maybe ByteString
- stripSuffix :: ByteString -> ByteString -> Maybe ByteString
- tails :: ByteString -> [ByteString]
- take :: Int -> ByteString -> ByteString
- takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString
- transpose :: [ByteString] -> [ByteString]
- uncons :: ByteString -> Maybe (Word8, ByteString)
- unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString
- unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> (ByteString, Maybe a)
- unpack :: ByteString -> [Word8]
- unsnoc :: ByteString -> Maybe (ByteString, Word8)
- unzip :: [(Word8, Word8)] -> (ByteString, ByteString)
- zip :: ByteString -> ByteString -> [(Word8, Word8)]
- zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a]
- 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
- writeFile :: MonadIO m => FilePath -> ByteString -> m ()
- 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

Eq ByteString |
Instance details Defined in Data.ByteString.Internal Methods (==) :: ByteString -> ByteString -> Bool # (/=) :: ByteString -> ByteString -> Bool #
Data ByteString |

Instance details

Defined in Data.ByteString.Internal

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 #

Ord ByteString |
Instance details Defined in Data.ByteString.Internal 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 #
Read ByteString |
Instance details Defined in Data.ByteString.Internal Methods readsPrec :: Int -> ReadS ByteString readList :: ReadS [ByteString] readPrec :: ReadPrec ByteString readListPrec :: ReadPrec [ByteString]
Show ByteString |
Instance details Defined in Data.ByteString.Internal Methods showsPrec :: Int -> ByteString -> ShowS show :: ByteString -> String # showList :: [ByteString] -> ShowS
IsString ByteString |
Instance details Defined in Data.ByteString.Internal Methods fromString :: String -> ByteString #
Semigroup ByteString |
Instance details Defined in Data.ByteString.Internal Methods (<>) :: ByteString -> ByteString -> ByteString # sconcat :: NonEmpty ByteString -> ByteString stimes :: Integral b => b -> ByteString -> ByteString
Monoid ByteString |
Instance details Defined in Data.ByteString.Internal Methods mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString #
Hashable ByteString |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> ByteString -> Int Source # hash :: ByteString -> Int Source #
NFData ByteString |
Instance details Defined in Data.ByteString.Internal Methods rnf :: ByteString -> () #

singleton :: Word8 -> ByteString #

reverse :: ByteString -> ByteString #

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

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

append :: ByteString -> ByteString -> ByteString #

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

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

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

concat :: [ByteString] -> ByteString #

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

cons :: Word8 -> ByteString -> ByteString #

copy :: ByteString -> ByteString #

count :: Word8 -> ByteString -> Int #

drop :: Int -> ByteString -> ByteString #

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

elem :: Word8 -> ByteString -> Bool #

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

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

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

empty :: ByteString #

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

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

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

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

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

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

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

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

group :: ByteString -> [ByteString] #

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

index :: ByteString -> Int -> Word8 #

inits :: ByteString -> [ByteString] #

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

intersperse :: Word8 -> ByteString -> ByteString #

isInfixOf :: ByteString -> ByteString -> Bool #

isPrefixOf :: ByteString -> ByteString -> Bool #

isSuffixOf :: ByteString -> ByteString -> Bool #

length :: ByteString -> Int #

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

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

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

notElem :: Word8 -> ByteString -> Bool #

null :: ByteString -> Bool #

pack :: [Word8] -> ByteString #

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

replicate :: Int -> Word8 -> ByteString #

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

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

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

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

snoc :: ByteString -> Word8 -> ByteString #

sort :: ByteString -> ByteString #

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

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

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

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

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

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

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

tails :: ByteString -> [ByteString] #

take :: Int -> ByteString -> ByteString #

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

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

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

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

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

unpack :: ByteString -> [Word8] #

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

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

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

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

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

Lifted `packCString`

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

Lifted `packCStringLen`

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

Unlifted `useAsCString`

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

Unlifted `useAsCStringLen`

getLine :: MonadIO m => m ByteString Source #

Lifted `getLine`

getContents :: MonadIO m => m ByteString Source #

Lifted `getContents`

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

Lifted `putStr`

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

Lifted `interact`

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

Lifted `readFile`

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

Lifted `writeFile`

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

Lifted `appendFile`

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

Lifted `hGetLine`

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

Lifted `hGetContents`

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

Lifted `hGet`

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

Lifted `hGetSome`

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

Lifted `hGetNonBlocking`

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

Lifted `hPut`

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

Lifted `hPutNonBlocking`

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

Lifted `hPutStr`