An Extensible Dynamically-Typed Hierarchy of Exceptions

Simon Marlow

Abstract

In this paper we address the lack of extensibility of the exception type in Haskell. We propose a lightweight solution involving the use of existential types and the Typeable class only and show how our solution allows a fully extensible hierarchy of exception types to be declared, in which a single overloaded catch operator can be used to catch either specific exception types, or exceptions belonging to any subclass in the hierarchy. We also show how to combine the existing object-oriented framework OOHaskell with our design, such that OOHaskell objects can be thrown and caught as exceptions, with full support for implicit OOHaskell subtyping in the

Details

Publication typeInproceedings
Published inHaskell '06: Proceedings of the 2006 ACM SIGPLAN workshop on Haskell
URLhttp://www.haskell.org/~simonmar/papers/ext-exceptions.pdf
PublisherACM Press
> Publications > An Extensible Dynamically-Typed Hierarchy of Exceptions