Ord a => [a] -> [a] -base +bytestring
O(n) Concatenate a list of ByteStrings.
unlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each.
The group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
> group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test.
The group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
> group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test. It is about 40% faster than groupBy (==)
O(n) Return all initial segments of the given ByteString, shortest first.
lines breaks a ByteString up into a list of ByteStrings at newline Chars. The resulting strings do not contain newlines.
lines breaks a ByteString up into a list of ByteStrings at newline Chars. The resulting strings do not contain newlines.
As of bytestring 0.9.0.3, this function is stricter than its list cousin.
O(n) Return all final segments of the given ByteString, longest first.
words breaks a ByteString up into a list of words, which were delimited by Chars representing white space.
words breaks a ByteString up into a list of words, which were delimited by Chars representing white space. And
> tokens isSpace = words
O(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list.
The groupBy function is the non-overloaded version of group.
O(n) Splits a ByteString into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
> splitWith (=='a') "aabbaca" == ["","","bb","c",""]
> splitWith (=='a') [] == []
The groupBy function is the non-overloaded version of group.
O(n) Splits a ByteString into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
> splitWith (=='a') "aabbaca" == ["","","bb","c",""]
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.
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.
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.
O(n) Make a copy of the ByteString with its own storage. This is mainly useful to allow the rest of the data pointed to by the ByteString to be garbage collected, for example if a large string has been read in, and only a small part of it is needed in the rest of the program.
cycle ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString.
O(1) Return all the elements of a ByteString except the last one. An exception will be thrown in the case of an empty ByteString.
O(n\c)/ Return all the elements of a ByteString except the last one.
O(n) reverse xs efficiently returns the elements of xs in reverse order.
O(n) reverse xs returns the elements of xs in reverse order.
O(n) Sort a ByteString efficiently, using counting sort.
O(1) Extract the elements after the head of a ByteString, which must be non-empty.
O(1) Extract the elements after the head of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString.
A variety of tail for non-empty ByteStrings. unsafeTail omits the check for the empty case. As with unsafeHead, the programmer must provide a separate proof that the ByteString is non-empty.
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right.
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right.
This function is subject to array fusion.
'foldl\'' is like foldl, but strict in the accumulator.
'foldl\'' is like foldl, but strict in the accumulator. However, for ByteStrings, all left folds are strict in the accumulator.
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right.
'foldl\'' is like foldl, but strict in the accumulator.
foldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left.
'foldr\'' is like foldr, but strict in the accumulator.
Show more results