On Sat, May 02, 2009 at 05:31:03PM +0100, Paul Keir wrote:
> An example immediately follows that quotation on the wiki:
>
> do text <- getLine
> if null text
> then putStrLn "You refuse to enter something?"
> else putStrLn ("You entered " ++ text)
Then, how about
getMyLine = getLine >>= \text ->
if null text then getMyLine else return m
Can you, using functors, decide to run 'getLine' again or not?
HTH,
--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe