Customizable type error diagnosis has been proposed as a solution toachieve domain-specific type error diagnosis for embedded domainspecific languages. A proven approach is to phrase type inferencingas a constraint-solving problem, so that we can manipulate the orderin which constraints are solved, and associate domain-specific typeerror messages with specific constraints to be communicated to theprogrammer in case type checking fails. A major challenge in thisarea lies in scaling this idea up uniformly to a fully-featured (functional)language, that is, languages that go beyond the polymorphicλ-calculus.In this paper, we show how within the general framework ConstraintHandling Rules we can achieve such uniformity and generality,while at the same time providing the necessary type errorcustomizability in a natural way. A proof-of-concept implementationis provided for a Haskell-like language, including support for typeclasses, GADTs and higher-ranked types. However, our approach appliesto any language for which a constraint-based non-backtrackingformulation of the type system is available.
|Name||Technical Report Series|
- Constraint Handling Rules
- domain specific languages
- custom error messages
- type errors