[Haskell-cafe] Re: IO exception not being caught

Bulat Ziganshin bulatz at HotPOP.com
Wed Nov 16 13:32:35 EST 2005

Hello Joel,

Wednesday, November 16, 2005, 6:37:25 PM, you wrote:

JR> After almost two months with Haskell I'm starting to understand why  
JR> its use is not as widespread as... well pick a favorite language of  
JR> your own. My issue was that of indentation.

just enclose potentially problematic "do ..." in parentheses:

JR> liftIOTrap io =
JR>      do mx <- liftIO (do x <- io
JR>                          return (return x)

can be written as

do mx <- liftIO ((do x <- io
                    return (return x))

and after that you can put `catchError` to any position in the line

Best regards,
 Bulat                            mailto:bulatz at HotPOP.com

More information about the Haskell-Cafe mailing list