CSci 555 : Functional Programming
Spring Semester 2019
Lecture Notes

H. Conrad Cunningham

Professor of Computer and Information Science
School of Engineering
University of Mississippi

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.

Browser Advisory: The HTML version of this document requires use of a browser that supports the display of MathML. A good choice as of August 2020 is a recent version of Firefox from Mozilla.

Lecture Notes

Go To Current Lecture

Class Introduction

  1. (23 Jan) Discuss class organization and Syllabus: HTMLPDF

Programming Paradigms

  1. (25, 28 Jan) Survey the Primary Paradigms (ELIFP Chapter 2)

    1. Chapter: HTMLPDF

    2. HTML slides: Scala versionOriginal ELIFP

    3. Scala examples:

  2. (25 Jan) Motivate the study of functional programming

    1. Excerpt from Backus’ 1977 Turing Award Address

    2. (for reference) 1977 Turing Award Address: John Backus. Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs, Communications of the ACM 21.8 (1978): 613-641.

  3. (for reference) Survey the Object-Based Paradigms (ELIFP Ch. 3)

    1. Chapter: HTMLPDF

    2. HTML Slides: Original ELIFP

    3. Scala example: Object-Oriented CountingOO.scala

    4. Additional notes: Object-Oriented Software Development

    5. Additional slides on Using CRC Cards (Class-Responsibility-Collaboration): HTML slides

Basic Scala

  1. (30 Jan, 1, 4, 6 Feb) Introduce Scala to Java programmers

    1. Note: These Notes were adapted from: Michel Schniz and Philipp Haller, A Scala Tutorial for Java Programmers

    2. Notes on Scala for Java Programmers: HTMLPDF

      Diagram for Scala’s unified type hierarchy

    3. Scala source code from Notes:

    4. (for reference) Miscellaneous overviews, cheat sheets, and tutorials

  2. (1 Feb) Distribute Assignment #1. Due 13 Feb.

Recursive Programming

  1. (6, 8 Feb) Examine Recursion Styles, Correctness, and Efficiency: Scala Version

    1. Notes: HTMLPDF

    2. HTML Slides

    3. Scala source code from Notes: RecursionStyles.scala

    4. (for reference) “Tail Call” article on Wikipedia

  2. (8 Feb) Take Quiz #1 over semester content through Notes on Scala for Java

  3. (for reference) Examine functions adapted from SICP

    1. Background reading: Chapter 1 of the classic SICP textbook

      Harold Abelson and Gerald J. Sussman with Julie Sussman. Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996:

    2. First-order functions in Scala

      • Square root (Newton’s Method) version 1 with all public functions: Scala source
      • Square root (Newton’s Method) version 2 with nested function definitions: Scala source
      • Factorial — discussed in Recursion Styles notes above: Scala source
      • Fibonacci — discussed in Recursion Styles notes above: Scala source
      • Exponentiation — discussed in Recursion Styles notes above: Scala source
      • Greatest common divisor: Scala source
    3. Higher-order functions in Scala

