findM package:xmonad-contrib

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.