29 November 2017 (after class)
I maintain these notes as text in the Pandoc’s dialect of Markdown using embedded LaTeX markup for the mathematical formulas and then translate the notes to HTML, PDF, and other formats as needed.
Advisory: The HTML version of this document requires use of a browser that supports the display of MathML. A good choice as of November 2017 is a recent version of Firefox from Mozilla.
Textbook: Introduction to Functional Programming Using Haskell
(21 Aug) Discuss syllabus and class organization
Discuss Fundamental Concepts of programming languages (Chapter 1): [HTML] [PDF]
(23 Aug) Section 1.2 (slides): Evolving Computing Hardware Affects Programming Languages
(23, 25 Aug) Section 1.3 (slides): Primary Programming Paradigms
(25 Aug, 1 Sep) Section 1.5 (slides): History of Programming Languages HTML slides
(1 Sep) Section 1.6 (no slides): Abstraction
We covered this section just before Section 2.5.
Discuss Basic Haskell Functional Programming (Chapter 2): [HTML] [PDF]
(28, 30 Aug) Section 2.2 (slides): Our First Haskell Functions
Use Quick Overview of Basic Haskell interactively in GHCi demonstration
Use Factorial functions (from chapter/slides) in GHCi demonstration (instead of slides)
[Fact.hs
module] [xfact.hs
demo script]
(28, 30 Aug) Section 2.3. “Using GHCi” and “Surveying the Basic Types” during demo above.
(1 Sep) Distribute Assignment #1
(1 Sep) Section 2.5 (slides): Top-Down Stepwise Refinement (HTML)
[Sqrt.hs
module] [TestSqrt.hs
module]
We dsicussed Section 1.6 on “Abstraction” before we discussed this case study.
(6-11 Sep) Discuss Chapter 3 next: Evaluation and Efficiency
(13-18 Sep) Discuss Chapter 4 next: List Programming
(25, 29 Sep) Section 2.6 (slides): Using Data Abstraction (HTML)
[RationalCore.hs
module] [Rational.hs
module] [RationalDeferGCD.hs
module]
Discuss Evaluation and Efficiency (Chapter 3): [HTML] [PDF]
(8, 11 Sep) Section 3.2 (slides): Evaluation of Functional Programs (HTML)
(6, 8 Sep) Section 3.3-5 (slides): Recursion Styles (HTML) [EvalEff.hs
module]
Discuss List Programming (Chapter 4): [HTML] [PDF]
(13 Sep) Distribute Assignment #2 (text processing case study)
(13, 15, 18 Sep) List Programming (HTML) (slides) [Mod04Lists.hs
module]
(20 Sep) Review for Examination #1
(22 Sep) Take Examination #1 on concepts and skills covered so far.
(25, 29 Sep) Go back to Section 2.6 and 2.7 (slides): Using Data Abstraction (HTML) (slides)
[RationalCore.hs
module] [Rational.hs
module] [RationalDeferGCD.hs
module]
(27 Sep) Go over graded Exam #1
Discuss Higher-Order Functions (Chapter 5): [HTML] [PDF]
(2, 4, 6, 9 Oct) Higher Order Functions (HTML) (slides)
(9, 11 Oct) Haskell Function Concepts (HTML) (slides)
(13 Oct Flipped) Sequences and List Comprehensions (Sections 7.2 and 7.3, “More List Processing and Problem Solving”) [HTML] [PDF]
Note: Each student was responsible for studying the above sections before the class on Friday, 13 October. I was willing to answer any questions in class on that day. Given few questions, I worked the short set of exercises at the end of the chapter.
Discuss Algebraic Data Types (Chapter 8): [HTML] [PDF]
(18 Oct) Review for Exam #2
(20 Oct) Examination #2 primarily covering Section 2.6 and 2.7, Chapter 5, Section 7,2 and 7.3, and Chapter 8.
(23 Oct) Return and discuss Exam #2 except last problem
(25 Oct) Return and discuss last problem on Exam #2
(25 Oct) Discuss systematic testing of modules (with respect to Assignment #4)
(27 Oct) Complete discussion of Algebraic Data Types (slides) (Chapter 8, Maybe
and Either
types)
(for reference, mentioned 27 Oct) Examine the Labeled Digraph case study
Background (These notes have not been updated to use Haskell. Some material has also been incorporated into chapters 1 and 2 of “Introduction to Functional Programming Using Haskell”.)
Haskell version (Spring 2015)
Description of Labeled Digraph abstract data type in Haskell
Haskell List implementation (Spring 2015):
[module] [incomplete test module]
Haskell Map implementation (Spring 2015):
[module] [imcomplete test module]
Elixir version (Spring 2015)
Scala versions (Spring 2016)
Abstract data type specification and Scala trait (interface):
[ADT interface]
Scala List implementation:
[class source] [test source]
Scala Map (HashMap) implementation:
[class source] [test source]
Using the Elixir Digraph ADT module to build the Wizard’s Adventure game (Spring 2015)
Wizard’s Adventure game, Version 1, adapted from Chapter 5, 6, and 17 of Conrad Barski’s Land of Lisp: Learn to Program in Lisp, One Game at a Time, No Starch Press, 2011.
Wizard’s Adventure game, Version 2, that uses a higher order function to generate game actions and improved handling of the game state.
Explore Overloading and Type Classes (Chapter 9): [HTML] [PDF]
(27, 30 Oct, 1 Nov) Overloading and Type Classes (slides)
(1, 3 Nov) Movable Objects case study
(for Assignment #5) Building domain-specific languages
(30 Oct) Sandwich DSL Case Study
(for reference) Domain-Specific Languages introduction
Discuss language processing phases for compilers and interpreters
(13 Nov, Assignment #6) Extending the Expression Language interpreter
(8, 13, 15 Nov) Explore the Expression Language Syntax and Semantics (Chapter 10) [HTML] [PDF]
Supplemental slides:
Code in work:
(10 Nov) No class because of a scheduling mistake
(15 Nov) Review for Examination #3
(17 Nov) Examination #3
(20-24 Nov) Enjoy Fall Break!
(27, 29 Nov) Explore the Expression Language Parsing (Chapter 11) [HTML] [PDF]
Supplemental slides:
Code in work:
(for reference) Explore the Expression Language Compilation [HTML] [PDF]
Code in work:
(for reference) Explore the Imperative Core Language: [HTML (future)] [PDF (future)]
Code in work:
(1 Dec) Return Examination #3 and Review for Examination #4
(7 Dec, 8-11 a.m.) Examination #4 in Final Exam period
(TBD) Study Names, Scopes, and Bindings from Scott’s PLP textbook Chapter 3: slides
(TBD) Study Subroutines and Control Abstractions form Scott’s PLP textbook Chapter 9: slides
(for reference) Notes on Scala for Java Programmers
(for reference) Introduce Lua programming language
Reference: Roberto Ierusalimshcy. Programming in Lua, Fourth Edition, Lua.org, Rio de Janiero, Brazil, 2016. The First Edition of this book is available online at https://www.lua.org/pil/contents.html; it covers Lua 5.0.
Background: The slides below are adapted, in part, from Programming in Lua, Slides for Course by Fabio Mascarenhas from the Federal University of Rio de Janeiro, Brazil. He taught a course, which used Lua 5.2, at Nankai University, P. R. China, in July 2013.
Introduction to Lua slides based, in part, on Mascarenhas slide sets 0-5
Concepts: Lua design principles, REPL, chunk, script, data types and operators (e.g., nil
, boolean
, number
, string
, table
, function
), dynamic vs. static typing, first-class functions (first-class, anonymous, variadic, multiple return), statements (multiple assignment, if
, while
, repeat
, numeric for
, generic for
, do
), tables (as array, matrix, record, set)
Advanced Lua Functions slides based, in part, on Mascarenhas slide set 6
Concepts: lexical scope, higher-order functions, closure, callback, functional programming (map
, filter
, folds) Currying, partial application
Modules in Lua slides based, in part, on Mascarenhas slide set 9
Concepts: module, information hiding, interface, abstract interface, module and interface design criteria, Lua module implementation
Lua Metatables slides based, in part, on Mascarenhas slide set 10
Concepts: metatable; metamethod; Lua metatable & metamethod-related functions; shared metatable; overriding operation behavior; use of metamethods such as __add
, __len
, __eq
, __lt
, __le
, __index
, __newindex
, and __tostring
; proxy tables example
Lua Objects slides based, in part, on Mascarenhas slide set 11
Concepts: a simple Lua object model; Lua tables as objects; method; receiver object; colon method call operator; self; syntactic sugar; Lua classes as modules; using metatables and metamethod __index
to construct classes and superclasses; constructor; class method; instance method; examples of classes and superclasses; instance-of;
Harold Abelson and Gerald J. Sussman with Julie Sussman. Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996. [HTML book]
William R. Cook. Anatomy of Programming Languages online draft
Shiram Krishnamurthi. Programming Languages: Application and Interpretation, online book
Fabio Mascarenhas. Programming in Lua, Slides for Course, Federal University of Rio de Janeiro, Brazil, July 2013. This course was delivered at Nankai University, P. R. China, in July 2013 using Lua 5.2.
Roberto Ierusalimshcy. Programming in Lua, First Edition, Lua.org, Rio de Janiero, Brazil, 2003. This old edition at https://www.lua.org/pil/contents.html covers Lua 5.0.
Penlight Lua Libraries inspired by the Python standard libraries
Love 2D game framework
Awesome Elm tutorial list
School of Haskell online tutorials
Miron Lipovaca. Learn You a Haskell for Great Good: A Beginner’s Guide, a free online tutorial at http://learnyouahaskell.com/. (It is also in print from No Starch Press, 2011.)
H. Conrad Cunningham. Introduction to Functional Programming Using Haskell, Computer and Information Science, University of Mississippi, 2016 (partial draft), available from the prototype CSci 555 course site at http://www.cs.olemiss.edu/~hcc/csci555/prototype/. I begin developing this set of notes in June 2016 based partly on previous materials.
H. Conrad Cunningham. Notes on Functional Programming with Haskell, Computer and Information Science, University of Mississippi, 1994-2014. This older document is being revised and integrated with other materials to produce the document Introduction to Functional Programming Using Haskell.
Kees Doets and Jan van Eijck. The Haskell Road to Logic, Math and Programming, March 2004. This book is also available in print, published by College Publications, 2004.
Paul Hudak. The Haskell School of Music: From Signals to Symphonies, Version 2.6, January 2014. This book is a recent rewrite of Hudak’s The Haskell School of Expression: Learning Functional Programming through Multimedia, Cambridge University Press, 2000.
Patrick Blackburn, Johan Bos, and Kristina Striegnitz. Learn Prolog Now. This a tutoral available online at http://www.learnprolognow.org/. It is also available in print from College Publications, 2006.