Notes on
Functional Programming in Scala
Chapter Index
H. Conrad Cunningham
20 April 2022
Browser Advisory: The HTML version of this textbook requires a browser that supports the display of MathML. A good choice as of April 2022 is a recent version of Firefox from Mozilla.
Instability Warning: This version of the Notes on Functional Programming in Scala is in work beginning in January 2022. The author may change its structure and content without warning. No changes are planned to the 2018 version upon which the this version is based. The stable version is on the Fall 2018 CSci 450 course website.
Feedback Request: The author plans to publish this textbook eventually. He invites anyone using this book to give him feedback on its current structure and content: to point out typos and other errors or suggest improvements and extensions. He can be contacted at hcc AT cs DOT olemiss DOT edu.
This document also examines implementations in Elixir, Lua, Racket Scheme, Elm, and Python.
TODO: Mention and link to Haskell and Lua discssions.
This document also examines implementations in Elixir, Lua, Ruby, and Java.
TODO: Better order, integrate, and title the discussions of ADTs in Scala.
We discuss Scala immutable (i.e., functional) implementations of a CookieJar abstract data type (ADT) in this possible future chapter.
This document also examines mutable Scala, Python, and Ruby implementations.
TODO: Better order, integrate, and title the discussions of ADTs in Scala.
TODO: Mention and link to Haskell and Elixir implementations.
In Spring 2016, I drafted this set of notes to accompany my lectures on functional programming in Scala using, in part, the book Functional Programming in Scala [2] (i.e., the Red Book) for my Scala-based, Spring 2016 version of CSci 555 (Functional Programming) at the University of Mississippi. I constructed the notes around the ideas, general structure, and Scala examples from the Red Book and its associated materials [3,4]. I also adapted some discussion and examples from my Haskell-based Notes on Functional Programming with Haskell [5], Odersky’s Scala by Example [6], and my previous notes on teaching multiparadigm programming using Scala.
The Red Book [2] is an excellent book for self-study, but it needed expanded explanations to be useful to me as a textbook for students who were novices in both Scala and functional programming.
In Spring 2019, I again offered a Scala-based version of CSci 555 and continued to revise and extend these lecture notes.
I retired from the full-time faculty in May 2019. As one of my post-retirement projects, I am continuing work on the ELIFP textbook and other instructional materials. In January 2022, I began refining the ELIFP content and related documents such as this one. I am integrating separately developed materials better, reformatting the documents (e.g., using CSS), constructing a unified bibliography (e.g., using citeproc), and improving the build workflow and use of Pandoc. I adapted this index page from aportions of my Fall 2018 CSci 556 and Spring 2019 CSci 555 course notes pages.
I maintain these notes as text in Pandoc’s dialect of Markdown using embedded LaTeX markup for the mathematical formulas and then translate the notes to HTML, PDF, and other forms as needed.