Skip to main content

Ruler: Programming Type Rules

  • Conference paper
Functional and Logic Programming (FLOPS 2006)

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

Included in the following conference series:

Abstract

Some type systems are first described formally, to be sometimes followed by an implementation. Other type systems are first implemented as language extensions, to be sometimes retrofitted with a formal description. In neither case it is an easy task to keep both artefacts consistent. In this paper we introduce Ruler, a domain specific language for describing type rules. Type rules can be incrementally described, thus providing a means for building complex type systems on top of simpler ones. Besides checking well-formedness of Ruler programs we use them to generate (1) a visual LATEX rendering, suitable for use in the presentation of formal aspects, and (2) an attribute grammar based implementation. Combining these two aspects in Ruler contributes to bridging the gap between theory and practice: mutually consistent representations can be generated for use in both theoretical and practical settings.

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. Projet CROAP. Design and Implementaiton of Programming Tools (1999), http://www-sop.inria.fr/croap/

  2. Hugs 1998 (2003), http://www.haskell.org/hugs/

  3. ASF+SDF (2005), http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ASF+SDF

  4. Literate Programming (2005), http://www.literateprogramming.com/

  5. Aydemir, B.E., Bohannon, A., Fairbairn, M., Foster, J.N., Pierce, B.C.: Mechanized metatheory for the masses: The POPLmark challenge. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 50–65. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  6. Dijkstra, A.: EHC Web (2004), http://www.cs.uu.nl/groups/ST/Ehc/WebHome

  7. Dijkstra, A.: Stepping through Haskell. PhD thesis, Utrecht University, Department of Information and Computing Sciences (2005)

    Google Scholar 

  8. Dijkstra, A., Swierstra, S.D.: Typing Haskell with an Attribute Grammar. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 1–72. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  9. Dijkstra, A., Doaitse Swierstra, S.: Making Implicit Parameters Explicit. Technical report, Utrecht University (2005)

    Google Scholar 

  10. Duggan, D., Ophel, J.: Type-Checking Multi-Parameter Type Classes. Journal of Functional Programming (2002)

    Google Scholar 

  11. Faxen, K.-F.: A Static Semantics for Haskell. Journal of Functional Programming 12(4), 295 (2002)

    MathSciNet  MATH  Google Scholar 

  12. GrammaTech. Synthesizer Generator (2005), http://www.grammatech.com/products/sg/overview.html

  13. Harper, R.: Mechanizing Language Definitions (invited lecture at ICFP 2005) (2005), http://www.cs.cmu.edu/~rwh/

  14. Heeren, B., Hage, J.: Type Class Directives. In: Hermenegildo, M.V., Cabeza, D. (eds.) PADL 2004. LNCS, vol. 3350, pp. 253–267. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  15. Heeren, B., Hage, J., Swierstra, S.D.: Generalizing Hindley-Milner Type Inference Algorithms. Technical Report UU-CS-2002-031, Institute of Information and Computing Science, University Utrecht, Netherlands (2002)

    Google Scholar 

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

    Book  MATH  Google Scholar 

  17. Jones, M.P.: Typing Haskell in Haskell (2000), http://www.cse.ogi.edu/~mpj/thih/

  18. Levin, M.Y., Pierce, B.C.: TinkerType: A Language for Playing with Formal Systems (1999), http://www.cis.upenn.edu/~milevin/tt.html

  19. Marlow, S.: The Glasgow Haskell Compiler (2004), http://www.haskell.org/ghc/

  20. Jones, S.P.: Haskell 1998, Language and Libraries, The Revised Report. Cambridge Univ. Press, Cambridge (2003)

    Google Scholar 

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

    Google Scholar 

  22. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  23. Simmons, R.: The Twelf Project, Wiki Home (2005), http://fp.logosphere.cs.cmu.edu/twelf/

  24. Visser, E.: Stratego Home Page (2005), http://www.program-transformation.org/Stratego/WebHome

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Dijkstra, A., Swierstra, S.D. (2006). Ruler: Programming Type Rules. In: Hagiya, M., Wadler, P. (eds) Functional and Logic Programming. FLOPS 2006. Lecture Notes in Computer Science, vol 3945. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11737414_4

Download citation

  • DOI: https://doi.org/10.1007/11737414_4

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-33439-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics