Functional Programming in Education

schedule May 15th 03:45 - 04:15 PM place Red Room people 1 Interested

This talk looks at how functional programming has been used in tertiary education, and how it could be used in the future.
In 1985, Abelson and Sussman's course Structure and Interpretation of Computer Programs made enduring contributions to the art of educating programmers. How to Design Programs later refined some of these ideas, with a new emphasis on decomposing problems and designing solutions. I argue further improvements could be made. In particular, by using a typed functional programming language like Haskell.

This talk will suggest approaches and recommend resources that could be used in the modern education of undergraduate programmers. Such recommendations are also applicable to industry programmers looking to learn functional programming or organisations looking to develop internal training material.

1 favorite thumb_down thumb_up 0 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist

Outline/Structure of the Talk

  • Introduction (approx. 2m)
  • Education in the past (approx. 13m)
    • Structure and Interpretation of Computer Programs (1986)
      • Uses the Scheme programming language. Scheme's minimal syntax is in contrast with most introductory programming courses, which are syntax directed
      • Teaches how to visualise and understand recursive computations very early
      • Wide variety of computer science subjects introduced, includign implementing an interpreter and object-oriented programming
      • Domain knowledge required for examples and exercises (eg. digital circuits and calculus)
      • Does not explicitly teach core problem-solving techniques
    • How to Design Programs ("HTDP") (2001)
      • Addressed problems with SICP, eg. teaches core problem-solving and uses less domain-specific examples.
      • Continued to use Scheme, this time with a staged introduction where the language is unlocked gradually
      • Course built around an interactive IDE/REPL
      • Students taught to think about types, despite Scheme lacking a strong typing discipline
    • Wadler's critique of SICP (1987)
      • Wadler argued KRC and Miranda were more suitable than Scheme (both lazy functional programming languages and ancestors to Haskell)
      • Substitution model of computation is very intuitive (example: SICP has an early exercise to ensure the reader _is not_ using the substitution model)
      • Pattern matching rather than detector/selector functions help students associate the flow of the program with the structure of their data, also less error prone
      • Types help prevent confusion about concepts (example: a beginner Scheme programmer will often not understand the difference between (cons x y) and (list x y))
      • These points are aligned with similar points raised by HTDP
    • Chakravarty and Keller (2004)
      • Chakravarty and Keller published a paper describing their experiences teaching programming with Haskell in a first year subject at UNSW in the early 2000's
      • Argued in favour of types and Haskell's lightweight syntax
      • Algebraic data types and pattern matching allow data structures to be discussed earlier
      • Students responded very well to ghci
      • Collected survey results, students found assessment challenging and interesting
  • Education in the present and future (approx. 10m)
    • My vision for an introduction to programming course is derived from HTDP but using Haskell, taking advantage of static types, pattern matching and the intuitive substitution model of evaluation
    • Combine the lessons of HTDP and Wadler. Chakravarty and Keller give us evidence it works
    • We already have ghci, and work is ongoing on tooling around Haskell (example: Haskell For Mac)
    • New developments allow us to restrict Haskell and offer a staged introduction
    • GHC extensions such as RebindableSyntax and NoImplicitPrelude help avoid verbose and unclear error messages. (example: 1 + False results in an error about "No instance for (Num Bool)")
    • Custom type error messages

Learning Outcome

Attendees will learn what role functional programming languages have had in tertiary education, and how they could be used in the future. Many of the recommendations and resources provided are applicable for learning Haskell or functional programming outside of a university, for example for industry programmers looking to learn functional programming or organisations looking to develop internal training material.

Target Audience

Anyone interested in the teaching and learning of programming, and the role functional programming has had and could have in tertiary education

Prerequisites for Attendees

Basic knowledge of Scheme and Haskell are helpful but not required

schedule Submitted 1 month ago