Interactive type debugging in Haskell

  • Authors:
  • Peter J. Stuckey;Martin Sulzmann;Jeremy Wazny

  • Affiliations:
  • The University of Melbourne, Vic., Australia;National University of Singapore, S16 Level 5, Singapore;The University of Melbourne, Vic., Australia

  • Venue:
  • Haskell '03 Proceedings of the 2003 ACM SIGPLAN workshop on Haskell
  • Year:
  • 2003

Quantified Score

Hi-index 0.01

Visualization

Abstract

In this paper we illustrate the facilities for type debugging of Haskell programs in the Chameleon programming environment. Chameleon provides an extension to Haskell supporting advanced and programmable type extensions. Chameleon maps the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to find minimal justifications of type errors, and to explain unexpected types that arise. Through an interactive process akin to declarative debugging, a user can track down exactly where a type error occurs. The approach handles Hindley/Milner types with Haskell-style overloading. The Chameleon system provides a full implementation of our flexible type debugging scheme which can be used as a front-end to any existing Haskell system.