skip to main content
research-article
Open Access

Lambda: the ultimate sublanguage (experience report)

Published:26 July 2019Publication History
Skip Abstract Section

Abstract

We describe our experience teaching an advanced typed functional programming course based around the use of System Fω as a programming language.

References

  1. Thorsten Altenkirch, Conor McBride, and James McKinna. 2005. Why Dependent Types Matter. (April 2005). http://www. cs.nott.ac.uk/~psztxa/publ/ydtm.pdf .Google ScholarGoogle Scholar
  2. Robert Atkey. 2012. Relational Parametricity for Higher Kinds. In Computer Science Logic (CSL’12) - 26th International Workshop/21st Annual Conference of the EACSL, CSL 2012, September 3-6, 2012, Fontainebleau, France (LIPIcs), Patrick Cégielski and Arnaud Durand (Eds.), Vol. 16. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 46–61.Google ScholarGoogle Scholar
  3. Arthur I. Baars and S. Doaitse Swierstra. 2002. Typing Dynamic Typing. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming (ICFP ’02). ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Richard S. Bird and Lambert G. L. T. Meertens. 1998. Nested Datatypes. In Mathematics of Program Construction, MPC’98, Marstrand, Sweden, June 15-17, 1998, Proceedings (Lecture Notes in Computer Science), Johan Jeuring (Ed.), Vol. 1422. Springer, 52–67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Richard S. Bird and Ross Paterson. 1999. De Bruijn Notation as a Nested Datatype. J. Funct. Program. 9, 1 (Jan. 1999), 77–91. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Matt Brown and Jens Palsberg. 2017. Typed Self-Evaluation via Intensional Type Functions. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 415–428. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Brusilovsky, A. Kouchnirenko, P. Miller, and I Tomek. 1994. Teaching Programming to Novices: A Review of Approaches and Tools. In Proceedings of ED-MEDIA 94–World Conference on Educational Multimedia and Hypermedia.Google ScholarGoogle Scholar
  8. Luca Cardelli. 1989. Typeful Programming. In Formal Description of Programming Concepts, based on a seminar organized by IFIP Working Group 2.2 and held near Rio de Janeiro in April 1989 (IFIP State-of-the-Art Reports), Erich J. Neuhold and Manfred Paul (Eds.). Springer, 431. http://lucacardelli.name/Papers/TypefulProg.pdfGoogle ScholarGoogle Scholar
  9. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2009. Finally Tagless, Partially Evaluated: Tagless Staged Interpreters for Simpler Typed Languages. J. Funct. Program. 19, 5 (Sept. 2009), 509–543. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jacques Carette and Amr Sabry. 2016. Computing with Semirings and Weak Rig Groupoids. In Programming Languages and Systems - 25th European Symposium on Programming, ESOP 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings (Lecture Notes in Computer Science), Peter Thiemann (Ed.), Vol. 9632. Springer, 123–148.Google ScholarGoogle ScholarCross RefCross Ref
  11. Alonzo Church. 1940. A Formulation of the Simple Theory of Types. The Journal of Symbolic Logic 5, 2 (1940). http: //www.jstor.org/stable/2266170Google ScholarGoogle ScholarCross RefCross Ref
  12. R. Davies. 1996. A Temporal-logic Approach to Binding-time Analysis. In Proceedings of the 11th Annual IEEE Symposium on Logic in Computer Science (LICS ’96). IEEE Computer Society, Washington, DC, USA, 184–. http://dl.acm.org/citation. cfm?id=788018.788825 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Stephen Dolan, Leo White, KC Sivaramakrishnan, Jeremy Yallop, and Anil Madhavapeddy. 2015. Effective Concurrency through Algebraic Effects. (September 2015). OCaml Users and Developers Workshop 2015.Google ScholarGoogle Scholar
  14. Richard A. Eisenberg and Stephanie Weirich. 2012. Dependently Typed Programming with Singletons. In Proceedings of the 2012 Haskell Symposium (Haskell ’12). ACM, New York, NY, USA, 117–130. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Conal Elliott. 2009. Denotational Design with Type Class Morphisms (Extended Version). Technical Report 2009-01. LambdaPix. http://conal.net/papers/type-class-morphismsGoogle ScholarGoogle Scholar
  16. Martin Elsman and Ken Friis Larsen. 2004. Typing XHTML Web Applications in ML. In Proceedings of the Sixth International Symposium on Practical Aspects of Declarative Languages (Lecture Notes in Computer Science), Vol. 3057. Springer International Publishing, 224–238.Google ScholarGoogle ScholarCross RefCross Ref
  17. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. 2004. The Structure and Interpretation of the Computer Science Curriculum. J. Funct. Program. 14, 4 (July 2004), 365–378. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Jacques Garrigue. 2004. Relaxing the Value Restriction. In Functional and Logic Programming, 7th International Symposium, FLOPS 2004, Nara, Japan, April 7-9, 2004, Proceedings (Lecture Notes in Computer Science), Yukiyoshi Kameyama and Peter J. Stuckey (Eds.), Vol. 2998. Springer, 196–213.Google ScholarGoogle Scholar
  19. Jacques Garrigue. 2013. On variance, injectivity, and abstraction. OCaml Meeting. (September 2013).Google ScholarGoogle Scholar
  20. Jacques Garrigue and Jacques Le Normand. 2015. GADTs and Exhaustiveness: Looking for the Impossible, See { Yallop and Doligez 2017 }, 23–35.Google ScholarGoogle Scholar
  21. Jacques Garrigue and Didier Rémy. 1999. Semi-Explicit First-Class Polymorphism for ML. Inf. Comput. 155, 1-2 (1999), 134–169. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Jacques Garrigue and Didier Rémy. 2013. Ambivalent Types for Principal Type Inference with GADTs. In 11th Asian Symposium on Programming Languages and Systems. Melbourne, Australia. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Cordelia V. Hall, Kevin Hammond, Simon L. Peyton Jones, and Philip Wadler. 1996. Type Classes in Haskell. ACM Trans. Program. Lang. Syst. 18, 2 (1996), 109–138. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Bastiaan Heeren, Daan Leijen, and Arjan van IJzendoorn. 2003. Helium, for Learning Haskell. In Proceedings of the ACM SIGPLAN Haskell Workshop (Haskell’03), Uppsala, Sweden (proceedings of the acm sigplan haskell workshop (haskell’03), uppsala, sweden ed.). ACM SIGPLAN, 62. https://www.microsoft.com/en-us/research/publication/helium-for-learninghaskell/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Fritz Henglein. 1993. Type Inference with Polymorphic Recursion. ACM Trans. Program. Lang. Syst. 15, 2 (1993), 253–289. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ralf Hinze. 1999. Polytypic Functions Over Nested Datatypes. Discrete Mathematics & Theoretical Computer Science 3, 4 (1999), 193–214. http://dmtcs.episciences.org/266Google ScholarGoogle Scholar
  27. Ralf Hinze. 2000. Generalizing generalized tries. J. Funct. Program. 10, 4 (2000), 327–351. http://journals.cambridge.org/ action/displayAbstract?aid=59745 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Patricia Johann and Neil Ghani. 2008. Foundations for structured programming with GADTs. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, San Francisco, California, USA, January 7-12, 2008, George C. Necula and Philip Wadler (Eds.). ACM, 297–308. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Mark P. Jones. 1993. A System of Constructor Classes: Overloading and Implicit Higher-order Polymorphism. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA ’93). ACM, New York, NY, USA, 52–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Yukiyoshi Kameyama, Oleg Kiselyov, and Chung-chieh Shan. 2008. Closing the Stage: From Staged Code to Typed Closures. In PEPM 2008, Robert Glück and Oege de Moor (Eds.). ACM, 147–157. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Oleg Kiselyov. 2014. The Design and Implementation of BER MetaOCaml. In Functional and Logic Programming, Michael Codish and Eijiro Sumii (Eds.). Lecture Notes in Computer Science, Vol. 8475. Springer International Publishing, 86–102.Google ScholarGoogle Scholar
  32. Oleg Kiselyov. 2015. Generating Code with Polymorphic let: A Ballad of Value Restriction, Copying and Sharing, See { Yallop and Doligez 2017 }, 1–22.Google ScholarGoogle Scholar
  33. Oleg Kiselyov. 2016. Modular, composable, typed optimizations in the tagless-final style. (August 2016). http://okmij.org/ ftp/tagless-final/course/optimizations.html .Google ScholarGoogle Scholar
  34. Oleg Kiselyov and Chung-chieh Shan. 2007. Lightweight Static Capabilities. Electr. Notes Theor. Comput. Sci. 174, 7 (2007), 79–104. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Sam Lindley. 2012. Embedding F. In Proceedings of the 8th ACM SIGPLAN workshop on Generic programming, [email protected] 2012, Copenhagen, Denmark, September 9-15, 2012, Andres Löh and Ronald Garcia (Eds.). ACM, 45–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Sam Lindley and Conor McBride. 2013. Hasochism: The Pleasure and Pain of Dependently Typed Haskell Programming. In Proceedings of the 2013 ACM SIGPLAN Symposium on Haskell (Haskell ’13). ACM, New York, NY, USA, 81–92. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Guillaume Marceau, Kathi Fisler, and Shriram Krishnamurthi. 2011. Mind Your Language: On Novices’ Interactions with Error Messages. In Proceedings of the 10th SIGPLAN Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward! 2011). ACM, New York, NY, USA, 3–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Greg Michaelson. 2011. An Introduction to Functional Programming Through Lambda Calculus. Dover Publications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. John C. Mitchell and Gordon D. Plotkin. 1988. Abstract Types Have Existential Type. ACM Trans. Program. Lang. Syst. 10, 3 (July 1988), 470–502. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. 1999. From System F to Typed Assembly Language. ACM Trans. Program. Lang. Syst. 21, 3 (May 1999), 527–568. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Bengt Nordström, Kent Petersson, and Jan M. Smith. 1990. Programming in Martin-Löf’s Type Theory: An Introduction. Oxford University Press. http://www.cse.chalmers.se/research/group/logic/book/ .Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Chris Okasaki. 1998. Purely Functional Data Structures. Cambridge University Press, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Frank G. Pagan. 1980. Nested Sublanguages of Algol 68 for Teaching Purposes. SIGPLAN Not. 15, 7 and 8 (July 1980), 72–81. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Emir Pasalic. 2004. The Role of Type Equality in Meta-programming. Ph.D. Dissertation. Advisor(s) Sheard, Timothy E. AAI3151199. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Simon L. Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. 2007. Practical type inference for arbitrary-rank types. J. Funct. Program. 17, 1 (2007), 1–82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Benjamin C. Pierce. 2002. Types and programming languages. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. François Pottier. 2014. Hindley-milner elaboration in applicative style: functional pearl. In Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, Johan Jeuring and Manuel M. T. Chakravarty (Eds.). ACM, 203–212. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. François Pottier and Yann Régis-Gianas. 2006. Towards Efficient, Typed LR Parsers. Electr. Notes Theor. Comput. Sci. 148, 2 (2006), 155–180. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Andreas Rossberg, Claudio Russo, and Derek Dreyer. 2014. F-ing Modules. Journal of Functional Programming 24, 5 (2014), 529–607.Google ScholarGoogle ScholarCross RefCross Ref
  50. Tim Sheard. 2005. Putting Curry-howard to Work. In Proceedings of the 2005 ACM SIGPLAN Workshop on Haskell (Haskell ’05). ACM, New York, NY, USA, 74–85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Jeremy G. Siek and Andrew Lumsdaine. 2005. Essential Language Support for Generic Programming. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’05). ACM, New York, NY, USA, 73–84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Martin Sulzmann, Manuel M. T. Chakravarty, Simon Peyton Jones, and Kevin Donnelly. 2007. System F with Type Equality Coercions. In Proceedings of the 2007 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI ’07). ACM, New York, NY, USA, 53–66. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Simon Thompson. 1991. Type Theory and Functional Programming. Addison-Wesley. https://www.cs.kent.ac.uk/people/ staff/sjt/TTFP/ . Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. D. A. Turner. 2004. Total Functional Programming. Journal of Universal Computer Science 10, 7 (Jul 2004), 751–768.Google ScholarGoogle Scholar
  55. Benoît Vaugon. 2013. A New Implementation of OCaml Formats based on GADTs. OCaml 2013. (September 2013). https: //ocaml.org/meetings/ocaml/2013/proposals/formats-as-gadts.pdfGoogle ScholarGoogle Scholar
  56. Jérôme Vouillon and Vincent Balat. 2014. From bytecode to JavaScript: the Js_of_ocaml compiler. Softw., Pract. Exper. 44, 8 (2014), 951–972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Dimitrios Vytiniotis, Stephanie Weirich, and Simon L. Peyton Jones. 2008. FPH: first-class polymorphism for Haskell. In Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, ICFP 2008, Victoria, BC, Canada, September 20-28, 2008, James Hook and Peter Thiemann (Eds.). ACM, 295–306. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Philip Wadler. 2003. The Girard–Reynolds Isomorphism. Information and Computation 186, 2 (2003), 260 – 284. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Philip Wadler. 2015. Propositions As Types. Commun. ACM 58, 12 (Nov. 2015), 75–84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Stephanie Weirich. 2004. Functional Pearl: type-safe cast. Journal of Functional Programming 14 (2004). Issue 06. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. J. B. Wells. 1994. Typability and Type-Checking in the Second-Order lambda-Calculus are Equivalent and Undecidable. In Proceedings of the Ninth Annual Symposium on Logic in Computer Science (LICS ’94), Paris, France, July 4-7, 1994. IEEE Computer Society, 176–185.Google ScholarGoogle ScholarCross RefCross Ref
  62. Leo White, Frédéric Bour, and Jeremy Yallop. 2014. Modular implicits. In Proceedings ML Family/OCaml Users and Developers workshops, ML/OCaml 2014, Gothenburg, Sweden, September 4-5, 2014. (EPTCS), Oleg Kiselyov and Jacques Garrigue (Eds.), Vol. 198. 22–63.Google ScholarGoogle Scholar
  63. Andrew K. Wright. 1995. Simple Imperative Polymorphism. LISP and Symbolic Computation 8, 4 (01 Dec 1995), 343–355. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Jeremy Yallop and Stephen Dolan. 2017. First-Class Subtypes. In Proceedings ML Family / OCaml Users and Developers workshops, ML/OCaml 2017, Oxford, UK, 7th September 2017. (EPTCS), Sam Lindley and Gabriel Scherer (Eds.), Vol. 294. 74–85.Google ScholarGoogle Scholar
  65. Jeremy Yallop and Damien Doligez (Eds.). 2017. Proceedings ML Family / OCaml Users and Developers workshops, ML Family/OCaml 2015, Vancouver, Canada, 3rd & 4th September 2015. EPTCS, Vol. 241.Google ScholarGoogle Scholar
  66. Jeremy Yallop and Oleg Kiselyov. 2010. First-class modules: hidden power and tantalizing promises. ACM SIGPLAN Workshop on ML. (September 2010). Baltimore, Maryland, United States.Google ScholarGoogle Scholar
  67. Jeremy Yallop, David Sheets, and Anil Madhavapeddy. 2018. A modular foreign function interface. Sci. Comput. Program. 164 (2018), 82–97.Google ScholarGoogle ScholarCross RefCross Ref
  68. Jeremy Yallop and Leo White. 2014. Lightweight Higher-Kinded Polymorphism. In Functional and Logic Programming - 12th International Symposium, FLOPS 2014, Kanazawa, Japan, June 4-6, 2014. Proceedings (Lecture Notes in Computer Science), Michael Codish and Eijiro Sumii (Eds.), Vol. 8475. Springer, 119–135.Google ScholarGoogle Scholar

Index Terms

  1. Lambda: the ultimate sublanguage (experience report)

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Article Metrics

          • Downloads (Last 12 months)58
          • Downloads (Last 6 weeks)3

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!