
Indeed! I always use braces and semicolons with do-notation. You are free to do so too! Nothing requires you to use layout. Indeed, you can freely mix the two. Simon | -----Original Message----- | From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Joel | Reymont | Sent: 16 November 2005 15:37 | To: Haskell Cafe | Subject: [Haskell-cafe] Re: IO exception not being caught | | After almost two months with Haskell I'm starting to understand why | its use is not as widespread as... well pick a favorite language of | your own. My issue was that of indentation. | | Compare this working version: | | liftIOTrap io = | do mx <- liftIO (do x <- io | return (return x) | `catchError` | (\e -> do let x = fromIOError e | trace_ $ "Caught " ++ x | return $ throwError x | )) | mx | | With the one below | | On Nov 16, 2005, at 2:27 PM, Joel Reymont wrote: | | >> liftIOTrap io = | >> do mx <- liftIO (do x <- io | >> return (return x) | >> `catchError` | >> (\e -> return (throwError | >> (fromIOError e)))) | >> mx | | -- | http://wagerlabs.com/ | | | | | | _______________________________________________ | Haskell-Cafe mailing list | Haskell-Cafe@haskell.org | http://www.haskell.org/mailman/listinfo/haskell-cafe