forked from haskell/bytestring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,502 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
|
||
-- | | ||
-- Module : Data.ByteString.Short | ||
-- Copyright : (c) Duncan Coutts 2012-2013 | ||
-- Copyright : (c) Duncan Coutts 2012-2013, Julian Ospald 2022 | ||
-- License : BSD-style | ||
-- | ||
-- Maintainer : [email protected] | ||
-- Maintainer : [email protected] | ||
-- Stability : stable | ||
-- Portability : ghc only | ||
-- | ||
|
@@ -67,26 +67,111 @@ module Data.ByteString.Short ( | |
-- small unpinned strings are allocated in the same way as normal heap | ||
-- allocations, rather than in a separate pinned area. | ||
|
||
-- * Conversions | ||
toShort, | ||
fromShort, | ||
-- * Introducing and eliminating 'ShortByteString's | ||
empty, | ||
singleton, | ||
pack, | ||
unpack, | ||
fromShort, | ||
toShort, | ||
|
||
-- * Other operations | ||
empty, null, length, index, indexMaybe, (!?), | ||
-- * Basic interface | ||
snoc, | ||
cons, | ||
append, | ||
last, | ||
tail, | ||
head, | ||
init, | ||
null, | ||
length, | ||
|
||
-- ** Encoding validation | ||
-- * Encoding validation | ||
isValidUtf8, | ||
|
||
-- * Transforming ShortByteStrings | ||
map, | ||
reverse, | ||
intercalate, | ||
|
||
-- * Reducing 'ShortByteString's (folds) | ||
foldl, | ||
foldl', | ||
foldl1, | ||
foldl1', | ||
|
||
foldr, | ||
foldr', | ||
foldr1, | ||
foldr1', | ||
|
||
-- ** Special folds | ||
all, | ||
any, | ||
concat, | ||
|
||
-- ** Generating and unfolding ByteStrings | ||
replicate, | ||
unfoldr, | ||
unfoldrN, | ||
|
||
-- * Substrings | ||
|
||
-- ** Breaking strings | ||
take, | ||
takeEnd, | ||
takeWhileEnd, | ||
takeWhile, | ||
drop, | ||
dropEnd, | ||
dropWhile, | ||
dropWhileEnd, | ||
breakEnd, | ||
break, | ||
span, | ||
spanEnd, | ||
splitAt, | ||
split, | ||
splitWith, | ||
stripSuffix, | ||
stripPrefix, | ||
|
||
-- * Predicates | ||
isInfixOf, | ||
isPrefixOf, | ||
isSuffixOf, | ||
|
||
-- ** Search for arbitrary substrings | ||
breakSubstring, | ||
|
||
-- * Searching ShortByteStrings | ||
|
||
-- ** Searching by equality | ||
elem, | ||
|
||
-- ** Searching with a predicate | ||
find, | ||
filter, | ||
partition, | ||
|
||
-- * Indexing ShortByteStrings | ||
index, | ||
indexMaybe, | ||
(!?), | ||
elemIndex, | ||
elemIndices, | ||
count, | ||
findIndex, | ||
findIndices, | ||
|
||
-- * Low level conversions | ||
-- ** Packing 'Foreign.C.String.CString's and pointers | ||
-- ** Packing 'CString's and pointers | ||
packCString, | ||
packCStringLen, | ||
|
||
-- ** Using ByteStrings as 'Foreign.C.String.CString's | ||
-- ** Using ShortByteStrings as 'CString's | ||
useAsCString, | ||
useAsCStringLen | ||
useAsCStringLen, | ||
) where | ||
|
||
import Data.ByteString.Short.Internal | ||
|
Oops, something went wrong.