Types and Functional Data Structures

  1. (11 Feb) Survey Type System Concepts

    1. Notes: HTMLPDF

    2. HTML slides

  2. (13, 15, 18, 20, 22, 25 Feb, 1 Mar) Study Functional Data Structures

    1. Background reading: “Functional Data Structures,” Chapter 3, Paul Chiusano and Runar Bjarnason, Functional Programming in Scala, Manning, 2015 (i.e. the Red Book)

    2. Lecture notes on Chapter 3 (primarily on List type): HTMLPDF

    3. Scala source: List2.scala

    4. Reference: See the discusion of the object-based paradigms above for general information on the object-oriented nature of Scala.

  3. (16 Feb) Distribute Assignment #2. Originally due 28 February, but extended to 4 March.

  4. (22 Feb) Take Quiz #2 over Recursion Styles, Type System Concepts, and Sections 3.1-3.2 of Functional Data Structures notes. (Returned on 25 Feb.)

  5. (27 Feb, 1 Mar) Examine a natural number arithmetic case study

    1. (for reference) Background on Peano arithmetic and design patterns

    2. Scala versions (2008, 2012, 2019)

      • Functional object-oriented with ordinary classes: Scala source

        This version uses an object-oriented hierarchy of classes/objects organized according to the Composite, Singleton, and Null Object software design patterns. Once created, the Nat objects are immutable. The operations do not modify the state of an object; they create new objects with the modified state. It carries out computations by “passing messages” among the objects, taking advantage of subtype polymorphism (dynamic binding) to associate method calls with the correct implementation. This version also encapsulates the state within the objects in the hierarchy.

      • Functional module with case classes: Scala source

        This version uses a Scala algebraic data type (defined using a sealed trait and case class/objects) with a group of functions defined in the companion object for the trait. It is organized similarly to the List algebraic data type from the Functional Data Structures chapter. This version uses pattern matching to identify the correct operation functionality. By using cases classes/objects, this version exposes the state outside the hierarchy.

      • Functional object-oriented with case classes: Scala source

        This version is in-between the implementations above. It uses the traditional OO structure, but uses case classes/objects instead of ordinary objects. It uses subtype polymorphism for the left argument and uses pattern matching for the right argument to select the correct operation functionality. By using cases classes/objects, this version exposes the state outside the hierarchy.

    3. Elixir version (2015):

    4. Lua version (2013, 2014): source nats2.lua

    5. Ruby version (2006): source Nat.rb

    6. Java version (2004), simpler, no generics:

References: Patterns and Testing

  1. (for reference) Survey design patterns

    1. Introduction to Patterns: HTMLPDFHTML slides

    2. John Vlissides. Designing with Patterns, In Pattern Hatching: Design Patterns Applied, Addison-Wesley, 1998: Powerpoint

    3. Patterns notes and slides:

    4. Additional references:

      • Source Making Design Patterns catalog
      • Siemens book: Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal. Pattern-Oriented Software Architecture: A System of Patterns, Wiley, 1996.
      • “Gang of Four” (GoF) book: Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software, Addison Wesley, 1995. Patterns*, Wiley, 1996.
      • Mary Shaw. Some Patterns for Software Architecture, In John M. Vlissides, James O. Coplien, and Norman L. Kerth, editors, Pattern Languages of Program Design 2, Addison Wesley, 1996, pages 255-270. – local
  2. (for reference) Examine software testing concepts

    1. Software Testing Concepts, Chapter 11, Exploring Language with Interpreters and Functional Programming (ELIFP): HTMLPDF

    2. Testing Haskell Programs, Chapter 12, Exploring Language with Interpreters and Functional Programming (ELIFP): HTMLPDF

    3. pytest Python testing framework

Functional Error Handling

  1. (4, 6, 8, 18, 20 Mar) Explore Handling Errors without Exceptions

    1. Background reading: “Handling Errors without Exceptions,” Chapter 4, Paul Chiusano and Runar Bjarnason, Functional Programming in Scala, Manning, 2015 (i.e. the Red Book)

    2. Lecture notes on Chapter 4: HTMLPDF

    3. Scala source code from notes: Option2.scalaEither2.scala

    4. Scala examples for parameter-passing discussion:

    5. Scala example for wrapping exceptions with Option and Either: WrapException.scala

  2. (8, 18 Mar) Discuss Semester Project

  3. (11-15 Mar) Enjoy Spring Break

  4. (18, 20 Mar) Continue discussion of notes on Handling Errors without Exceptions

  5. (18, 20, 22 Mar) Continue discussion of Semester Project; distribute description on 22 March

  6. (25 Mar) Take double-point Quiz #3 over notes on Functional Data Structures and Handling Errors without Exceptions

  7. (29 Mar) Return and discuss Quiz #3: Quiz03Test.scalaList3.scala

