:: Monad m => (a -> m Bool) -> [a] -> m (Maybe a) -package:xmonad-contrib

Like find, but where the test can be monadic.
findM (Just . isUpper) "teST"             == Just (Just 'S')
findM (Just . isUpper) "test"             == Just Nothing
findM (Just . const True) ["x",undefined] == Just (Just "x")
return the first value from a list, if any, satisfying the given predicate.
A generalization of findM to Foldable instances.