elem package:bytestring

O(n) elem is the ByteString membership predicate.
O(n) elem is the ByteString membership predicate. This implementation uses memchr(3).
O(n) elem is the ShortByteString membership predicate.
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 elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).
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)
O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.
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 elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).
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)
O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.
O(n) The elemIndex function returns the index of the first element in the given ShortByteString which is equal to the query element, or Nothing if there is no such element.
O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.
O(n) notElem is the inverse of elem
O(n) notElem is the inverse of elem