elemIndex package:base-prelude

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 4 [0..]
Just 4