Type Class Directives

The goal of this paper is to improve the type error messages in the presence of Haskell 98 type classes, in particular for the non-expert user. As a language feature, type classes are very pervasive, and strongly influence what is reported and when, even in relatively simple programs. We propose four type class directives, and specialized type rules, to lend high-level support to compilers to improve the type error messages. Both have been implemented, and can be used to easily modify the behavior of the type inference process.

[1]  Matthias Felleisen,et al.  DrScheme: a programming environment for Scheme , 2002, J. Funct. Program..

[2]  Gregory F. Johnson,et al.  A maximum-flow approach to anomaly isolation in unification-based incremental type inference , 1986, POPL '86.

[3]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[4]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[5]  Simon L. Peyton Jones,et al.  Object-Oriented Style Overloading for Haskell , 2001, BABEL.

[6]  Peter J. Stuckey,et al.  Type Classes and Constraint Handling Rules , 2000, ArXiv.

[7]  Christian Haack,et al.  Type error slicing in implicitly typed higher-order languages , 2003, Sci. Comput. Program..

[8]  Simon Peyton Jones,et al.  Type classes: an exploration of the design space , 1997 .

[9]  Bruce J. McAdam How to Repair Type Errors Automatically , 2001, Scottish Functional Programming Workshop.

[10]  Phil Trinder,et al.  Explaining Polymorphic Types , 2002, Comput. J..

[11]  Mark P. Jones,et al.  Typing Haskell in Haskell , 1999 .

[12]  Daan Leijen,et al.  Helium, for learning Haskell , 2003, Haskell '03.

[13]  Mark P. Jones Simplifying and improving qualified types , 1995, FPCA '95.

[14]  Peter J. Stuckey,et al.  Interactive type debugging in Haskell , 2003, Haskell '03.

[15]  Jurriaan Hage,et al.  Scripting the type inference process , 2003, ACM SIGPLAN Notices.

[16]  Mitchell Wand Finding the source of type errors , 1986, POPL '86.