On 9/13/06, Henning Thielemann <[EMAIL PROTECTED]> wrote:
If you want more sugar, what about the list monad?

main = do
         args <- getArgs
         sequence_ $
           do arg <- args
              n <- [1..3]
              return (putStrLn $ show n ++ ") " ++ arg)

Or, what about using ListT to combine it with IO, eliminating the need for
two separate `do' blocks?

main = (>> return ()) $ runListT $ do
        arg <- ListT getArgs
        n <- ListT $ return [1..3]
        liftIO $ putStrLn ((show n) ++ ") " ++ arg)

Mike
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to