| Shields, M., Peyton Jones, S.: Object-oriented style overloading for Haskell. In: First Workshop on Multi-language Inferastructure and Interoperability (BABEL '01), Firenze, Italy. (2001) |
.... style polymorphic type system, beginning with Kaes [33] and Wadler and Blott [49] and later picked up, refined, and implemented by many others [40, 5, 39, 3, 26, 42, 15, 27, 29, 43, 35, 31] In particular, recent work is pushing hard the borders of complete and decidable type inference [45, 46]. In the face of this plethora, we only consider the most closely related work here. The work of Jones [27] and its extension to constructor classes [26] provides a general framework for type inference with qualified types which (still) subsumes the facilities present in Haskell 98. The framework ....
....value definitions. They have open kinds (corresponding to an open world theory) as well as closed kinds (sic) but they provide a fixed type inference engine for their language. In contrast, we specify a parameterized modular type inference system based on HM(X) Shields and Peyton Jones [46] discuss various ad hoc extensions of Haskell s type system with the goal of exploring the design space. The main thrust of their extensions is the interoperability between Haskell and the object oriented language C . In particular, they present an encoding of subtyping, ad hoc overloading in a ....
M. Shields and S. Peyton Jones. Object-oriented style overloading for Haskell. In BABEL '01. First Workshop on Multi-Language Infrastructure and Interoperability, Florence, Italy, Sept. 2001.
....complicated than the corresponding object oriented problem. In Section 4.4 we tackle this issue head on, giving a precise story about when and how overloading is resolved in the presence of overlap. These extensions have subtle implications for type inference, as we discuss in the full paper [24]. The full paper also contains a formal description of type checking and type inference to complement the informal explanations used here. Our extensions generalise Haskell s existing quali ed types [12] For example, Haskell s negation function has type: negate : Num a) a a This type ....
....the class heirarchy, but this fails for classes with more than one superclass. Another approach is to use rst class existentials and class constraints [10] but Haskell only allows existentials to be introduced by a data constructor, which defeats the purpose of this encoding. In the full paper [24] we consider these options more fully, and explain why they are inadequate for our purposes. We also consider adding full subtyping to Haskell. The encoding we adopt is as follows. For each C ] class C we generate (a) a Haskell type C, and (b) a Haskell type class SubC. Thus: newtype C class ....
Shields, M., and Peyton Jones, S. Object-oriented style overloading for Haskell. Tech. rep., Microsoft Research, Cambridge, Aug. 2001. Available at http://www.cse.ogi.edu/~mbs/pub/overloading/overloading.ps. 20
....8 For example, we may have within Lists.hsi the declarations: 8 Neither of these constructs make sense within arbitrary records. Allowing open anywhere leads to unsoundness for the same reason given in Section 4.2. Allowing instance declarations anywhere leads to local instance declarations [19] and would be a profound change to Haskell s type class system. 9 open llen : exists a . forall b . List b a isGT : Int llen res Bool instance eqList : Eq a = Eq (List a) Here we declare a function llen to calculate an abstract representation of a list s length which function ....
....invaluable design tool. At the time of writing we have only just begun to establish the usual soundness and completeness properties. We hope to transfer these ideas into GHC, an industrialstrength Haskell compiler. We have also begun to explore an extension of our system with method constraints [19], and believe this provides an expressive framework for interfaceoriented programming. Acknowledgements We thank Claudio Russo for useful discussions. ....
M. Shields and S. Peyton Jones. Object-oriented style overloading for Haskell. In First Workshop on Multi-language Inferastructure and Interoperability (BABEL'01), Firenze, Italy, Sept. 2001. A Type Checking This section gives a brief overview of type checking for an idealized Haskell with our extensions. We oer this without any proofs of correctness: A proper account is in preparation.
No context found.
Shields, M., Peyton Jones, S.: Object-oriented style overloading for Haskell. In: First Workshop on Multi-language Inferastructure and Interoperability (BABEL '01), Firenze, Italy. (2001)
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC