[Word8] -> ByteString

pack :: [Word8] -> ByteString
bytestring Data.ByteString.Lazy
O(n) Convert a '[Word8]' into a ByteString.
pack :: [Word8] -> ByteString
bytestring Data.ByteString
O(n) Convert a '[Word8]' into a ByteString. For applications with large numbers of string literals, pack can be a bottleneck. In such cases, consider using packAddress (GHC only).
repeat :: Word8 -> ByteString
bytestring Data.ByteString.Lazy
repeat x is an infinite ByteString, with x the value of every element.
singleton :: Word8 -> ByteString
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
O(1) Convert a Word8 into a ByteString
iterate :: (Word8 -> Word8) -> Word8 -> ByteString
bytestring Data.ByteString.Lazy
iterate f x returns an infinite ByteString of repeated applications of f to x: > iterate f x == [x, f x, f (f x), ...]
cons :: Word8 -> ByteString -> ByteString
bytestring Data.ByteString.Lazy
O(1) cons is analogous to '(:)' for lists.
cons :: Word8 -> ByteString -> ByteString
bytestring Data.ByteString
O(n) cons is analogous to (:) for lists, but of different complexity, as it requires a memcpy.
cons' :: Word8 -> ByteString -> ByteString
bytestring Data.ByteString.Lazy
O(1) Unlike cons, 'cons\'' is strict in the ByteString that we are consing onto. More precisely, it forces the head and the first chunk. It does this because, for space efficiency, it may coalesce the new byte onto the first 'chunk' rather than starting a new 'chunk'. So that means you can't use a lazy recursive contruction like this: > let xs = cons\' c xs in xs You can however use cons, as well as repeat and cycle, to build infinite lazy ByteStrings.
intersperse :: Word8 -> ByteString -> ByteString
bytestring Data.ByteString
O(n) The intersperse function takes a Word8 and a ByteString and `intersperses' that byte between the elements of the ByteString. It is analogous to the intersperse function on Lists.
intersperse :: Word8 -> ByteString -> ByteString
bytestring Data.ByteString.Lazy
The intersperse function takes a Word8 and a ByteString and `intersperses' that byte between the elements of the ByteString. It is analogous to the intersperse function on Lists.
replicate :: Int64 -> Word8 -> ByteString
bytestring Data.ByteString.Lazy
O(n) replicate n x is a ByteString of length n with x the value of every element.
replicate :: Int -> Word8 -> ByteString
bytestring Data.ByteString
O(n) replicate n x is a ByteString of length n with x the value of every element. The following holds: > replicate w c = unfoldr w (\u -> Just (u,u)) c This implemenation uses memset(3)
snoc :: ByteString -> Word8 -> ByteString
bytestring Data.ByteString
O(n) Append a byte to the end of a ByteString
snoc :: ByteString -> Word8 -> ByteString
bytestring Data.ByteString.Lazy
O(n\c)/ Append a byte to the end of a ByteString
scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
scanl is similar to foldl, but returns a list of successive reduced values from the left. This function will fuse. > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] Note that > last (scanl f z xs) == foldl f z xs.
scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString
bytestring Data.ByteString
scanr is the right-to-left dual of scanl.
genericLength :: Num i => [b] -> i
base Data.List
The genericLength function is an overloaded version of length. In particular, instead of returning an Int, it returns any type which is an instance of Num. It is, however, less efficient than length.
split :: Word8 -> ByteString -> [ByteString]
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
O(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e. > split '\n' "a\nb\nd\ne" == ["a","b","d","e"] > split 'a' "aXaXaXa" == ["","X","X","X",""] > split 'x' "x" == ["",""] and > intercalate [c] . split c == id > split == splitWith . (==) As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString
bytestring Data.ByteString.Lazy
O(n) The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call.
unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString
bytestring Data.ByteString
O(n), unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is the next byte in the string, and b is the seed value for further production. Examples: > unfoldr (\x -> if x <= 5 then Just (x, x + 1) else Nothing) 0 > == pack [0, 1, 2, 3, 4, 5]

Show more results