[Haskell-cafe] Re: exceptions vs. Either

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Fri Aug 6 05:43:07 EDT 2004

> >After all, Java basically does exactly what you're asking for with
> Java's head/tail would be doing runtime checks if they are throwing exceptions,
> static guarantees mean the program would not be allowed to compile if it broke
> the static guarantees.

Not so.  In Java, the programmer is forced to handle most exceptions
by the type system.  That is, if the exception is not handled, the
program will not compile, thus providing a static guarantee that
exceptions are handled.

Only "unchecked exceptions" (RuntimeException and Error) are exempt
from this check.

--KW 8-)

More information about the Haskell-Cafe mailing list