findM is:exact

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")
A generalization of findM to Foldable instances.
Returns the first element that satisfies the given predicate.
findM = Stream.fold Fold.findM
Returns the first element that satisfies the given predicate. Pre-release
Like find, but takes a monadic function instead; retains the short-circuiting behaviour of the non-monadic version. For example,
findM (\a -> putStr (show a <> " ") >> pure False) [1..10]
would print "1 2 3 4 5 6 7 8 9 10" and return Nothing, while
findM (\a -> putStr (show a <> " ") >> pure True) [1..10]
would print "1" and return Just 1.
Yield Just the first element that satisfies the monadic predicate or Nothing if no such element exists.