I can also make a case for:
findM'' :: (Monad m) => (a -> Bool) -> [m a] -> m a findM'' p [] = fail "findM'': not found" findM'' p (x:xs) = p x >>= \b -> if b then return x else findM'' p xs
The last line doesn't seem to compile. Don't you mean
findM'' p (x:xs) = x >>= \b -> if p b then return b else findM'' p xs
instead?
Sam
_______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