Abstract Data Types

  1. (22 Mar) Distribute description of Assignment #3 (Mealy Machine Simulator); (29 Mar) extend deadline

    See a similar, but imperative and object-oriented, implementation below for the Semantic Model (part e) for the State Machine used for for Fowler’s “Secret Panel” Controller External DSLs

  2. (20, 22, 27, 29 Mar; 1, 3, 5 Apr) Explore Abstract Data Types in Scala using the Labeled Digraph ADT case study

    1. Background reading on abstract data types

    2. Background reading on directed graph ADTs

      • Nell Dale and Henry Walker. “Directed Graphs or Digraphs,” Chapter 10, In Abstract Data Types: Specifications, Implementations, and Applications, pp. 439-469, D. C. Heath, 1996.
      • Conrad Barski. “Building a Text Game Engine,”, Chapter 5, In Land of Lisp: Learn to Program in Lisp, One Game at a Time, pp. 69-84, No Starch Press, 2011. The Common Lisp example in this chapter is similar to the classic Adventure game; the underlying data structure is a labeled digraph.
    3. Notes on Abstract Data Types in Scala: HTMLPDF

    4. Scala solutions using method-chaining abstract data type API

    5. (for reference) Haskell solutions

    6. (for reference) Elixir solutions

    7. (for reference) Notes on Data Abstraction (Parts of these notes have been integrated into the notes on Abstract Data Types in Scala above.)

      (not updated 2019) Notes on Data Abstraction—Java Supplement (These notes describe nongeneric Java implementations, circa 1997, of the Stack and Day ADTs specified in the Data Abstraction notes above.)

    8. (for reference) Lecture Notes on Modular Design (Parts of these notes have been integrated into the notes on Abstract Data Types in Scala above.)

    9. (for reference) H. C. Cunningham, Y. Liu, and J. Wang. “Designing a Flexible Framework for a Table Abstraction,” In Y. Chan, J. Talburt, and T. Talley, editors, Data Engineering: Mining, Information, and Intelligence, pp. 279-314, Springer, 2010.

    10. (for reference) Classic papers by David L. Parnas and associates:

  3. (8 Apr) Take Quiz #4 over Abstract Data Types in Scala above; returned 10 April@. (10 Apr) Post Challenge Assignment #4

  4. (10 Apr) Host guest lecture by J. P. Marum on reactive programming (20 minutes)

  5. (10 Apr) Distribute Optional Assignment #4

    1. Sandwich DSL Implementation (one opiton on assignment)

Lazy Data Structures

  1. (10 Apr; 1, 3 May) Explore Strictness and Laziness

    1. Background reading: “Strictness and Laziness,” Chapter 5, Paul Chiusano and Runar Bjarnason, Functional Programming in Scala

    2. Lecture notes on Chapter 5: HTMLPDF

    3. Scala source code from notes: StreamC.scala

    4. (for reference) John Hughes, Why Functional Programming Matters, Computer Journal, Vol. 32, No. 2, pp. 98-107, 1989.

    5. (for reference) Notes on Functional Program Evaluation Concepts – not updated 2019

Semester Project Presentations

  1. (15 Apr) Yunshu Wang and Silu Zhang: Spark Fundamentals

  2. (17 Apr) Nusrat Armin and Carla Rego: PySpark and Jupyter

  3. (22 Apr) Matthew Toche: Scala Futures and Promises

  4. (24 Apr) Chris Donelson and Deep Sharma: Squants Package

  5. (26 Apr) Amulya Arora (and Layton Jones): Software Testing

  6. (29 Apr) Saman Ray: Akka Actors in Scala

  7. (3 May) Layton Jones Project Presentation (Software Testing)

End of Semester

  1. (1 May) Continue exploring Strictness and Laziness above

  2. (3 May) Take Quiz #5 over Chapter 5 Strictness and Laziness

  3. (6 May: Noon – 3:00 p.m.) Optional final exam: Contact instructor by Noon on 3 May if you plan to take this exam!

  4. END of Spring 2019 semester: Enjoy Summer!

