index package:bytestring

O(1) ByteString index (subscript) operator, starting from 0. This is a partial function, consider using indexMaybe instead.
O(1) ByteString index (subscript) operator, starting from 0.
O(c) ByteString index (subscript) operator, starting from 0. This is a partial function, consider using indexMaybe instead.
O(1) ByteString index (subscript) operator, starting from 0.
O(1) ShortByteString index (subscript) operator, starting from 0. This is a partial function, consider using indexMaybe instead.
O(1) ByteString index, starting from 0, that returns Just if:
0 <= n < length bs
O(1) ByteString index, starting from 0, that returns Just if:
0 <= n < length bs
O(c) ByteString index, starting from 0, that returns Just if:
0 <= n < length bs
O(1) ByteString index, starting from 0, that returns Just if:
0 <= n < length bs
O(1) ShortByteString index, starting from 0, that returns Just if:
0 <= n < length bs
O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal to the query element, or Nothing if there is no such element. This implementation uses memchr(3).
O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs = case elemIndex c (reverse xs) of
Nothing -> Nothing
Just i  -> Just (length xs - 1 - i)
O(n) The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.
O(n) The findIndexEnd function takes a predicate and a ByteString and returns the index of the last element in the ByteString satisfying the predicate.
O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal (by memchr) to the query element, or Nothing if there is no such element.
O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs = case elemIndex c (reverse xs) of
Nothing -> Nothing
Just i  -> Just (length xs - 1 - i)
The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.
O(n) The findIndexEnd function takes a predicate and a ByteString and returns the index of the last element in the ByteString satisfying the predicate.
findIndexOrLength is a variant of findIndex, that returns the length of the string if no element is found, rather than Nothing.
O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal to the query element, or Nothing if there is no such element. This implementation uses memchr(3).
O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs = case elemIndex c (reverse xs) of
Nothing -> Nothing
Just i  -> Just (length xs - 1 - i)
The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.
The findIndexEnd function takes a predicate and a ByteString and returns the index of the last element in the ByteString satisfying the predicate.
O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal (by memchr) to the query element, or Nothing if there is no such element.
O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs = case elemIndex c (reverse xs) of
Nothing -> Nothing
Just i  -> Just (length xs - 1 - i)