Control.Exception

shelarcy shelarcy at gmail.com
Mon Nov 3 19:27:13 EST 2008


On Tue, 04 Nov 2008 07:40:50 +0900, David Menendez <dave at zednenem.com> wrote:
>> ie:
>>
>> action
>>  `catches`
>>    [ \(e :: ExitCode) -> ...
>>    , \(e :: PatternMatchFail) -> ...
>>    ]
>>
>> or just by using multiple catch clauses:
>>
>> action
>>  `catch` (\(e :: ExitCode) -> ...)
>>  `catch` (\(e :: PatternMatchFail) -> ...)
>
> I don't think those are equivalent. In the second case, the
> PatternMatchFail handler scopes over the ExitCode handler.

I think Duncan forgot to write parens. According to Ian's example,
here is an equivalent code.

(action
  `catch` (\(e :: ExitCode) -> ...))
  `catch` (\(e :: PatternMatchFail) -> ...)

http://www.haskell.org/pipermail/libraries/2008-July/010095.html


Best Regards,

-- 
shelarcy <shelarcy    hotmail.co.jp>
http://page.freett.com/shelarcy/


More information about the Glasgow-haskell-users mailing list