Date: 29 April 03
Chameleon is a Haskell-style language where overloading resolution is expressed in terms of Constraint Handling Rules (CHRs). CHRs can be used to program almost arbitrary type extensions. In fact, the whole type inference process is phrased in terms of CHR solving. This allows for a powerful type debugging mechanism. We present several examples to support the flexibility of our approach.
Links related to
A number of previous works have shown that embedding Regular Expression Type and Pattern Matching features into a general purpose language, like Haskell, is a complex task. Main obstacles are often found in finding a faithful type encoding to XML and deriving a type inference mechanism over patterns. We present a solution to these problems, by encoding regular expression types in an intermediate language, Chameleon. In our approach, we are not only able to overcome these obstacles, but also enjoy a performance gain by program specialization that is based on static type information.
We present a type-safe embedding of Constraint-Handling Rules (CHRs) into Haskell. CHRs operate on Haskell data structures. The novelty of our approach lies in employing the Haskell type class system to automatically generate type safe versions of CHRs. In our current implementation, CHRs must be monomorphically typed. Furthermore, we are only able to "call" CHRs from Haskell. In future work, we plan to lift both restrictions. That is, CHRs can be polymorphic and "call" Haskell functions. We present some preliminary results.