On Mon, Mar 10, 2008 at 11:11 PM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > outputLines i = mapM (putStrLn . show) (take i $ iterate ((+) 1) 1) > > However, this is in fact > outputLines :: Int -> IO [()]
As others suggested you can use mapM_ Furthermore, you can simplify it a bit with some syntactic sugar outputLines i = mapM_ (putStrLn . show) [1..i] BTW, considering how often is (putStrLn.show) used, it is surprising that there is no Ln variant for print (just like it happens with putStr and putStrLn) _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