More on Abstract Data Types

  1. (for reference) Use the Digraph ADT module (to build a game)

    TODO: Create a Scala version of this example.

    1. Wizard’s Adventure game, Elixir Version 1

      This game is based on Chapters 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.

      Concepts: Importing Elixir modules, use of Elixir features such as atoms, maps, pipes, and complex pattern matching, designing functional programs to handle global state; use of Elixir API modules Enum, Dict, List, Keyword, String, IO, etc.).

    2. Wizard’s Adventure game, Elixir Version 2

      This version uses a higher-order function to generate game actions and improved handling of the game state.

      Additional concepts: Use of higher-order factory function to generate functions from first- and higher-order arguments; storing functions in a data structure, calling functions stored in a data structure; use of mutator (setter) and accessor (getter) functions for the data structure.

  2. (for reference) Examine the CookieJar ADT case study (and other examples)

    1. Cookie Jar ADT Problem Description

    2. Description of Bag Concept (used in specification)

    3. Immutable CookieJar ADT Implementation in Scala (ICookieJar.scala) – uses method-chaining functional style with immutable objects

    4. Mutable CookieJar ADT Implementation in Scala (CookieJar) – uses object-oriented style with mutable state

    5. Carrie’s Candy Bowl ADT in Lua – gives the specification of a Candy Bowl ADT (similar to the Cookie Jar above) and two implementation using Lua modules

    6. Carrie’s Candy Bowl ADT in Scala

    7. Older mutable Java abstract data type implementations. These use nongeneric Java implementations done during the 1997-98 timeframe

      • Queue ADT – gives a specification for a Queue ADT and implements the ADT directly as two concrete classes
      • Ranked Sequence ADT – gives a specification for a Ranked Sequence ADT (similar to ArrayList or Vector)

NOT FULLY UPDATED

Games

  1. (for reference) Examine the Dice of Doom game

    1. Background: Conrad Barski. Land of Lisp: Learn to Program in Lisp, One Game at a Time, No Starch Press, 2011.

    2. Dice of Doom, Elixir Version 1a

      This is a basic eagerly evaluated version (similar to that developed on pages 303-325 of Land of Lisp). This version supports either two human players or a human player and a simple, minimax search-based “AI” (artificial intelligence) opponent.

    3. Dice of Doom, Elixir Version 1b

      This is an eager version above with an attempt at memoization of functions neighbors and game_tree using the Elixir Agent modules.

    4. Dice of Doom, Elixir Version 2a,

      This is a lazy version using Elixir Stream data structures (but without the memoization optimizations). This is based on version 1a above plus the discussion from pages 384-389 in chapter 18 of Land of Lisp. This version implements a limited depth minimax search, but it does not implement the artificial intelligence heuristics given in the last part of chapter 18.

