elemIndex -base

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)
elemIndexL :: Eq a => a -> Seq a -> Maybe Int
containers Data.Sequence
elemIndexL finds the leftmost index of the specified element, if it is present, and otherwise Nothing.
elemIndexR :: Eq a => a -> Seq a -> Maybe Int
containers Data.Sequence
elemIndexR finds the rightmost index of the specified element, if it is present, and otherwise Nothing.