Why no exceptions in Haskell?
Marcin 'Qrczak' Kowalczyk
Fri, 23 Nov 2001 22:34:22 +0000 (UTC)
Fri, 23 Nov 2001 07:12:10 +1100, Fergus Henderson <email@example.com> pisze:
> ... and the main reason why Haskell 98 didn't incorporate this is because,
> well, 98 was before 99 ;-).
In order for exceptions to be practical, one should be able to throw
other types than the builtin IOError which roughly corresponds to
errno in C. In GHC Dynamic is used for this. IMHO exceptions should
not be standarized without such capability.
I don't like Dynamic much but no other solution has been designed
for Haskell. Maybe some kind of extensible datatypes would be better,
preferably not limited to exceptions. It has other problems though,
for example how to define functions like (==) for extensible datatypes?
A static type system sometimes do get in the way! Python people have
some right in saying this. (But IMHO they are wrong in saying that
very small amount of errors is catched by static typing.)
__("< Marcin Kowalczyk * firstname.lastname@example.org http://qrczak.ids.net.pl/