Domain-Specific Languages

  1. (TBD) Discuss domain-specific languages and Sandwich DSL case study

    1. Concepts: domain-specific languages (DSLs); DSLs versus general-purpose programming languages; external versus internal DSLs; shallow versus deep embedding of internal DSLs; use of algebraic data types to implement DSLs

    2. Notes: Domain-Specific Languages

    3. Sandwich DSL Implementation

    4. Sandwich DSL in Lua (similar but not identical to Haskell description

  2. (for reference) Discuss State Machine External DSLs based on Martin Fowler’s Secret Panel Controller (State Machine) DSLs

    1. Backgrond: Martin Fowler. Domain Specific Languages, Addison Wesley, 2011.

      • Fowler introduces the running example, the Secret Panel Controller (State Machine) case study, in DSL Chapter 1)
      • Fowler DSL Chapter 1 “An Introductory Example
      • Fowler DSL Chapter 2 “Using Domain-Specific Languages”
      • Fowler DSL Chapter 3 “Implementing DSLs”
      • Fowler DSL Chapter 5 “Implementing an External DSL”
      • Fowler DSL Chapter 8 “Code Generation”
      • Fowler DSL Chapter 11 “Semantic Model”
      • Fowler DSL Chapter 17 “Delimiter-Directed Translation”
      • Fowler DSL Chapter 18 “Syntax-Directed Translation”
      • Fowler DSL Chapter 21 “Recursive Descent Parser”
      • Fowler DSL Chapter 21 “Parser Generator”
      • Fowler DSL Chapter 22 “Parser Combinator”
      • Fowler DSL Chapter 51 “State Machine”
      • Fowler DSL Chapter 52 “Transformer Generation”
      • Fowler DSL Chapter 55 “Model Aware Generation”
      • Fowler DSL Chapter 56 “Model Ignorant Generation”
      • Fowler’s List of DSL Patterns from DSL book.
    2. Other items from the instructor’s notes

    3. Scala notes

      • I developed the Scala versions in 2009 by referring to an in-work version of Fowler’s book on his website, so they may not follow his final book precisely. Fowler’s code is in Java, Ruby, C#, etc. I updated the Scala programs in 2018 to make sure they would compile and execute under the current Scala release.
    4. Graphviz and dot language reference and examples

    5. Scala State Machine Semantic Model (Fowler Ch. 1, 3, 11)

    6. Scala XML-based External DSL (Fowler Ch. 1, 3, 5)

    7. Scala Custom External DSL with a Delimiter-Directed parser (Fowler Ch. 1, 3, 5, 17)

    8. Scala Custom External DSL with hand-coded Ad Hoc Recursive-Descent parser (Fowler Ch. 1, 3, 5, 21)

    9. Scala Custom External DSL (using Scala parser combinator library) with embedded state machine builder (Fowler Ch. 1, 3, 5, 22)

    10. Scala Custom External DSL (using Scala parser combinator library) with full AST construction (Fowler Ch. 1, 3, 5, 22)

    11. Scala Static C Code Generator with Model-Aware target platform library (Fowler Ch. 1, 3, 5, 8, 52, 55)

    12. Scala Graphviz Dot Language Code Generator (added 2018) (Fowler Ch. 1, 3, 5, 8, 52)

  3. (TBD) Discuss Fowler’s Computer Configuration Internal (Ch. 4, 35, 36, 38)

    1. Background: Martin Fowler. Domain Specific Languages, (Addison Wesley, 2011).

      • Martin Fowler’s List of DSL Patterns from Domain Specific Languages, Addison Wesley, 2011
      • Fowler DSL Chapter 1 “An Introductory Example
      • Fowler DSL Chapter 2 “Using Domain-Specific Languages”
      • Fowler DSL Chapter 3 “Implementing DSLs”
      • Fowler DSL Chapter 4 “Implementing an Internal DSL”
      • Fowler DSL Chapter 11 “Semantic Model”
      • Fowler DSL Chapter 13 “Context Variable”
      • Fowler DSL Chapter 32 “Expression Builder”
      • Fowler DSL Chapter 33 “Function Sequence”
      • Fowler DSL Chapter 34 “Nested Functions”
      • Fowler DSL Chapter 35 “Method Chaining”
      • Fowler DSL Chapter 36 “Object Scoping”
      • Fowler DSL Chapter 37 “Closure”
      • Fowler DSL Chapter 38 “Nested Closure”
      • Fowler DSL Chapter 39 “Literal List”
      • Fowler DSL Chapter 40 “Literal Map”
    2. Scala versions (2009)

  4. (TBD) Discuss Fowler’s Email Message Building Internal DSL (Ch. 35)

    1. Background: Martin Fowler. Domain Specific Languages, (Addison Wesley, 2011). See listing of chapters under Computer Configuration internal DSL above.

    2. Scala versions (2009)

  5. Explore Fowler’s Lair Configuration DSLs

    1. Background on Lair DSL

    2. Background on internal DSLs: Martin Fowler. Domain Specific Languages, (Addison Wesley, 2011).

      See the CSci 658 (Software Language Engineering) course materials for more information about DSLs.

    3. Background on Lua

      • See Lua references below

      • Several of the Lair DSL programs must execute with Lua 5.1 because they use a few Lua platform features changed in Lua 5.2 or 5.3. I installed the lua@5.1 package on my iMacs using the Homebrew package manager.

      • At the terminal command line, lua5.1 testNN.lua compiles and executes the test driver program for the DSL with files builder program builderNN.lua and DSL script rulesNN.lua.

    4. Shared modules

      Fowler’s Ruby source

      Lua (2013)

      Python 3 (2018)

    5. Internal DSL using Global Function Sequence pattern

      Fowler’s Ruby

      Lua (2013)

      Python 3 (2018)

    6. Internal DSL using Class Method Function Sequence and Method Chaining patterns

      Fowler’s Ruby

      Lua (2013)

      Python 3 (2018)

    7. Internal DSL using Expression Builder and Method Chaining patterns

      Fowler’s Ruby

      Lua (2013)

      Python 3 (2018)

    8. Internal DSL using Nested Closures pattern

      Fowler’s Ruby

      Lua (2013)

      Python 3 – none yet. (Python’s weak syntactic support for lambdas does not allow the relatively direct approach usable in Ruby, Scala, and Lua.)

    9. Internal DSL using Expression Builder, Object Scoping, and Method Chaining patterns

      Fowler’s Ruby

      Lua (2013)

      Python 3 – none yet

    10. Internal DSL using Literal Collection pattern

      Fowler’s Ruby

      Lua (2013)

      Python 3 – none yet

    11. External DSL using Parser/Builder (no corresponding example in Fowler book chapter)

      Lua (2013)

      Python 3 (2018)

  6. (TBD) Discuss Fowler’s DSL Reader framework (2006)

    1. Background:

    2. Ruby shared modules (2006)

    3. Ruby direct configuration and testing of Reader (2006)

    4. Ruby single-pass external text DSL (2006)

    5. Ruby two-pass external XML DSL (2006)

    6. Ruby internal DSL

  7. H.C. Cunningham. “A Little Language for Surveys: Constructing an Internal DSL in Ruby,” In Proceedings of the ACM SouthEast Conference, 6 pages, March 2008.

    1. manuscript

    2. presentation

    3. Ruby source

    4. test DSL input file

    5. test DSL input file with errors

