
11 Nov
2003
11 Nov
'03
6:31 p.m.
Andrew J Bromage wrote:
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