Catch me if you can: looking for type-safe, hierarchical, lightweight, polymorphic and efficient error management in OCaml

  • Authors:
  • David Teller;Arnaud Spiwack;Till Varoquaux

  • Affiliations:
  • LIFO, Université d'Orléans;LIX, École Polytechnique;-

  • Venue:
  • IFL'08 Proceedings of the 20th international conference on Implementation and application of functional languages
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

This is the year 2008 and ML-style exceptions are everywhere. Most modern languages, whether academic or industrial, feature some variant of this mechanism. Languages such as Java even feature static coverage-checking for such exceptions, something not available for ML languages, at least not without resorting to external tools. In this document, we demonstrate a design principle and a tiny library for managing errors in a functional manner, with static coveragechecking, automatically-inferred, structurally typed and hierarchical exceptional cases, with a reasonable run-time penalty. Our work is based on OCaml and features monads, polymorphic variants, compile-time code rewriting and trace elements of black magic.