Object-Oriented Programming and Frameworks

  1. (for reference) Simple, silly Employee hierarchy example

    1. Scala (2008, 2010)

    2. Ruby (2006)

  2. (TBD) Overview object-oriented programming in Scala

    1. Instructor’s notes on Object-Oriented Software Development

    2. Scala translation of Frog dynamic composition example:   Scala sourceoutput

    3. Modified Philosophical Frog example from Odersky et al:
      Scala sourceoutput

    4. Modified Stackable traits example (IntQueue) from Odersky et al:
      Scala sourceoutput

  3. (TBD) Frameworks, based on Timothy Budd’s An Introduction to Object-Oriented Programming, Third Edition, Chapter 21

    1. Simple Sorting Framework examples.

    2. Ice Cream Store discrete event simulation.

  4. (TBD) Cunningham group “Using Classic Problems …” paper.

    1. H. C. Cunningham, Y. Liu, and C. Zhang. “Using Classic Problems to Teach Java Framework Design,” Science of Computer Programming, Special Issue on Principles and Practice of Programming in Java (PPPJ 2004), Vol. 59, No. 1-2, pp. 147-169, January 2006. doi: 10.10.16/j.scico.2005.07.009. preprint PDF

    2. Related tutorial: H. C. Cunningham, Y. Liu, and C. Zhang. “Teaching Framework Design Using Classic Problems,” Journal of Computing Sciences in Colleges, Vol. 21, No. 5, pp. 10-12, CCSC, May 2006: abstract presentation

  5. (TBD) Scala Divide-and-Conquer Framework, similar to the Java framework in the “Using Classic Problems …” paper

    1. Template-based Divide-and-Conquer Framework (DivConqTemplate):
      Scala source

    2. Strategy-based Divide-and-Conquer Framework (DivConqStrategy):
      Scala source

    3. Traits for Problem and Solution descriptions for both frameworks (DivConqProblemSolution):
      Scala source

    4. Application of Template-based framework to QuickSort (QuickSortTemplateApp):
      Scala sourceprogram output

    5. Application of Strategy-based framework to QuickSort (QuickSortStrategyApp):
      Scala sourceprogram output

    6. Descriptor for QuickSort state for both QuickSort applications (QuickSortDesc):
      Scala source

  6. (TBD) Scala Binary Tree Framework, similar to the Java framework in the “Using Classic Problems …” paper

    1. Straightforward translation of the Java program to Scala:

      • Top-level framework (BinTreeFramework): Scala source
      • Second-level Euler tour framework (EulerTourVisitor): Scala source
      • Second-level mapping framework (MappingVisitor): Scala source
      • Second-level breadth-first framework (BreadthFirstVisitor): Scala source
      • Application of BinTree frameworks (BinTreeTest): Scala source
    2. Generic implementation of BinTree framework in Scala:

      • Top-level framework (BinTreeFramework): Scala source
      • Second-level Euler tour framework (EulerTourVisitor) Scala source
      • Second-level mapping framework (MappingVisitor): Scala source
      • Second-level breadth-first framework (BreadthFirstVisitor): Scala source
      • Application of BinTree frameworks (BinTreeTest): Scala source

