Skip to main content

Type Class Directives

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3350))

Included in the following conference series:

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. McAdam, B.: How to repair type errors automatically. In: 3rd Scottish Workshop on Functional Programming, Stirling, U.K., pp. 121–135 (2001)

    Google Scholar 

  2. Yang, J., Michaelson, G., Trinder, P.: Explaining polymorphic types. The Computer Journal 45, 436–452 (2002)

    Article  MATH  Google Scholar 

  3. Haack, C., Wells, J.B.: Type error slicing in implicitly typed higher-order languages. In: Proceedings of the 12th European Symposium on Programming, pp. 284–301 (2003)

    Google Scholar 

  4. Stuckey, P., Sulzmann, M., Wazny, J.: Interactive type debugging in Haskell. In: Haskell Workshop, pp. 72–83. ACM Press, New York (2003)

    Chapter  Google Scholar 

  5. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003), http://www.haskell.org/onlinereport/

    Google Scholar 

  6. Heeren, B., Hage, J., Swierstra, S.D.: Scripting the type inference process. In: Eighth ACM Sigplan International Conference on Functional Programming, pp. 3–13. ACM Press, New York (2003)

    Chapter  Google Scholar 

  7. Heeren, B., Leijen, D., van IJzendoorn, A.: Helium, for learning Haskell. In: ACM Sigplan 2003 Haskell Workshop, pp. 62–71. ACM Press, New York (2003), http://www.cs.uu.nl/helium

    Chapter  Google Scholar 

  8. Jones, M.P.: Simplifying and improving qualified types. In: International Conference on Functional Programming Languages and Computer Architecture, pp. 160–169 (1995)

    Google Scholar 

  9. Milner, R.: A theory of type polymorphism in programming. Journal of Computer and System Sciences 17, 348–375 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  10. Jones, M.P.: Typing Haskell in Haskell. In: Haskell Workshop (1999)

    Google Scholar 

  11. Wand, M.: Finding the source of type errors. In: Conference Record of the 13th Annual ACM Symposium on Principles of Programming Languages, St. Petersburg, FL, pp. 38–43 (1986)

    Google Scholar 

  12. Walz, J.A., Johnson, G.F.: A maximum flow approach to anomaly isolation in unification-based incremental type inference. In: Conference Record of the 13th Annual ACM Symposium on Principles of Programming Languages, St. Petersburg, FL, pp. 44–57 (1986)

    Google Scholar 

  13. Shields, M., Peyton Jones, S.: Object-oriented style overloading for Haskell. In: Workshop on Multi-Language Infrastructure and Interoperability, BABEL 2001 (2001)

    Google Scholar 

  14. Glynn, K., Stuckey, P., Sulzmann, M.: Type classes and constraint handling rules. In: First Workshop on Rule-Based Constraint Reasoning and Programming (2000)

    Google Scholar 

  15. Findler, R.B., Clements, J., Cormac Flanagan, M.F., Krishnamurthi, S., Steckler, P., Felleisen, M.: DrScheme: A programming environment for Scheme. Journal of Functional Programming 12, 159–182 (2002)

    Article  MATH  Google Scholar 

  16. Peyton Jones, S., Jones, M., Meijer, E.: Type classes: an exploration of the design space. In: Haskell Workshop (1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Heeren, B., Hage, J. (2005). Type Class Directives. In: Hermenegildo, M.V., Cabeza, D. (eds) Practical Aspects of Declarative Languages. PADL 2005. Lecture Notes in Computer Science, vol 3350. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30557-6_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30557-6_19

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-24362-5

  • Online ISBN: 978-3-540-30557-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics