:: a -> [a] -> Int

elemIndexJust op = fromJust . elemIndex op
Returns a count of the number of times the given element occured in the given list.
Like elemRIndex, but returns -1 if there is nothing found.
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. For the result to be Nothing, the list must be finite.

Examples

>>> elemIndex 4 [0..]
Just 4
>>> elemIndex 'o' "haskell"
Nothing
>>> elemIndex 0 [1..]
* hangs forever *
Returns the rightmost index of the given element in the given 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 4 [0..]
Just 4
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. For the result to be Nothing, the list must be finite.
>>> elemIndex 4 [0..]
Just 4
A generalised variant of elemIndex. O(n).
O(n) Yield Just the index of the first occurence of the given element or Nothing if the vector does not contain the element. This is a specialised version of findIndex.
Find position of a value in a list. Used to change metavar argument indices during assignment. reverse is necessary because we are directly abstracting over the list.