Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Lambda: the ultimate sublanguage (experience report)

Published: 26 July 2019 Publication History
  • Get Citation Alerts
  • 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 .
    [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.
    [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.
    [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.
    [5]
    Richard S. Bird and Ross Paterson. 1999. De Bruijn Notation as a Nested Datatype. J. Funct. Program. 9, 1 (Jan. 1999), 77–91.
    [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.
    [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.
    [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.pdf
    [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.
    [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.
    [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/2266170
    [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
    [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.
    [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.
    [15]
    Conal Elliott. 2009. Denotational Design with Type Class Morphisms (Extended Version). Technical Report 2009-01. LambdaPix. http://conal.net/papers/type-class-morphisms
    [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.
    [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.
    [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.
    [19]
    Jacques Garrigue. 2013. On variance, injectivity, and abstraction. OCaml Meeting. (September 2013).
    [20]
    Jacques Garrigue and Jacques Le Normand. 2015. GADTs and Exhaustiveness: Looking for the Impossible, See { Yallop and Doligez 2017 }, 23–35.
    [21]
    Jacques Garrigue and Didier Rémy. 1999. Semi-Explicit First-Class Polymorphism for ML. Inf. Comput. 155, 1-2 (1999), 134–169.
    [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.
    [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.
    [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/
    [25]
    Fritz Henglein. 1993. Type Inference with Polymorphic Recursion. ACM Trans. Program. Lang. Syst. 15, 2 (1993), 253–289.
    [26]
    Ralf Hinze. 1999. Polytypic Functions Over Nested Datatypes. Discrete Mathematics & Theoretical Computer Science 3, 4 (1999), 193–214. http://dmtcs.episciences.org/266
    [27]
    Ralf Hinze. 2000. Generalizing generalized tries. J. Funct. Program. 10, 4 (2000), 327–351. http://journals.cambridge.org/ action/displayAbstract?aid=59745
    [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.
    [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.
    [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.
    [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.
    [32]
    Oleg Kiselyov. 2015. Generating Code with Polymorphic let: A Ballad of Value Restriction, Copying and Sharing, See { Yallop and Doligez 2017 }, 1–22.
    [33]
    Oleg Kiselyov. 2016. Modular, composable, typed optimizations in the tagless-final style. (August 2016). http://okmij.org/ ftp/tagless-final/course/optimizations.html .
    [34]
    Oleg Kiselyov and Chung-chieh Shan. 2007. Lightweight Static Capabilities. Electr. Notes Theor. Comput. Sci. 174, 7 (2007), 79–104.
    [35]
    Sam Lindley. 2012. Embedding F. In Proceedings of the 8th ACM SIGPLAN workshop on Generic programming, WGP@ICFP 2012, Copenhagen, Denmark, September 9-15, 2012, Andres Löh and Ronald Garcia (Eds.). ACM, 45–56.
    [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.
    [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.
    [38]
    Greg Michaelson. 2011. An Introduction to Functional Programming Through Lambda Calculus. Dover Publications.
    [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.
    [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.
    [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/ .
    [42]
    Chris Okasaki. 1998. Purely Functional Data Structures. Cambridge University Press, New York, NY, USA.
    [43]
    Frank G. Pagan. 1980. Nested Sublanguages of Algol 68 for Teaching Purposes. SIGPLAN Not. 15, 7 and 8 (July 1980), 72–81.
    [44]
    Emir Pasalic. 2004. The Role of Type Equality in Meta-programming. Ph.D. Dissertation. Advisor(s) Sheard, Timothy E. AAI3151199.
    [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.
    [46]
    Benjamin C. Pierce. 2002. Types and programming languages. MIT Press.
    [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.
    [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.
    [49]
    Andreas Rossberg, Claudio Russo, and Derek Dreyer. 2014. F-ing Modules. Journal of Functional Programming 24, 5 (2014), 529–607.
    [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.
    [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.
    [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.
    [53]
    Simon Thompson. 1991. Type Theory and Functional Programming. Addison-Wesley. https://www.cs.kent.ac.uk/people/ staff/sjt/TTFP/ .
    [54]
    D. A. Turner. 2004. Total Functional Programming. Journal of Universal Computer Science 10, 7 (Jul 2004), 751–768.
    [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.pdf
    [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.
    [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.
    [58]
    Philip Wadler. 2003. The Girard–Reynolds Isomorphism. Information and Computation 186, 2 (2003), 260 – 284.
    [59]
    Philip Wadler. 2015. Propositions As Types. Commun. ACM 58, 12 (Nov. 2015), 75–84.
    [60]
    Stephanie Weirich. 2004. Functional Pearl: type-safe cast. Journal of Functional Programming 14 (2004). Issue 06.
    [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.
    [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.
    [63]
    Andrew K. Wright. 1995. Simple Imperative Polymorphism. LISP and Symbolic Computation 8, 4 (01 Dec 1995), 343–355.
    [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.
    [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.
    [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.
    [67]
    Jeremy Yallop, David Sheets, and Anil Madhavapeddy. 2018. A modular foreign function interface. Sci. Comput. Program. 164 (2018), 82–97.
    [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.

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Proceedings of the ACM on Programming Languages
    Proceedings of the ACM on Programming Languages  Volume 3, Issue ICFP
    August 2019
    1054 pages
    EISSN:2475-1421
    DOI:10.1145/3352468
    Issue’s Table of Contents
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 26 July 2019
    Published in PACMPL Volume 3, Issue ICFP

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. education
    2. functional programming
    3. lambda calculus
    4. mental models
    5. pedagogy
    6. sublanguages
    7. types

    Qualifiers

    • Research-article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 471
      Total Downloads
    • Downloads (Last 12 months)69
    • Downloads (Last 6 weeks)5

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media