erreta, a couple of unimportant missing words :-(

Ahn Ki-yung kyagrd@bawi.org
Wed, 20 Nov 2002 18:58:44 +0900


Ahn Ki-yung wrote:

>Simple Cat (revisitied)
>
>\begin{code}
>
>import IO
>
>findM f [] = return Nothing
>findM f (x:xs) = do { v <- x; if f v then return (Just v) else findM f xs }
>
>isLeft (Left _) = True
>isLeft _ = False
>
>main = findM (isLeft) (hCat stdin) where hCat h = try (hGetLine h) : hCat h
>
>\end{code}
>
>This is my answer for the question of my own,
>
>which is posted a couple
>  
>
of days before.

>There are mapM, filterM in the Haskell 98 Standard Library.
>
>But why no findM there ?
>
>As you can see from simple cat, it seems quite useful.
>
>I think fildM should be added to the module Monad.
>
>  
>


-- 
Ahn Ki-yung