Programming Language Reference Materials

  1. Free online programming language textbooks and tutorials

Haskell

  1. Learn X in Y Minutes, Where X = Haskell

  2. H. Conrad Cunningham. Introduction to Functional Programming Using Haskell, Computer and Information Science, University of Mississippi, 2016-2017. (I am writing this “textbook” primarily for CSci 450 and likely will use the title Exploring Languages with Interpreters and Functional Programming for the Fall 2018 draft.)

  3. H. Conrad Cunningham. Notes on Functional Programming with Haskell, Computer and Information Science, University of Mississippi, 1994-2014. (I am revising this document and integrating it with other materials to produce the new “textbook” above Exploring Languages with Interpreters and Functional Programming. The chapters at the chapters at the end have not yet been integrated.)

  4. Haskell language website

    1. Haskell 2010 Language Report
    2. GHC User’s Guide
  5. Haskell Cheat Sheet

  6. School of Haskell online tutorials

  7. 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.)

  8. 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.

  9. 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.

  10. Simon Marlowe. Parallel and Concurrent Programming in Haskell: Techniques for Multicore and Multithreaded Programming,

    1. This book is also available in print, published by O'Reilly Media, 2013.
  11. Bryan O'Sullivan, Don Stewart, and John Goerzen. Real World Haskell,

    1. This book is also available in print, published by O'Reilly Media in November 2008.

Lua

  1. Learn X in Y Minutes, Where X = Lua

  2. Definitive reference: Roberto Ierusalimshcy. Programming in Lua, Fourth Edition, Lua.org, Rio de Janiero, Brazil, 2016. (The First Edition of this book, covering Lua 5.0, is available online at https://www.lua.org/pil/contents.html.)

  3. Instructor’s Lua slides (from CSci 450, Fall 2016)

    1. 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.
    2. Introduction to Lua HTML slides based, in part, on Mascarenhas slide sets 0-5
    3. Advanced Lua Functions HTML slides based, in part, on Mascarenhas slide set 6
    4. Modules in Lua HTML slides based, in part, on Mascarenhas slide set 9
    5. Lua Metatables HTML slides based, in part, on Mascarenhas slide set 10
    6. Lua Objects HTML slides based, in part, on Mascarenhas slide set 11

Python 3

  1. Learn X in Y Minutes, Where X = Python3

  2. Bernd Klein. Python Course

Ruby

  1. Learn X in Y Minutes, Where X = Ruby

  2. Chris Pine. Learn to Program

  3. why the lucky stiff (Jonathan Gillette). why's (poignant) guide to Ruby

Scala

  1. Learn X in Y Minutes, Where X = Scala

  2. Definitive reference: Martin Odersky, Lex Spoon, and Bill Venners. Programming in Scala, Third Edition, Artima, 2016. The first edition (2008) is available online at http://www.artima.com/pins1ed/.

  3. Martin Odersky. Scala by Example, EPFL, 2014. [local]

  4. Instructor’s Notes on Scala for Java Programmers

  5. Paul Chiusano and Runar Bjarnason. Functional Programming in Scala, Manning, 2015.

    1. Instructor’s Notes on Functional Data Structures (Chapter 3)
    2. Instructor’s Notes on Error Handling without Exceptions (Chapter 4)
    3. Instructor’s Notes on Strictness and Laziness (Chapter 5)

Copyright (C) 2020, H. Conrad Cunningham
Format Updated 16 August 2020