>>> elemIndex 4 [0..] Just 4
>>> elemIndex 'o' "haskell" Nothing
>>> elemIndex 0 [1..] * hangs forever *
elemIndexEnd c xs = case elemIndex c (reverse xs) of Nothing -> Nothing Just i -> Just (length xs - 1 - i)
elemIndexEnd c xs = case elemIndex c (reverse xs) of Nothing -> Nothing Just i -> Just (length xs - 1 - i)