On 29-Sep-1999, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote:
> I only don't like the details about IOError. It's not extensible
> and Dynamic is still not nice. I have no idea how to make it
> better. Probably some general way of making extensible datatypes.
Could you explain what you don
On 29-Sep-1999, George Russell <[EMAIL PROTECTED]> wrote:
> Fergus Henderson wrote:
> [many interesting things which are snipped]
> > There are many common examples where exceptions arise for reasons other
> > than I/O, for example integer overflow, division by zero, taking the
> > square root of
Thu, 30 Sep 1999 02:08:23 +1000, Fergus Henderson <[EMAIL PROTECTED]> pisze:
> > I only don't like the details about IOError. It's not extensible
> > and Dynamic is still not nice. I have no idea how to make it
> > better. Probably some general way of making extensible datatypes.
>
> Could you e
Fergus Henderson wrote:
[snip]
> So why limit expressiveness by providing only the former?
Why indeed? You are right. I hadn't realised that
a -> IO (Maybe a)
would still suffer from non-determinism.
(Because if you have
x = error "foo" + _|_
it may cause a return of Nothing or else no
Alastair Reid wrote:
> [discussion of Dynamic library, etc deleted]
>
> [...]
>
> If Haskell supported extensible datatypes, it would be easy to define a
> hierarchy of exception values. For example, the attached pseudocode
> creates a hierarchy like this:
>
> IOError
> Win32Error
>
Fergus Henderson wrote:
[snip]
> SML's exception mechanism essentially forces sequential execution,
> and (I think) causes problems for equational reasoning.
> Haskell's exception mechanism preserves referential transparency
> and gives the compiler more freedom to reorder and/or parallelize code.
A Void" (the French title would translate as
"The Disappearance", but that contains e's).
It's a fantastic book! I highly recommend it.
Nikhil
> -Original Message-
> From: Jan Skibinski [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 29, 1999 10:06
Wed, 29 Sep 1999 11:43:06 +0200, George Russell <[EMAIL PROTECTED]> pisze:
> When that happens in my code it counts as a bug! Therefore error
> is appropriate. If you are in some larger Haskell universe calling
> component Haskell code it is unfortunate if a single error calls the
> entire univ
Fergus Henderson wrote:
[many interesting things which are snipped]
> There are many common examples where exceptions arise for reasons other
> than I/O, for example integer overflow, division by zero, taking the
> square root of a negative number, head of an empty list, and so forth.
When that ha
On 29 Sep 1999, Marcin 'Qrczak' Kowalczyk wrote:
> Wed, 29 Sep 1999 11:43:06 +0200, George Russell <[EMAIL PROTECTED]> pisze:
>
> > When that happens in my code it counts as a bug! Therefore error
> > is appropriate. If you are in some larger Haskell universe calling
> > component Haskell co
On 28-Sep-1999, Alastair Reid <[EMAIL PROTECTED]> wrote:
>
> > > > (b) allow throwing and catching of dynamically typed values,
> > > > e.g. using an interface like the Hugs/ghc Dynamic library
>
> [discussion of Dynamic library, etc deleted]
>
> [The following is a bit of a straw-man: it d
On 28-Sep-1999, Alastair Reid <[EMAIL PROTECTED]> wrote:
>
> Fergus Henderson <[EMAIL PROTECTED]> replied:
> > What existing functions for testing IOErrors?
> > Apart from the Eq and Show classes, Haskell 98 doesn't define any, AFAIK.
>
> The IO library defines these functions.
> (http://haskell
On 28-Sep-1999, George Russell <[EMAIL PROTECTED]> wrote:
> I must be missing something. Isn't it blindlingly obvious that
> here SML's exception mechanism is streets ahead of Haskell's? Please,
> what am I missing? Is there some lurking type-unsafeness?
SML's exception mechanism essentially f
On 08-Sep-1999, Alastair Reid <[EMAIL PROTECTED]> wrote:
>
> I recently had occasion to write this function:
>
> -- do a, if that fails do b, if that fails, raise b's exception
> (?) :: IO a -> IO a -> IO a
> a ? b = a `catch` \_ -> b
>
> Simple enough, but if b fails, I don't really wan
Fergus Henderson wrote:
[snip]
> What existing functions for testing IOErrors?
> Apart from the Eq and Show classes, Haskell 98 doesn't define any, AFAIK.
> If you're suggesting that Eq or Show be undefined for IOErrors that
> represent sets of exceptions, then I would have to disagree...
I must b
> > > (b) allow throwing and catching of dynamically typed values,
> > > e.g. using an interface like the Hugs/ghc Dynamic library
[discussion of Dynamic library, etc deleted]
[The following is a bit of a straw-man: it doesn't quite work but
may have good parts which can be used in other de
> On 08-Sep-1999, Alastair Reid <[EMAIL PROTECTED]> wrote:
> > What
> > I'd like (in some future version of Haskell) is an IOError constructor
> > which lets me merge two IOErrors together and appropriate operations
> > to test for it and, perhaps, take it apart:
Fergus Henderson <[EMAIL PROTECT
I recently had occasion to write this function:
-- do a, if that fails do b, if that fails, raise b's exception
(?) :: IO a -> IO a -> IO a
a ? b = a `catch` \_ -> b
Simple enough, but if b fails, I don't really want to raise b's
exception, I want to raise both a's exception and b's exce
18 matches
Mail list logo