Skip to main content

First-Class Type Classes

  • Conference paper
Book cover Theorem Proving in Higher Order Logics (TPHOLs 2008)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5170))

Included in the following conference series:

Abstract

Type Classes have met a large success in Haskell and Isabelle, as a solution for sharing notations by overloading and for specifying with abstract structures by quantification on contexts. However, both systems are limited by second-class implementations of these constructs, and these limitations are only overcomed by ad-hoc extensions to the respective systems. We propose an embedding of type classes into a dependent type theory that is first-class and supports some of the most popular extensions right away. The implementation is correspondingly cheap, general and integrates well inside the system, as we have experimented in Coq. We show how it can be used to help structured programming and proving by way of examples.

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. Birtwistle, G.M., Dahl, O.-J., Myhrhaug, B., Nygaard, K.: Simula Begin. Studentlitteratur (Lund, Sweden), Bratt Institut fuer neues Lernen (Goch, FRG), Chartwell-Bratt Ltd (Kent, England) (1979)

    Google Scholar 

  2. Chakravarty, M.M.T., Keller, G., Jones, S.L.P., Marlow, S.: Associated types with class. In: Palsberg, J., Abadi, M. (eds.) POPL, pp. 1–13. ACM Press, New York (2005)

    Google Scholar 

  3. Coquand, T., Pollack, R., Takeyama, M.: A logical framework with dependently typed records. In: Hofmann, M.O. (ed.) TLCA 2003. LNCS, vol. 2701, pp. 105–119. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  4. Damas, L., Milner, R.: Principal type schemes for functional programs. In: POPL, Albuquerque, New, Mexico, pp. 207–212 (1982)

    Google Scholar 

  5. Grégoire, B., Leroy, X.: A compiled implementation of strong reduction. In: ICFP 2002, pp. 235–246. ACM Press, New York (2002)

    Google Scholar 

  6. Haftmann, F., Wenzel, M.: Constructive Type Classes in Isabelle. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 160–174. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  7. Huffman, B., Matthews, J., White, P.: Axiomatic Constructor Classes in Isabelle/HOLCF. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 147–162. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  8. Jones, M.P.: Type classes with functional dependencies. In: Smolka, G. (ed.) ESOP 2000 and ETAPS 2000. LNCS, vol. 1782, pp. 230–244. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  9. Kahl, W., Scheffczyk, J.: Named instances for haskell type classes. In: Hinze, R. (ed.) A Comparative Study of Very Large Data Bases. LNCS, vol. 59. Springer, Heidelberg (2001)

    Google Scholar 

  10. Kammüller, F., Wenzel, M., Paulson, L.C.: Locales - A Sectioning Concept for Isabelle. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 149–166. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  11. Letouzey, P.: Programmation fonctionnelle certifie – L’extraction de programmes dans l’assistant Coq. PhD thesis, Universit Paris-Sud (July 2004)

    Google Scholar 

  12. Moors, A., Piessens, F., Odersky, M.: Generics of a higher kind. In: ECOOP 2008 (submitted, 2008)

    Google Scholar 

  13. Pollack, R.: Dependently typed records for representing mathematical structure. In: Aagaard, M.D., Harrison, J. (eds.) TPHOLs 2000. LNCS, vol. 1869, pp. 462–479. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  14. Saïbi, A.: Typing algorithm in type theory with inheritance. In: POPL, La Sorbonne, Paris, France, January 15-17, 1997, pp. 292–301. ACM Press, New York (1997)

    Chapter  Google Scholar 

  15. Sozeau, M.: Subset coercions in Coq. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 237–252. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  16. The Coq Development Team. The Coq Proof Assistant Reference Manual – Version V8.1 (July 2006), http://coq.inria.fr

  17. Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad hoc. In: POPL, Austin, Texas, pp. 60–76 (1989)

    Google Scholar 

  18. Wenzel, M.: Type classes and overloading in higher-order logic. In: Gunter, E.L., Felty, A.P. (eds.) TPHOLs 1997. LNCS, vol. 1275, pp. 307–322. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  19. Wenzel, M., Paulson, L.: Isabelle/isar. In: Wiedijk, F. (ed.) The Seventeen Provers of the World. LNCS (LNAI), vol. 3600, pp. 41–49. Springer, Heidelberg (2006)

    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

Sozeau, M., Oury, N. (2008). First-Class Type Classes. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds) Theorem Proving in Higher Order Logics. TPHOLs 2008. Lecture Notes in Computer Science, vol 5170. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71067-7_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-71067-7_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-71065-3

  • Online ISBN: 978-3-540-71067-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics