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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Projet CROAP. Design and Implementaiton of Programming Tools (1999), http://www-sop.inria.fr/croap/
Hugs 1998 (2003), http://www.haskell.org/hugs/
ASF+SDF (2005), http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ASF+SDF
Literate Programming (2005), http://www.literateprogramming.com/
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)
Dijkstra, A.: EHC Web (2004), http://www.cs.uu.nl/groups/ST/Ehc/WebHome
Dijkstra, A.: Stepping through Haskell. PhD thesis, Utrecht University, Department of Information and Computing Sciences (2005)
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)
Dijkstra, A., Doaitse Swierstra, S.: Making Implicit Parameters Explicit. Technical report, Utrecht University (2005)
Duggan, D., Ophel, J.: Type-Checking Multi-Parameter Type Classes. Journal of Functional Programming (2002)
Faxen, K.-F.: A Static Semantics for Haskell. Journal of Functional Programming 12(4), 295 (2002)
GrammaTech. Synthesizer Generator (2005), http://www.grammatech.com/products/sg/overview.html
Harper, R.: Mechanizing Language Definitions (invited lecture at ICFP 2005) (2005), http://www.cs.cmu.edu/~rwh/
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)
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)
Jones, M.P.: Qualified Types, Theory and Practice. Cambridge Univ. Press, Cambridge (1994)
Jones, M.P.: Typing Haskell in Haskell (2000), http://www.cse.ogi.edu/~mpj/thih/
Levin, M.Y., Pierce, B.C.: TinkerType: A Language for Playing with Formal Systems (1999), http://www.cis.upenn.edu/~milevin/tt.html
Marlow, S.: The Glasgow Haskell Compiler (2004), http://www.haskell.org/ghc/
Jones, S.P.: Haskell 1998, Language and Libraries, The Revised Report. Cambridge Univ. Press, Cambridge (2003)
Jones, S.P., Jones, M., Meijer, E.: Type classes: an exploration of the design space. In: Haskell Workshop (1997)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Simmons, R.: The Twelf Project, Wiki Home (2005), http://fp.logosphere.cs.cmu.edu/twelf/
Visser, E.: Stratego Home Page (2005), http://www.program-transformation.org/Stratego/WebHome
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)