Skip to main content

Interface Types for Haskell

  • Conference paper
Book cover Programming Languages and Systems (APLAS 2008)

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

Included in the following conference series:

Abstract

Interface types are a useful concept in object-oriented programming languages like Java or C#. A clean programming style advocates relying on interfaces without revealing their implementation.

Haskell’s type classes provide a closely related facility for stating an interface separately from its implementation. However, there are situations in which no simple mechanism exists to hide the identity of the implementation type of a type class. This work provides such a mechanism through the integration of lightweight interface types into Haskell.

The extension is non-intrusive as no additional syntax is needed and no existing programs are affected. The implementation extends the treatment of higher-rank polymorphism in production Haskell compilers.

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. Bruce, K.B., Petersen, L., Fiech, A.: Subtyping is not a good ”match” for object-oriented languages. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 104–127. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  2. Diatchki, I.S., Jones, M.P.: Strongly typed memory areas programming systems-level data structures in a functional language. In: Löh, A. (ed.) Proceedings of the 2006 ACM SIGPLAN Haskell Workshop, Portland, Oregon, USA, pp. 72–83 (September 2006)

    Google Scholar 

  3. GHC. The Glasgow Haskell compiler (2008), http://www.haskell.org/ghc/

  4. Goerzen, J.: Haskell database connectivity (2008), http://software.complete.org/software/projects/show/hdbc

  5. Hugs 98 (2003), http://www.haskell.org/hugs/

  6. Jones, M.P.: Qualified Types: Theory and Practice. Cambridge University Press, Cambridge (1994)

    Book  MATH  Google Scholar 

  7. Jones, M.P.: First-class polymorphism with type inference. In: Jones, N. (ed.) Proc. 1997 ACM Symp. POPL, Paris, France, January 1997, pp. 483–496. ACM Press, New York (1997)

    Google Scholar 

  8. Le Botlan, D., Rémy, D.: MLF: raising ML to the power of System F. In: Shivers, O. (ed.) Proc. ICFP 2003, Uppsala, Sweden, August 2003, pp. 27–38. ACM Press, New York (2003)

    Google Scholar 

  9. Leijen, D.: HMF: Simple type inference for first-class polymorphism. In: ICFP, pp. 283–293. ACM Press, New York (2008)

    Chapter  Google Scholar 

  10. Leijen, D., Lóh, A.: Qualified types for MLF. In: Pierce [15], pp. 144–155

    Google Scholar 

  11. Läufer, K.: Type classes with existential types. J. Funct. Program. 6(3), 485–517 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  12. Odersky, M., Läufer, K.: Putting type annotations to work. In: Proc. 1996 ACM Symp. POPL, St. Petersburg, FL, USA, January 1996, pp. 54–67. ACM Press, New York (1996)

    Google Scholar 

  13. Oliveira, B., Sulzmann, M.: Objects to unify type classes and GADTs (April 2008), http://www.cs.mu.oz.au/~sulzmann/manuscript/objects-unify-type-classes-gadts.ps

  14. Peyton Jones, S., Vytiniotis, D., Weirich, S., Shields, M.: Practical type inference for arbitrary-rank types. J. Funct. Program. 17(1), 1–82 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  15. Pierce, B.C. (ed.): ICFP, Tallinn, Estonia. ACM Press, New York (2005)

    Google Scholar 

  16. PostgreSQL, the most advanced Open Source database system in the world (2008), http://www.postgresql.org

  17. Russo, C.V.: First-class structures for Standard ML. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 336–350. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  18. Rémy, D.: Simple, partial type-inference for System F based on type-containment. In: Pierce [15], pp. 130–143

    Google Scholar 

  19. Tofte, M.: Essentials of Standard ML Modules. In: Advanced Functional Programming, pp. 208–238. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  20. Vytiniotis, D., Weirich, S., Peyton Jones, S.: Boxy types: Inference for higher-rank types and impredicativity. In: Lawall, J. (ed.) Proc. ICFP 2006, Portland, Oregon, USA, Sep. 2006, pp. 251–262. ACM Press, New York (2006)

    Google Scholar 

  21. Vytiniotis, D., Weirich, S., Peyton Jones, S.: FPH: First-class polymorphism for Haskell. In: ICFP (to appear, 2008), http://www.cis.upenn.edu/~dimitriv/fph/

  22. Wehr, S., Lämmel, R., Thiemann, P.: JavaGI: Generalized interfaces for Java. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 347–372. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Thiemann, P., Wehr, S. (2008). Interface Types for Haskell. In: Ramalingam, G. (eds) Programming Languages and Systems. APLAS 2008. Lecture Notes in Computer Science, vol 5356. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-89330-1_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-89330-1_19

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-89330-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics