elemIndex -containers

elemIndex :: Eq a => a -> [a] -> Maybe Int
base Data.List
The elemIndex function returns the index of the first element in the given list which is equal (by ==) to the query element, or Nothing if there is no such element.
elemIndex :: Char -> ByteString -> Maybe Int
bytestring Data.ByteString.Char8
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.
elemIndex :: Char -> ByteString -> Maybe Int64
bytestring Data.ByteString.Lazy.Char8
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.
elemIndex :: Word8 -> ByteString -> Maybe Int
bytestring Data.ByteString
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).
elemIndex :: Word8 -> ByteString -> Maybe Int64
bytestring Data.ByteString.Lazy
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).
elemIndexEnd :: Char -> ByteString -> Maybe Int
bytestring Data.ByteString.Char8
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 == > (-) (length xs - 1) `fmap` elemIndex c (reverse xs)
elemIndexEnd :: Word8 -> ByteString -> Maybe Int
bytestring Data.ByteString
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 == > (-) (length xs - 1) `fmap` elemIndex c (reverse xs)