Re: Control.Exception

2008-11-05 Thread Simon Marlow
for Control.Exception - would you (or someone else) like to write and submit a patch? Or failing that, just putting it on the wiki would be useful too. I don't mind submitting a patch. What is the URL of the repo I should download? http://darcs.haskell.org/packages/base and the file is Control

Re: Control.Exception

2008-11-04 Thread Jason Dagit
On Tue, Nov 4, 2008 at 2:47 AM, Simon Marlow [EMAIL PROTECTED] wrote: Jason Dagit wrote: Thanks. This helps a lot. Mind if I put it somewhere, such as on the wiki? A good description of how to deal with exceptions would be great to have in the Haddock documentation for Control.Exception

Re: Control.Exception

2008-11-04 Thread Simon Marlow
distinguish two kinds of exception handling: Thanks. This helps a lot. Mind if I put it somewhere, such as on the wiki? A good description of how to deal with exceptions would be great to have in the Haddock documentation for Control.Exception - would you (or someone else) like to write

Re: Control.Exception

2008-11-04 Thread shelarcy
On Tue, 04 Nov 2008 19:41:58 +0900, Duncan Coutts [EMAIL PROTECTED] wrote: action `catches` [ \(e :: ExitCode) - ... , \(e :: PatternMatchFail) - ... ] or just by using multiple catch clauses: action `catch` (\(e :: ExitCode) - ...) `catch` (\(e ::

Re: Control.Exception

2008-11-03 Thread Simon Marlow
Jason Dagit wrote: On Wed, Oct 8, 2008 at 1:19 AM, Simon Marlow [EMAIL PROTECTED] wrote: Johannes Waldmann wrote: with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous type variable `e' in the constraint: `Control.Exception.Exception e'

Re: Control.Exception

2008-11-03 Thread Jason Dagit
On Mon, Nov 3, 2008 at 6:24 AM, Simon Marlow [EMAIL PROTECTED] wrote: Jason Dagit wrote: On Wed, Oct 8, 2008 at 1:19 AM, Simon Marlow [EMAIL PROTECTED] wrote: Johannes Waldmann wrote: with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous

Re: Control.Exception

2008-11-03 Thread Antoine Latter
On Mon, Nov 3, 2008 at 9:34 AM, Jason Dagit [EMAIL PROTECTED] wrote: Ah, but I had one more question that I don't think anyone has answered yet. That is, how to deal with multiple types of exceptions. Suppose, as a concrete example, that I was looking out for both ExitCode and

Re: Control.Exception

2008-11-03 Thread Duncan Coutts
On Mon, 2008-11-03 at 09:26 -0800, Sigbjorn Finne wrote: On 11/3/2008 07:34, Jason Dagit wrote: Ah, but I had one more question that I don't think anyone has answered yet. That is, how to deal with multiple types of exceptions. Suppose, as a concrete example, that I was looking

Re: Control.Exception

2008-11-03 Thread Sigbjorn Finne
On 11/3/2008 07:34, Jason Dagit wrote: Ah, but I had one more question that I don't think anyone has answered yet. That is, how to deal with multiple types of exceptions. Suppose, as a concrete example, that I was looking out for both ExitCode and PatternMatchFail exceptions. Maybe I'm

Re: Control.Exception

2008-11-03 Thread David Menendez
On Mon, Nov 3, 2008 at 12:53 PM, Duncan Coutts [EMAIL PROTECTED] wrote: On Mon, 2008-11-03 at 09:26 -0800, Sigbjorn Finne wrote: One way to do this now is to use Control.Exception.catches: catches :: IO a - [Handler a] - IO a data Handler a where Handler :: forall a e. (Exception e) =

Re: Control.Exception

2008-11-03 Thread shelarcy
On Tue, 04 Nov 2008 07:40:50 +0900, David Menendez [EMAIL PROTECTED] wrote: ie: action `catches` [ \(e :: ExitCode) - ... , \(e :: PatternMatchFail) - ... ] or just by using multiple catch clauses: action `catch` (\(e :: ExitCode) - ...) `catch` (\(e :: PatternMatchFail) -

Re: Control.Exception

2008-11-03 Thread David Menendez
On Mon, Nov 3, 2008 at 7:27 PM, shelarcy [EMAIL PROTECTED] wrote: On Tue, 04 Nov 2008 07:40:50 +0900, David Menendez [EMAIL PROTECTED] wrote: ie: action `catches` [ \(e :: ExitCode) - ... , \(e :: PatternMatchFail) - ... ] or just by using multiple catch clauses: action

Re: Control.Exception

2008-11-02 Thread Thomas Schilling
I think the best way to get backwards compatibility is to flesh out and use the extensible-exceptions package that Ian started, which models extensible exceptions on top of the old exception mechanism. Alternatively, you can decide not to use extensible exceptions and have your package depend on

Re: Control.Exception

2008-11-02 Thread Duncan Coutts
On Sat, 2008-11-01 at 19:09 -0700, Sigbjorn Finne wrote: (+1) to that request - what is the best practices for portable exception handling code that straddles version 6.10, i.e. that compiles with compilers at either side with minimal fuss? I can imagine a couple of alternatives, but would

Re: Control.Exception

2008-11-01 Thread Jason Dagit
On Wed, Oct 8, 2008 at 1:19 AM, Simon Marlow [EMAIL PROTECTED] wrote: Johannes Waldmann wrote: with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous type variable `e' in the constraint: `Control.Exception.Exception e' It is probably

Re: Control.Exception

2008-11-01 Thread Sigbjorn Finne
(+1) to that request - what is the best practices for portable exception handling code that straddles version 6.10, i.e. that compiles with compilers at either side with minimal fuss? I can imagine a couple of alternatives, but would like to hear what others are doing here. thanks --sigbjorn

Re: Control.Exception

2008-10-08 Thread Simon Marlow
Johannes Waldmann wrote: with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous type variable `e' in the constraint: `Control.Exception.Exception e' It is probably bad programming style anyway but what is the workaround? As long as you're

Control.Exception

2008-10-07 Thread Johannes Waldmann
with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous type variable `e' in the constraint: `Control.Exception.Exception e' It is probably bad programming style anyway but what is the workaround? I found some references (in list emails) to

Re: Control.Exception

2008-10-07 Thread Thomas Schilling
2008/10/7 Johannes Waldmann [EMAIL PROTECTED]: with 6.10, the following does not typecheck: foo `Control.Exception.catch` \ _ - return bar Ambiguous type variable `e' in the constraint: `Control.Exception.Exception e' catch \(e :: SomeException) - ... This requires language

Re: Control.Exception

2008-10-07 Thread Johannes Waldmann
catch \(e :: SomeException) - ... So, this changes the API (from 6.8 to 6.10)? I see there is Control.OldException (providing the old catch) but that still does not help me if I want my code compile with both 6.8 and 6.10. Is there some version of catch that works both ways? best regards,

Re: Control.Exception

2008-10-07 Thread Duncan Coutts
On Tue, 2008-10-07 at 20:50 +0200, Johannes Waldmann wrote: catch \(e :: SomeException) - ... So, this changes the API (from 6.8 to 6.10)? I see there is Control.OldException (providing the old catch) but that still does not help me if I want my code compile with both 6.8 and 6.10. Is

Re: Control.Exception

2008-10-07 Thread Ian Lynagh
On Tue, Oct 07, 2008 at 12:54:55PM -0700, Duncan Coutts wrote: On Tue, 2008-10-07 at 20:50 +0200, Johannes Waldmann wrote: catch \(e :: SomeException) - ... So, this changes the API (from 6.8 to 6.10)? I see there is Control.OldException (providing the old catch) but that still