% [CSci 555 : Functional Programming](<../csci555.html>) \
  Spring Semester 2019 \
  Lecture Notes
% **[H. Conrad Cunningham](<https://www.cs.olemiss.edu/~hcc>)**

| Professor of
  [Computer and Information Science ](<https://www.cs.olemiss.edu/>)
| [School of Engineering](<https://engineering.olemiss.edu>)
| [University of Mississippi ](<http://www.olemiss.edu>)

---
lang: en-us
---

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**](<#current\_lecture>) 


## Class Introduction

@.  **(23 Jan)** Discuss class organization and Syllabus:
    [HTML](<../555syl\_sp19.html>) --
    [PDF](<../555syl\_sp19.pdf>)


## Programming Paradigms

@.  **(25, 28 Jan)** Survey the *Primary Paradigms* (ELIFP Chapter 2)
	
	a.  Chapter:
	    [HTML
        ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02\_Programming\_Paradigms.html>)
	    --
		[PDF
		](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02\_Programming\_Paradigms.pdf>)
		
	#.  HTML slides: 
	    [Scala version
        ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/ParadigmsSlides_Scala.html>)
		--
		[Original ELIFP
        ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/ParadigmsSlides.html>)
	
	#.  Scala examples:

	    -   [Imperative example `CountingImp.scala`
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingImp.scala>)
		-   [Imperative example `CountingImp2.scala` 
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingImp2.scala>)
		-   [Functional example `CountingFun.scala`
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingFun.scala>)
		-   [Procedural example `CountingProc.scala`
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingProc.scala>)
		-   [Modular example `CountingMod.scala`
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingMod.scala>)
        -   [Modular example `CountingMod2.scala` 
            ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingMod2.scala>)


@.  **(25 Jan)** Motivate the study of functional programming

    a.  [Excerpt from Backus' 1977 Turing Award Address 
	    ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02\_Programming\_Paradigms.html#motivating-functional-programming-john-backus>)

    #.  (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 
		](<localcopy/Backus_Turing_Award_Address.pdf>),
        *Communications of the ACM* 21.8 (1978): 613-641.


@.  <a name="ObjectBased"></a> 
    (for reference) Survey the *Object-Based Paradigms* (ELIFP Ch. 3)

    a.  Chapter: 
	    [HTML
	    ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/03\_Object\_Paradigms.html>)
		--
        [PDF 
		](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/03\_Object\_Paradigms.pdf>)
		
	#.  HTML Slides: 
	    [Original ELIFP
	    ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/ObjectBasedSlides.html>)
  
    #.  Scala example:
        [Object-Oriented `CountingOO.scala`
        ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingOO.scala>)

    #.  Additional notes:
	    [Object-Oriented Software Development ](<OOSoftDev.html>)

    #.  Additional slides on Using CRC Cards (Class-Responsibility-Collaboration):
        [HTML slides](<UsingCRC.html>)

        -   Background: Kent Beck and Ward Cunningham.
		    [A Laboratory for Teaching Object-Oriented Thinking 
			](<http://c2.com/doc/oopsla89/paper.html>),
		    In *Proceedings of the OOPSLA'89 Conference*, ACM, 1989.

        -   Tutorial: Paul Gestwicki. 
		    [CRC Card Analysis (YouTube) 
		    ](<https://www.youtube.com/watch?v=otKUer13HnA>), 
		    Ball State University, February 2016.


## Basic Scala 


@.  **(30 Jan, 1, 4, 6 Feb)** Introduce Scala to Java programmers
		
    a.  Note: These Notes were adapted from: 
	    Michel Schniz and Philipp  Haller,
	    [A Scala Tutorial for Java Programmers 
		](<http://docs.scala-lang.org/tutorials/scala-for-java-programmers.html>)

    #.  *Notes on Scala for Java Programmers*:
        [HTML](<ScalaForJava/ScalaForJava.html>)
		--
        [PDF](<ScalaForJava/ScalaForJava.pdf>)

	    Diagram for [Scala's unified type hierarchy 
		](<https://docs.scala-lang.org/tour/unified-types.html>)

			
    #.  Scala source code from Notes:

        -   [`HelloWorld.scala`](<ScalaForJava/HelloWorld.scala>)
        -   [`FrenchDate.scala`](<ScalaForJava/FrenchDate.scala>) and
            [`MoreDates.scala`](<ScalaForJava/MoreDates.scala>)
        -   [`Timer.scala`](<ScalaForJava/Timer.scala>) --
            [`TimerAnonymous.scala` ](<ScalaForJava/TimerAnonymous.scala>)
        -   [`ComplexNumbers.scala` 
		    ](<ScalaForJava/ComplexNumbers.scala>) --
            [`ComplexNumbers2.scala` 
			](<ScalaForJava/ComplexNumbers2.scala>) --
            [`ComplexNumbers3.scala` ](<ScalaForJava/ComplexNumbers3.scala>)
        -   [`ExprCase.scala` ](<ScalaForJava/ExprCase.scala>) --
            [`ExprObj.scala` ](<ScalaForJava/ExprObj.scala>)
        -   [`OrderedDateTest.scala` ](<ScalaForJava/OrderedDateTest.scala>)

    #.  (for reference) Miscellaneous overviews, cheat sheets, and tutorials
	
		-   [Tour of Scala ](<https://docs.scala-lang.org/tour/tour-of-scala.html>)
        -   [Java and Scala Comparison Cheatsheet 
            ](<https://www.jeffshaw.me/cheat/>)
        -   [Concise Java to Scala
            ](<http://www.cis.upenn.edu/~matuszek/Concise%20Guides/Concise%20Java%20to%20Scala.html>)
        -   [Learn X in Y Minutes, Where X = Scala
            ](<https://learnxinyminutes.com/docs/scala/>)


@.  **(1 Feb)** Distribute Assignment #1. Due 13 Feb.


## Recursive Programming

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

    a.  Notes: 
	    [HTML](<RecursionStyles/RecursionStylesScala.html>)
	    --
        [PDF](<RecursionStyles/RecursionStylesScala.pdf>)
		
	#.  [HTML Slides ](<RecursionStyles/RecursionStylesSlidesScala.html>)

    #.  Scala source code from Notes:
	    [`RecursionStyles.scala` 
		](<RecursionStyles/RecursionStyles.scala>)

    #.  (for reference) ["Tail Call" article on *Wikipedia* 
	    ](<http://en.wikipedia.org/wiki/Tail_call>)
		

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

@.  (for reference) Examine functions adapted from SICP

    a.  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:

		-   [book site at MIT Press ](<http://mitpress.mit.edu/sicp/>)
		-   [HTML book 
		    ](<http://mitpress.mit.edu/sicp/full-text/book/book.html>)
		-   [SICP ebook site ](<http://sicpebook.wordpress.com/>)
		-   [local copy of source code ](<otherFP/SICP\_allcode>)

    #.  First-order functions in Scala

	    -   Square root (Newton's Method) version 1 with all
            public functions:
            [Scala source ](<SICP\_examples/Scala/sqrt.scala>)
        -   Square root (Newton's Method) version 2 with nested
            function definitions:
            [Scala source ](<SICP\_examples/Scala/sqrt2.scala>)
        -   Factorial --- discussed in Recursion Styles notes
            above:
            [Scala source ](<SICP\_examples/Scala/factorial.scala>)
        -   Fibonacci --- discussed in Recursion Styles notes
            above:
            [Scala source ](<SICP\_examples/Scala/fibonacci.scala>)
        -   Exponentiation --- discussed in Recursion Styles
            notes above:
            [Scala source ](<SICP\_examples/Scala/exponentiation.scala>)
        -   Greatest common divisor:
            [Scala source ](<SICP\_examples/Scala/gcd.scala>)

    #.  Higher-order functions in Scala

        -   Summation (takes function arguments):
            [Scala source](<SICP\_examples/Scala/summation.scala>)		
        -   Derivative (returns function result):
            [Scala source](<SICP\_examples/Scala/derivative.scala>)


## Types and Functional Data Structures

@.  **(11 Feb)** Survey *Type System Concepts*

    a.  Notes: 
	    [HTML](<TypeConcepts/TypeSystemConcepts.html>)
		--
        [PDF](<TypeConcepts/TypeSystemConcepts.pdf>)
		
	#.  [HTML slides](<TypeConcepts/TypeConceptsSlides.html>)


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

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

    #.  Lecture notes on Chapter 3 (primarily on `List` type): 
		[HTML](<FPS03/FunctionalDS.html>)
		--
        [PDF](<FPS03/FunctionalDS.pdf>)

    #.  Scala source: [`List2.scala`](<FPS03/List2.scala>)
	
	#.  Reference: See the discusion of the 
	    <a href="#ObjectBased">object-based paradigms</a> above for
	    general information on the object-oriented nature of Scala.


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


@.  **(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.)


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

    a.  (for reference) Background on Peano arithmetic and design patterns
	
	    -   ["Peano Axioms" article on Wikipedia 
		    ](<http://en.wikipedia.org/wiki/Peano_axioms>)
        -   ["Peano's Axioms" on Wolfram MathWorld 
		    ](<http://mathworld.wolfram.com/PeanosAxioms.html>)	
	    -   [Source Making Design Patterns catalog 
		    ](<https://sourcemaking.com/design_patterns>) -- for 
		    information on the Composite, Singleton, and Null Object 
		    design patterns used in this case study
		
    #.  Scala versions (2008, 2012, 2019)

        -   Functional object-oriented with ordinary classes:
            [Scala source](<Nat/Scala/TestNats.scala>)
			
			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](<Nat/Scala/TestCaseExtNats.scala>)
			
			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](<Nat/Scala/TestCaseObjNats.scala>)
			
			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.

    #.  Elixir version (2015):
	
		-   [Nat module  ](<Nat/Elixir/Nat.ex>) 
        -   [test module ](<Nat/Elixir/Nat\_Test.ex>) 
        -   [test script ](<Nat/Elixir/Nat.exs>) 

    #.  Lua version (2013, 2014): 
	    [source `nats2.lua` ](<Nat/Lua/nats2.lua>)

    #.  Ruby version (2006): 
	    [source `Nat.rb` ](<Nat/Ruby/Nat.txt>)

    #.  Java version (2004), simpler, no generics:
	
	    -   [abstract base class `Nat` ](<Nat/Java/Nat.java>) 
	    -   [subclass `Zero` ](<Nat/Java/Zero.java>) 
	    -   [subclass `Succ` ](<Nat/Java/Succ.java>) 
	    -   [subclass `Err`  ](<Nat/Java/Err.java>) 
	    -   [main program `TestNat` ](<Nat/Java/TestNat.java>) 


## References: Patterns and Testing

@.  <a name="DesignPatterns"></a>
    (for reference) Survey design patterns
	
    a.  Introduction to Patterns:
	    [HTML](<Patterns/Patterns.html>) --
	    [PDF](<Patterns/Patterns.pdf>) --
		[HTML slides](<Patterns/Intro\_Patterns.html>) 

    #.  John Vlissides. Designing with Patterns, 
        In *Pattern Hatching: Design Patterns Applied*, 
	    Addison-Wesley, 1998: 
        [Powerpoint](<Patterns/sle\_Designing\_with\_Patterns.ppt>) 

    #.  Patterns notes and slides:
	
        -   Pipes and Filters architectural pattern:
		    [HTML ](<Patterns/Pipes.html>) --
	        [PDF ](<Patterns/Pipes.pdf>) --
	        [Powerpoint ](<Patterns/sle\_Pipes\_Filters\_Pattern.ppt>)
        -   [Factory Method design pattern (Powerpoint) 
			](<Patterns/sle\_Factory\_Method\_Pattern.ppt>) 
        -   [Strategy design pattern (Powerpoint) 
		    ](<Patterns/sle\_Strategy\_Pattern.ppt>) 
        -   [Template Method design pattern (Powerpoint) 
		    ](<Patterns/sle\_Template\_Method\_Pattern.ppt>) 

    #.  Additional references:

	    -   [Source Making Design Patterns catalog
		    ](<https://sourcemaking.com/design_patterns>)
        -   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 ](<http://www.google.com/url?sa=t&source=web&ct=res&cd=9&ved=0CDMQFjAI&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.131.4205%26rep%3Drep1%26type%3Dpdf&ei=pA7XS82YIYHMNN_HqPsF&usg=AFQjCNGBwu48uiRxFJO1pgCIi94jSdu4FA&sig2=Ut3P0nKWRUwqByT_CFsIZw>), 
            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 ](<localcopy/Shaw\_Patterns\_Arch.pdf>)


@.  <a name="SoftwareTesting"></a> 
    (for reference) Examine software testing concepts

    a.  Software Testing Concepts, Chapter 11, 
	    *Exploring Language with Interpreters and Functional
	    Programming* (ELIFP):
	    [HTML ](<https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch11/11\_Testing\_Concepts.html>)
	    --
	    [PDF ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch11/11\_Testing\_Concepts.pdf>)

    #.  Testing Haskell Programs, Chapter 12,
	    *Exploring Language with Interpreters and Functional Programming* (ELIFP):
	    [HTML 
	    ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch12/12\_Testing\_Haskell.html>)
		-- 
        [PDF 
	    ](<https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch12/12\_Testing\_Haskell.pdf>)


    #.  [pytest Python testing framework 
	    ](<https://docs.pytest.org/en/latest/>)


## Functional Error Handling

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

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

    #.  Lecture notes on Chapter 4:
		[HTML](<FPS04/ErrorHandling.html>) -- 
		[PDF ](<FPS04/ErrorHandling.pdf>)
			
    #.  Scala source code from notes:
        [`Option2.scala` ](<FPS04/Option2.scala>) --
		[`Either2.scala` ](<FPS04/Either2.scala>)

	#.  Scala examples for parameter-passing discussion:
	    
		-   Closures:
		    [`ClosureExample.scala` ](<Closures/ClosureExample.scala>) --
	        [`ClosureExample.out`   ](<Closures/ClosureExample.out>) 
	    -   Thunks:
		    [`ThunkExample.scala`   ](<Closures/ThunkExample.scala>) --
	        [`ThunkExample.out`     ](<Closures/ThunkExample.out>) 

    #.  Scala example for wrapping exceptions with `Option`{.scala} 
	    and `Either`{.scala}: 
		[`WrapException.scala` ](<FPS04/WrapException.scala>)


@.  **(8, 18 Mar)** Discuss Semester Project


@.  **(11-15 Mar) Enjoy Spring Break**


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


@.  **(18, 20, 22 Mar)** Continue discussion of Semester Project;
    distribute [description ](<../homework/555project.html>) 
	on 22 March
	
@.  **(25 Mar)** Take *double-point* Quiz #3 over notes on *Functional
    Data Structures* and *Handling Errors without Exceptions*

@.  **(29 Mar)** Return and discuss Quiz #3: 
    [`Quiz03Test.scala` ](<Quiz03/Quiz03Test.scala>) --
    [`List3.scala` ](<Quiz03/Quiz03Test.scala>) 


## Abstract Data Types
	
@.  **(22 Mar)** Distribute description of 
    [Assignment #3 ](<../homework/555project.html>) (Mealy Machine Simulator);
	(29 Mar) extend deadline 

	See a similar, but imperative and object-oriented, implementation
	below for the 
	[Semantic Model ](<#stateMachineSemantic>) (part e) for the 
	[State Machine](<#stateMachineDSL>) used for
	for Fowler's "Secret Panel" Controller External DSLs


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

    a.  Background reading on abstract data types
			
        -   ["Abstract data type" article
		    ](<http://en.wikipedia.org/wiki/Abstract\_data\_type>) 
			on Wikipedia 
        -   Nell Dale and Henry Walker. "Abstract Specification
            Techniques," Chapter 1, In *Abstract Data Types:
            Specifications, Implementations, and Applications*,
            pp. 1-34, D. C. Heath, 1996.
        -   William R. Cook. 
		    [Object-Oriented Programming Versus Abstract Data Types
	        ](<http://www.cs.utexas.edu/~wcook/papers/OOPvsADT/CookOOPvsADT90.pdf>),
            In *Proceedings of the REX Workshop/School on the Foundations of
            Object-Oriented Languages (FOOL)*, LNCS 489, pp. 151-178,
            Springer-Verlag, 1990. 
			-- [local copy ](<localcopy/CookOOPvsADT90.pdf>)
        -   William R. Cook. 
		    [On Understanding Data Abstraction Revisited 
			](<http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf>), 
            In *Proceedings of OOPSLA*, October 2009:
            -- [local copy 
			](<localcopy/understanding\_Data\_Abstraction\_Revisited.pdf>)
			
    #.  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.
		
	#.  Notes on *Abstract Data Types in Scala*:
	    [HTML ](<Digraph/Scala/AbstractDataTypes.html>) --
        [PDF ](<Digraph/Scala/AbstractDataTypes.pdf>)
		
    #.  Scala solutions using method-chaining abstract data type API
	
        -   Abstract data type specification and Scala trait
            (interface): \
            [ADT interface trait `Digraph` ](<Digraph/Scala/Digraph.scala>)
        -   List representation for vertices and edges: \
		    [class `DigraphList` ](<Digraph/Scala/DigraphList.scala>) --
			[test program `Test_DigraphList.scala` 
			](<Digraph/Scala/Test\_DigraphList.scala>) 
        -   Map (HashMap) representation for graph: \
		    [class `DigraphMap` ](<Digraph/Scala/DigraphMap.scala>) --
			[test program `Test_DigraphMap.scala` 
			](<Digraph/Scala/Test\_DigraphMap.scala>) 

        <!--
        #.  (TBD) Examine the instructor's set of operations for the
            Doubly Labeled Digraph ADT in the
            [Digraph trait ](<Digraph/Scala/Digraph.scala>) according to
            the Design Criteria for ADT Interfaces from the
		     [Notes ](<Digraph/Scala/AbstractDataTypes.html>) above.
        -->

    #.  (for reference) Haskell solutions 
		
        -   List representation for vertices and edges: \
            [module ](<Digraph/Haskell/DigraphADT\_List.hs>) --
			[test module ](<Digraph/Haskell/DigraphADT\_TestList.hs>)
        -   Map representation for graph: \
            [module `DigraphADT_Map` ](<Digraph/Haskell/DigraphADT\_Map.hs>) --
			[test module ](<Digraph/Haskell/DigraphADT\_TestMap.hs>)
		
    #.  (for reference) Elixir solutions
	
        -   Tuple and list representation for graph: \
            [module ](<Digraph/Elixir/Digraph\_List.ex>) --
			[test script ](<Digraph/Elixir/Digraph_Test.exs>)
		
    #.  (for reference) Notes on [Data Abstraction 
	    ](<DataAbstraction/DataAbstraction.html>)
		(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 
		](<DataAbstraction/DataAbstraction\_Java\_ADTs.html>)
		(These notes describe nongeneric Java implementations, circa 1997, 
		of the `Stack` and `Day` ADTs specified in the Data Abstraction 
		notes above.)

    #.  (for reference) Lecture Notes on 
	    [Modular Design ](<ModularDesign.html>)
		(Parts of these notes have been integrated into the notes on 
		*Abstract Data Types in Scala* above.) 
    
    #.  (for reference) H. C. Cunningham, Y. Liu, and J. Wang. 
	    "[Designing a Flexible Framework for a Table Abstraction 
		](<localcopy/Cunningham\_Table\_Abstraction.pdf>)," In Y. Chan, J.
        Talburt, and T. Talley, editors, *Data Engineering: Mining,
        Information, and Intelligence*, pp. 279-314, Springer, 2010.

    #.  (for reference) Classic papers by David L. Parnas and associates:
    
         -   Abstract interface: 
		     Kathryn Heninger Britton, R. Alan Parker, and David L. Parnas.
	         [A Procedure for Designing Abstract Interfaces for Device 
			 Interface Modules ](<localcopy/Parnas\_Abstract\_Interfaces.pdf>),
	         In *Proceedings of the 5th International Conference on Software
             Engineering*, pp. 195-204, March 1981.
         -   Information hiding: 
		     David L. Parnas. 
             [On the Criteria To Be Used in Decomposing Systems into Modules 
	         ](<localcopy/Parnas\_Criteria\_Decomposing.pdf>),
	         *Communications of the ACM*, Vol. 15, No. 12, pp. 1053-1058, 1972.
         -   Software families: 
		     David L. Parnas. 
	         [On the Design and Development of Program Families 
		     ](<localcopy/Parnas\_Families.pdf>),
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-2, No. 1, pp. 1-9, March 1976.
         -   Extensible system design: 
		     David L. Parnas. 
	         [Designing Software for Ease of Extension and Contraction 
		     ](<localcopy/Parnas\_Extension\_Contraction.pdf>), 
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-5, No. 1, pp. 128-138, March 1979.
         -   Modular specification of large systems: 
		     David L. Parnas, P. C. Clements, and D. M. Weiss. 
	         [The Modular Structure of Complex Systems 
		     ](<localcopy/Parnas\_Modular\_Structure.pdf>),
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-11, No. 3, pp. 259-266, March 1985.


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

@.  **(10 Apr)** Host guest lecture by J. P. Marum on reactive 
    programming (20 minutes) 
	
	
@.  **(10 Apr)** Distribute Optional Assignment #4

    a.  Sandwich DSL Implementation (one opiton on assignment)
	
        -   Scala [SandwichDSL Case Study 
		    ](<SandwichDSL/Scala/SandwichDSL\_Scala.html>), 
		    instructor's lecture notes (with exercises)
			-- [Scala code ](<SandwichDSL/Scala/SandwichDSL\_base.scala>)
        -   Haskell [SandwichDSL Case Study 
		    ](<SandwichDSL/Haskell/SandwichDSL.html>), 
			instructor's lecture notes (with exercises)			-- [Haskell code ](<SandwichDSL/Haskell/SandwichDSL\_base.hs>)


<a name="current_lecture"></a>

## Lazy Data Structures

<a name="laziness"></a>

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

    a.  Background reading: "Strictness and Laziness," Chapter 5, Paul
        Chiusano and Runar Bjarnason, *Functional Programming in Scala*
	
    #.  Lecture notes on Chapter 5:
        [HTML](<FPS05/Laziness.html>) -- 
		[PDF](<FPS05/Laziness.pdf>)
    
    #.  Scala source code from notes:
        [`StreamC.scala`](<FPS05/StreamC.scala>)
    
    #.  (for reference) John Hughes,
        [Why Functional Programming Matters ](<localcopy/whyfp.pdf>),
        *Computer Journal*, Vol. 32, No. 2, pp. 98-107, 1989.

    #.  (for reference) [Notes on Functional Program Evaluation Concepts 
        ](<EvaluationConcepts.html>) -- not updated 2019


## Semester Project Presentations

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

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

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

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

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

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

@.  **(3 May)** Layton Jones Project Presentation (Software Testing) 

## End of Semester

@.  **(1 May)** Continue exploring *Strictness and Laziness* 
    [**above**](<#laziness>)

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

@.  **(6 May: Noon -- 3:00 p.m.)** Optional final exam:
    Contact instructor by Noon on 3 May if you plan to take this exam!
	
@.  **END of Spring 2019 semester:** Enjoy Summer!


## More on Abstract Data Types

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

    TODO: Create a Scala version of this example.

    a.  [Wizard's Adventure game, Elixir Version 1 
	    ](<Wizard/Elixir/wizards\_game.ex>)
		
	    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.).
	
    #.  [Wizard's Adventure game, Elixir Version 2 
	    ](<Wizard/Elixir/wizards\_game2a.ex>)
		
		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.


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

    a.  [Cookie Jar ADT Problem Description 
	    ](<CookieJar/Scala/CookieJar\_problem.html>)

    #.  [Description of Bag Concept 
	    ](<CookieJar/Scala/bag.html>) 
		(used in specification)

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

        -   ADT specification as Scala trait:
		    [Scala source](<CookieJar/Scala/immutable/ICookieJar.scala>)		
        -   Using Scala List:
		    [Scala source ](<CookieJar/Scala/immutable/ICookieJarList.scala>)			
        -   Using Scala HashMap: 
		    [Scala source ](<CookieJar/Scala/immutable/ICookieJarMap.scala>)		
        -   Using Scala List of Tuples:
		    [Scala source ](<CookieJar/Scala/immutable/ICookieJarTupleList.scala>)		
        -   Blackbox test script:
		    [Scala source ](<CookieJar/Scala/immutable/ICookieJarTest.scala>)

    #.  Mutable CookieJar ADT Implementation in Scala (`CookieJar`{.scala}) -- 
	    uses object-oriented style with mutable state
		
        -   ADT specification as Scala trait:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJar.scala>)
        -   Using Scala List:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJarList.scala>) 
        -   Using Scala List of tuples:
		    [Scala source ](<CookieJar/Scala/mutable/CookieTupleList.scala>) 	
        -   Using Scala ArrayBuffer:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJarArrayBuffer.scala>)
        -   Using Scala HashMap:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJarMap.scala>)
        -   Using Scala array:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJarArray.scala>)
        -   Blackbox test script:
		    [Scala source ](<CookieJar/Scala/mutable/CookieJarTest.scala>)	
        -   Similar specification and Ruby program:
            [text ](<CookieJar/Ruby/CookieJarRuby.txt>)
			
    #.  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
		
        -   [Carrie's Candy Bowl ADT Problem Description 
		    ](<CandyBowl/Lua/candybowl\_problem.html>)
        -   [ADT Semantics ](<CandyBowl/Lua/candybowl\_semantics.html>)
        -   [Data representations 
		    ](<CandyBowl/Lua/candybowl\_data\_representation.html>)
        -   [Hashed version `candybowl_hash.lua`
		    ](<CandyBowl/Lua/candybowl\_hash.lua>)
        -   [Unsorted List version `candybowl_list.lua`
		    ](<CandyBowl/Lua/candybowl\_list.lua>)
        -   [Test driver `test_candybowl.lua`
		    ](<CandyBowl/Lua/test\_candybowl.lua>)
		
    #. Carrie's Candy Bowl ADT in Scala
	
        -   [trait `CandyBowl` 
		    ](<CandyBowl/Scala/CandyBowl.scala>) 
		    to define abstract data type interface
        -   [class `CandyBowlList` 
		    ](<CandyBowl/Scala/CandyBowlList.scala>) 
			to define a list-based implementation

    #.  Older mutable Java abstract data type
        implementations. These use nongeneric Java implementations done
        during the 1997-98 timeframe
		
        -   [Queue ADT ](<SoftwareInterfaces/Queue.html>) --
		    gives a specification for a Queue ADT and implements the
            ADT directly as two concrete classes
        -   [Ranked Sequence ADT ](<SoftwareInterfaces/RankedSequence.html>) -- 
		    gives a specification for a Ranked Sequence ADT (similar
            to `ArrayList` or `Vector`)


## NOT FULLY UPDATED 

### Games

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

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

    b.  [Dice of Doom, Elixir Version 1a 
	    ](<Dice\_of\_Doom/Elixir/dice_of_doom_v1a.ex>)
		
		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.

    c.  [Dice of Doom, Elixir Version 1b 
	    ](<Dice\_of\_Doom/Elixir/dice_of_doom_v1b.ex>)
		
		This is an eager version above with an attempt at memoization
        of functions `neighbors` and `game_tree` using the Elixir
        `Agent` modules.
                
    d.  [Dice of Doom, Elixir Version 2a,
        ](<Dice\_of\_Doom/Elixir/dice_of_doom_v2a.ex>) 
		
		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

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

    a.  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
	
    #.  Notes: [Domain-Specific Languages ](<DomainSpecificLanguages.html>)
	
    #.  Sandwich DSL Implementation
	
        -   Scala [SandwichDSL Case Study 
		    ](<SandwichDSL/Scala/SandwichDSL\_Scala.html>), 
		    instructor's lecture notes (with exercises)
			-- [Scala code ](<SandwichDSL/Scala/SandwichDSL\_base.scala>)
        -   Haskell [SandwichDSL Case Study 
		    ](<SandwichDSL/Haskell/SandwichDSL.html>), 
			instructor's lecture notes (with exercises)
			-- [Haskell code ](<SandwichDSL/Haskell/SandwichDSL\_base.hs>)
		
    #.  Sandwich DSL in Lua (similar but not identical to
        Haskell description
	
        -   [Semantic model module `sandwich_model.lua`
		    ](<SandwichDSL/Lua/sandwich\_model.lua>)
        -   [DSL builder module using function sequence pattern 
		    `sandwich_builder.lua ](<SandwichDSL/Lua/sandwich\_builder.lua>) 
        -   [Test driver]
		    `test_sandwichDSL.lua ](<SandwichDSL/Lua/test\_sandwichDSL.lua>


@.  <a name="stateMachineDSL"></a> 
    (for reference) Discuss State Machine External DSLs 
	based on Martin Fowler's Secret Panel Controller (State Machine) 
	DSLs

	a.  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
			](<http://www.informit.com/articles/article.aspx?p=1592379>))
	    -   Fowler DSL Chapter 1 
		    "[An Introductory Example 
	        ](<http://www.informit.com/articles/article.aspx?p=1592379>)"
        -   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 
		    ](<http://martinfowler.com/dslCatalog/>) from DSL book.
			
    #.  Other items from the instructor's notes
	
		-   [Mealy Machine Description and Exercise 
		    ](<MealyMachineSimulator.html>) gives a formal description 
		    of this kind of state machine 
        -   [Recursive Descent Parsing 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html#recursive-descent-parsing>)
		    gives a set of (Haskell) program templates for recursive descent
		    parsers
        -   [Parsing Combinators
            ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html#parsing-combinators>)
            describes a preliminary set of (Haskell) parsing
            combinators for recursive descent parsers
		-   Wikipedia entry on [Parsing Combinator 
		    ](<https://en.wikipedia.org/wiki/Parser_combinator>) 

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


    #.  Graphviz and `dot` language reference and
        examples

        -   Note: On my iMacs, I used Homebrew to install the 
		    package `graphviz`.
        -   [Graphviz: Graph Visualization Software 
		    ](<http://www.graphviz.org>)
			and the little language/tool `dot`
	    -   [`ExprLangModDep.gv`](<Graphviz/ExprLangModDep.gv>) --
			[`script`](<Graphviz/ExprLangModDep.sh>) --
	        [`png` output ](<Graphviz/ExprLangModDep.png>) 
	    -   [`DFA01.gv`](<Graphviz/DFA01.gv>) --
			[script](<Graphviz/DFA01.sh>) --
	        [`pdf` output ](<Graphviz/DFA01.pdf>) 
	    -   [`NFA01.gv`](<Graphviz/NFA01.gv>) --
			[script](<Graphviz/NFA01.sh>) --
	        [`svg` output ](<Graphviz/NFA01.svg>) 
	    -   [`NFA01a.gv`](<Graphviz/NFA01a.gv>) --
			[script](<Graphviz/NFA01a.sh>) --
	        [`svg` output ](<Graphviz/NFA01a.svg>) 
	    -   [`Infix1plus1b.gv`](<Graphviz/Infix1plus1b.gv>) --
			[script](<Graphviz/Infix1plus1b.sh>) --
	        [`png` output ](<Graphviz/Infix1plus1b.png>) 


    #.  <a name="stateMachineSemantic"></a> 
	    Scala State Machine Semantic Model (Fowler Ch. 1, 3, 11)

	    -   [StateMachine.scala
	        ](<StateMachineDSL/Scala/StateMachine.scala>)
		-   [StateMachineTest.scala
	        ](<StateMachineDSL/Scala/StateMachineTest.scala>)
		-   [CommandChannel.scala (mock)
		    ](<StateMachineDSL/Scala/CommandChannel.scala>)
		-   [StateMachineDirect.sh test script 
		    ](<StateMachineDSL/Scala/StateMachineDirect.sh>) 


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

	    -   [StateMachineXMLTest .scala
            ](<StateMachineDSL/Scala/StateMachineXMLTest.scala>)
		-   [IncrementalStateMachineBuilder.scala 
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file SecretPanel.xml
		    ](<StateMachineDSL/Scala/SecretPanel.xml>)
		-   [StateMachineXML.sh test script 
		    ](<StateMachineDSL/Scala/StateMachineXML.sh>) 


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

		-   [DelimiterDSLTest.scala 
		    ](<StateMachineDSL/Scala/DelimiterDSLTest.scala>)
		-   [IncrementalStateMachineBuilder.scala 
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL.dsl 
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL.dsl>)
		-   [DelimiterDSL.sh test script 
	        ](<StateMachineDSL/Scala/DelimiterDSL.sh>) 

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


		-   [RecursiveDescentTest.scala
	        ](<StateMachineDSL/Scala/RecursiveDescentTest.scala>) 
		-   [IncrementalStateMachineBuilder.scala
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
		-   [RecursiveDescent.sh test script 
	        ](<StateMachineDSL/Scala/RecursiveDescent.sh>) 


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

        -   [CombinatorParserBuilderTest.scala
		    ](<StateMachineDSL/Scala/CombinatorParserBuilderTest.scala>)
		-   [IncrementalStateMachineBuilder.scala
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
		-   [CombinatorParserBuilder.sh test script
		    ](<StateMachineDSL/Scala/CombinatorParserBuilder.sh>)


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

        -   [CombinatorParserASTTest.scala
		    ](<StateMachineDSL/Scala/CombinatorParserASTTest.scala>)
        -   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
        -   [CombinatorParserAST.sh test script
		    ](<StateMachineDSL/Scala/CombinatorParserAST.sh>)


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

		-   [StaticC\_GeneratorTest.scala 
            ](<StateMachineDSL/Scala/StaticC\_GeneratorTest.scala>)
		-   [StaticC\_Generator.sh test script 
	        ](<StateMachineDSL/Scala/StaticC\_Generator.sh>) 
		-   [generated C output file output.c
            ](<StateMachineDSL/Scala/output.c>)
        -   Note: The needed framework code needed to run the
            generated C program is not yet available in this form.  It
            needs to be reconstructed from Fowler's book. 


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

		-   [GraphVizCodeGen.scala 
            ](<StateMachineDSL/Scala/GraphVizCodeGen.scala>)
		-   [GraphVizCodeGenTest.scala 
            ](<StateMachineDSL/Scala/GraphVizCodeGenTest.scala>) 
		-   [GraphVizCodeGen.sh test script 
	        ](<StateMachineDSL/Scala/GraphVizCodeGen.sh>) 
		-   [generated Graphviz Dot output file graph.gv 
            ](<StateMachineDSL/Scala/graph.gv>)  (see test script)
		-   [Scalable Vector Graphics output from dot graph.svg 
            ](<StateMachineDSL/Scala/graph.svg>)  (see test script)
		-   [PDF output from dot graph.pdf 
            ](<StateMachineDSL/Scala/graph.pdf>) (see test script)


@.  <a name="CompConfigDSL"></a> 
    (TBD) Discuss Fowler's Computer Configuration Internal (Ch. 4, 35, 36, 38)

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

		-   Martin Fowler's 
		    [List of DSL Patterns 
		    ](<http://martinfowler.com/dslCatalog/>) 
		    from *Domain Specific Languages*, Addison Wesley, 2011 
	    -   Fowler DSL Chapter 1 
		    "[An Introductory Example 
	        ](<http://www.informit.com/articles/article.aspx?p=1592379>)"
        -   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"


    #.  Scala versions (2009)

        -   [Scala semantic model (shared)
		    ](<CompConfigDSL/Scala/Computer.scala>)
        -   [Scala internal DSL using Method Chaining
	        ](<CompConfigDSL/Scala/CompConfigChaining.scala>)
        -   [Scala internal DSL using Nested Closures and Object Scoping 
		    ](<CompConfigDSL/Scala/CompConfigClosure.scala>)
        -   [CompConfig.sh test script 
	        ](<CompConfigDSL/Scala/CompConfig.sh>) 


@.  <a name="EmailMessageDSL"></a>
    (TBD) Discuss Fowler's Email Message Building Internal DSL
	(Ch. 35)

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

    #.  Scala versions (2009)

        -   [Scala internal DSL using Method Chaining and Progressive Interfaces 
	        ](<EmailDSL/Scala/EmailProgressive.scala>)
        -   [test script `EmailProgressive.sh` 
	        ](<EmailDSL/Scala/EmailProgressive.sh>)
			

@.  <a name="LairDSL"></a> 
    Explore Fowler's Lair Configuration DSLs

    a.  Background on Lair DSL

        -   Case study: Martin Fowler's 
		    [One Lair and Twenty Ruby DSLs 
		    ](<http://media.pragprog.com/titles/twa/martin\_fowler.pdf>), 
            Chapter 3, 
            [*The ThoughtWorks Anthology: Essays on Software Technology 
			and Innovation* 
			](<http://pragprog.com/book/twa/thoughtworks-anthology>), 
            The Pragmatic Bookshelf, 2008 
			-- [local copy](<LairDSL/FowlerOneLairTwentyDSLs.pdf>)
        -   Source code: 
		    [entire Thoughtworks book 
			](<https://pragprog.com/titles/twa/source\_code>)\] 
			\[[Fowler's Ruby DSLs ](<LairDSL/Ruby>)
        -   Patterns (repeated from above): Martin Fowler's 
		    [List of DSL Patterns 
		    ](<http://martinfowler.com/dslCatalog/>) 
		    from *Domain Specific Languages*, Addison Wesley, 2011 

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

    #.  Background on Lua
	
        -   See [Lua references ](<#lua>) 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`.

    #.  Shared modules
	
	    Fowler's Ruby source
		
		-   [Semantic model (model.rb) ](<LairDSL/Ruby/model.rb>)
		-   [Test Driver for semantic model (rules0.rb) 
		    ](<LairDSL/Ruby/rules0.rb>)
		
		Lua (2013)

        -   [Class support module (for implementing classes in Lua) 
	        ](<LairDSL/Lua/class\_support.lua>) 
        -   [Semantic model ](<LairDSL/Lua/model.lua>) 
        -   [Test driver for semantic model (rules00.lua) 
		    ](<LairDSL/Lua/rules00.lua>) 
			
        Python 3 (2018)
		
        -   [Semantic model ](<LairDSL/Python/model.py>) 
        -   [Test driver for semantic model (rules00.py) 
		    ](<LairDSL/Python/rules00.py>) 


    #.  Internal DSL using Global Function Sequence pattern
	
	    Fowler's Ruby
	
	    -   [builder module (builder8.rb) 
		    ](<LairDSL/Ruby/builder8.rb>) 
		-   [dsl script (rules8.rb) 
		    ](<LairDSL/Ruby/rules8.rb>) 

	    Lua (2013)
	
	    -   [builder module (builder08.lua) 
		    ](<LairDSL/Lua/builder08.lua>) 
		-   [dsl script (rules08.lua) 
		    ](<LairDSL/Lua/rules08.lua>) 
		-   [test driver (test08.lua) 
		    ](<LairDSL/Lua/test08.lua>) 

	    Python 3 (2018)
	
	    -   [builder module (builder08.py) 
		    ](<LairDSL/Python/builder08.py>) 
		-   [direct execution test of DSL script (rules08x.py) 
		    ](<LairDSL/Python/rules08x.py>) 
		-   [dynamically loaded dsl script (rules08.py) 
		    ](<LairDSL/Python/rules08.py>) 
		-   [test driver for dynamically loaded dsl script (test08.py) 
		    ](<LairDSL/Python/test08.py>) 


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

		Fowler's Ruby

        -   [builder module (builder11.rb) 
		    ](<LairDSL/Ruby/builder11.rb>)
        -   [dsl script (rules11.rb) 
			](<LairDSL/Ruby/rules11.rb>)

		Lua (2013)

        -   [builder module (builder11.lua) 
		    ](<LairDSL/Lua/builder11.lua>)
        -   [dsl script (rules11.lua) 
			](<LairDSL/Lua/rules11.lua>)
		-   [test driver (test11.lua) 
		    ](<LairDSL/Lua/test11.lua>) 
		
		Python 3 (2018)

        -   [builder module (builder11.py) 
		    ](<LairDSL/Python/builder11.py>)
        -   [dynamically loaded dsl script (rules11.py) 
			](<LairDSL/Python/rules11.py>)
		-   [test driver for dynamically loaded dsl script (test11.py) 
		    ](<LairDSL/Python/test11.py>) 


    #.  Internal DSL using Expression Builder and
        Method Chaining patterns
	
		Fowler's Ruby
		
        -   [builder module (builder14.rb)
	        ](<LairDSL/Ruby/builder14.rb>)
        -   [dsl script (rules14.rb)
		    ](<LairDSL/Ruby/rules14.rb>)

		Lua (2013)
		
        -   [builder module (builder14.lua)
	        ](<LairDSL/Lua/builder14.lua>)
        -   [dsl script (rules14.lua)
		    ](<LairDSL/Lua/rules14.lua>)
		-   [test driver (test14.lua)
		    ](<LairDSL/Lua/test14.lua>)
	
		Python 3 (2018)
		
        -   [builder module (builder14.py)
	        ](<LairDSL/Python/builder14.py>)
        -   [dynamically loaded dsl script (rules14.py)
		    ](<LairDSL/Python/rules14.py>)
		-   [test driver for dynamically loaded dsl script (test14.py)
		    ](<LairDSL/Python/test14.py>)


    #.  Internal DSL using Nested Closures pattern
	
	    Fowler's Ruby 
		
        -   [builder module (builder3.rb) 
	        ](<LairDSL/Ruby/builder3.rb>) 
		-   [dsl script (rules3.rb) 
			](<LairDSL/Ruby/rules3.rb>) 

	    Lua (2013)
		
        -   [builder module (builder03.lua) 
	        ](<LairDSL/Lua/builder03.lua>) 
		-   [dsl script (rules03.lua) 
			](<LairDSL/Lua/rules03.lua>) 
		-   [test driver (test03.lua) 
			](<LairDSL/Lua/test03.lua>)
			
		Python 3 -- none yet. (Python's weak syntactic support for
        lambdas does not allow the relatively direct approach usable
        in Ruby, Scala, and Lua.)
 
 
    #.  Internal DSL using Expression Builder, Object Scoping, and
        Method Chaining patterns
		
		Fowler's Ruby 
		
        -   [builder module (builder17.4b) 
			](<LairDSL/Ruby/builder17.rb>) 
		-   [dsl script (rules17.rb) 
			](<LairDSL/Ruby/rules17.rb>) 

		Lua  (2013)
		
        -   [builder module (builder17.lua) 
			](<LairDSL/Lua/builder17.lua>) 
		-   [dsl script (rules17.lua) 
			](<LairDSL/Lua/rules17.lua>) 
		-   [test driver (test17.lua) 
			](<LairDSL/Lua/test17.lua>)
			
		Python 3 -- none yet


    #.  Internal DSL using Literal Collection pattern
	
	    Fowler's Ruby
		
	    -   [builder module (builder22.rb) 
		    ](<LairDSL/Ruby/builder22.rb>)
		-   [dsl script (rules22.rb) 
		    ](<LairDSL/Ruby/rules22.rb>)

        Lua (2013)
		
	    -   [builder module (builder22.lua) 
		    ](<LairDSL/Lua/builder22.lua>)
		-   [dsl script (rules22.lua) 
		    ](<LairDSL/Lua/rules22.lua>)
		-   [test driver (test22.lua) 
            ](<LairDSL/Lua/test22.lua>)

        Python 3 -- none yet

    #.  External DSL using Parser/Builder (no
	    corresponding example in Fowler book chapter)
		
		Lua (2013)
		
        -   Note: This program requires installation of a Lua LPEG
            library via luarocks. It must be compatible with whatever
            version of Lua is being used.
        -   [builder module (builderLPEG1.lua) 
			](<LairDSL/Lua/builderLPEG1.lua>)
		-   [dsl script (rulesLPEG1.dsl) 
			](<LairDSL/Lua/rulesLPEG1.dsl>)
		-   [test driver (testLPEG1.lua) 
			](<LairDSL/Lua/testLPEG1.lua>)
			
		Python 3 (2018)
		
        -   Note: This program requires installation of the Python 3
		    package [Parsita ](<https://github.com/johnthagen/parsita>), 
			a parser combinator library similar to Scala's
        -   [builder module (builderParsita1.py) 
			](<LairDSL/Python/builderParsita1.py>)
		-   [dsl script (rulesParsita1.dsl) 
			](<LairDSL/Python/rulesParsita1.dsl>)
		-   [test driver (testParsita1.py) 
			](<LairDSL/Python/testParsita1.py>)


@.  <a name="ReaderDSL"></a>
    (TBD) Discuss Fowler's DSL Reader framework (2006)

    a.  Background: 

		-   Martin Fowler. 
		    [Language Workbenches: The Killer-App for Domain Specific Languages? 
		    ](<http://www.martinfowler.com/articles/languageWorkbench.html>)
            June 2005.
        -   Martin Fowler. [Generating Code for DSLs 
            ](<http://www.martinfowler.com/articles/codeGenDsl.html>), 
	        June 2005.

    #.  Ruby shared modules (2006)

        -   [DSL Reader Framework module (ReaderFramework.rb)
            ](<ReaderDSL/Ruby/ReaderFramework.rb>)
        -   [DSL Reader Utilities mix-in module (ReaderUtilities.rb)
	        ](<ReaderDSL/Ruby/ReaderUtilities.rb>)
        -   [Data input file (fowlerdata.txt) 
		    ](<ReaderDSL/Ruby/fowlerdata.txt>)
        -   [Text DSL description (dslinput.txt) 
		    ](<ReaderDSL/Ruby/dslinput.txt>)
        -   [XML DSL description (dslinput.xml)
		    ](<ReaderDSL/Ruby/dslinput.xml>)

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

	    -   [BuilderDirect.rb 
		    ](<ReaderDSL/Ruby/BuilderDirect.rb>)

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

	    -   [TextSinglePass.rb 
		    ](<ReaderDSL/Ruby/TextSinglePass.rb>)

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

	    -   [TwoPass.rb 
		    ](<ReaderDSL/Ruby/TwoPass.rb>)
	  	-   [class BuilderExternal source code generated by TwoPass.rb
		    ](<ReaderDSL/Ruby/GeneratedBuilderExternal.rb>)

    #.  Ruby internal DSL

	    -   [RubyDSL.rb 
		    ](<ReaderDSL/Ruby/RubyDSL.rb>)


@.  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. 
	
    a.  [manuscript 
        ](<http://www.cs.olemiss.edu/~hcc/papers/surveyLangFinal.pdf>)
		
	#.  [presentation 
        ](<http://www.cs.olemiss.edu/~hcc/papers/surveyLanguage4.ppt>)
	
	#.  [Ruby source ](<SurveyDSL/SurveyLanguage_rb.txt>)
	
	#.  [test DSL input file ](<SurveyDSL/survey_rb.txt>)
	
	#.  [test DSL input file with errors 
	    ](<SurveyDSL/surveyErrors_rb.txt>)



### Object-Oriented Programming and Frameworks

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

    a.  [Scala (2008, 2010) ](<Employee/Scala/EmployeeTest.scala>)
	
	#.  [Ruby (2006) ](<Employee/Ruby/employee.rb>)


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

    a.  Instructor's notes on
		[Object-Oriented Software Development ](<OOSoftDev.html>)

    #.  Scala translation of Frog dynamic composition example: \ 
	    [Scala source ](<Frog/Scala/FrogTest.scala>) --
        [output ](<Frog/Scala/FrogTest.out>)
		
    #.  Modified Philosophical Frog example from Odersky et al:  \
	    [Scala source](<PhilFrog/Scala/PhilFrog.scala>) --
        [output](<PhilFrog/Scala/PhilFrog.out>)
	
    #.  Modified Stackable traits example (IntQueue) from Odersky et al: \
        [Scala source](<Stackable/Scala/StackableTest.scala>) --
        [output](<Stackable/Scala/StackableTest.out>)


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

    a.  Simple Sorting Framework examples.
	
        -   Low-level concrete Employee sorting:
            [Scala source ](<SortFramework/Scala/SortEmployee.scala>)
        -   Insertion Sorting framework:
            [Scala source ](<SortFramework/Scala/InsertionSorter.scala>)
        -   Employee Sorting application of framework:
            [Scala source ](<SortFramework/Scala/EmployeeSorter.scala>)
        -   Test code for Employee Sorting application of framework:
            [Scala source ](<SortFramework/Scala/TestEmployeeSorter.scala>)

    #.  Ice Cream Store discrete event simulation.
        
		-   Simulation framework: 
		    [Scala source](<IceCreamStore/Scala/SimFramework.scala>) 
        -   Ice Cream Store application: 
		    [Scala source](<IceCreamStore/Scala/IceCreamStoreApp.scala>) 
		    [typical output](<IceCreamStore/Scala/IceCreamStoreSim.out>)


@.  (TBD) Cunningham group "Using Classic Problems ..." paper.

    a.  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](</~hcc/papers/classicProblems.pdf>)
		
    #.  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 ](</~hcc/papers/FrameworkDesignTutorialFinal.pdf>)
	    [presentation ](</~hcc/papers/FrameworkDesignTutorial3e.ppt>)


@.  (TBD) Scala Divide-and-Conquer Framework, similar to the Java framework in the
    "Using Classic Problems ..." paper

    a.  Template-based Divide-and-Conquer Framework (DivConqTemplate): \
	    [Scala source ](<DivConq/Scala/DivConqTemplate.scala>)
	
	#.  Strategy-based Divide-and-Conquer Framework (DivConqStrategy): \
        [Scala source ](<DivConq/Scala/DivConqStrategy.scala>)

    #.  Traits for Problem and Solution descriptions for both
        frameworks (DivConqProblemSolution): \
        [Scala source ](<DivConq/Scala/DivConqProblemSolution.scala>)
		
    #.  Application of Template-based framework to QuickSort
	    (QuickSortTemplateApp): \
	    [Scala source ](<DivConq/Scala/QuickSortTemplateApp.scala>) --
		[program output ](<DivConq/Scala/QuickSortTemplateApp.out>)
		
    #.  Application of Strategy-based framework to QuickSort
        (QuickSortStrategyApp): \
		[Scala source ](<DivConq/Scala/QuickSortStrategyApp.scala>) --
		[program output ](<DivConq/Scala/QuickSortStrategyApp.out>)

    #.  Descriptor for QuickSort state for both QuickSort applications 
	    (QuickSortDesc): \
		[Scala source ](<DivConq/Scala/QuickSortDesc.scala>)


@.  (TBD) Scala Binary Tree Framework, similar to the Java framework in the
    "Using Classic Problems ..." paper

    a.  Straightforward translation of the Java program to Scala:
	
        -   Top-level framework (BinTreeFramework):
		    [Scala source ](<BinTree/Scala/Nongeneric/BinTreeFramework.scala>)
		-   Second-level Euler tour framework (EulerTourVisitor):
		    [Scala source ](<BinTree/Scala/Nongeneric/EulerTourVisitor.scala>)
		-   Second-level mapping framework (MappingVisitor): 
		    [Scala source ](<BinTree/Scala/Nongeneric/MappingVisitor.scala>)
		-   Second-level breadth-first framework (BreadthFirstVisitor): 
		    [Scala source ](<BinTree/Scala/Nongeneric/BreadthFirstVisitor.scala>)
		-   Application of BinTree frameworks (BinTreeTest):
		    [Scala source ](<BinTree/Scala/Nongeneric/BinTreeTest.scala>)
			
    #.  Generic implementation of BinTree framework in Scala:
	
        -   Top-level framework (BinTreeFramework):
		    [Scala source ](<BinTree/Scala/Generic/BinTreeFramework.scala>)
        -   Second-level Euler tour framework (EulerTourVisitor) 
		    [Scala source ](<BinTree/Scala/Generic/EulerTourVisitor.scala>)
        -   Second-level mapping framework (MappingVisitor):
		    [Scala source ](<BinTree/Scala/Generic/MappingVisitor.scala>)
        -   Second-level breadth-first framework (BreadthFirstVisitor):
            [Scala source ](<BinTree/Scala/Generic/BreadthFirstVisitor.scala>)
        -   Application of BinTree frameworks (BinTreeTest):
		    [Scala source ](<BinTree/Scala/Generic/BinTreeTest.scala>)


## Programming Language Reference Materials

@.  [Free online programming language textbooks and tutorials 
    ](<Free\_Prog\_Lang\_Textbooks.html>) 


### Haskell

@.  [Learn X in Y Minutes, Where X = Haskell 
    ](<https://learnxinyminutes.com/docs/haskell/>)

@.  <a name="haskellnotes"></a> H. Conrad Cunningham.
    [Introduction to Functional Programming Using Haskell 
	](<https://john.cs.olemiss.edu/~hcc/csci450/notes/HaskellNotes/IntroFP\_Haskell.html>),
    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.)

@.  H. Conrad Cunningham.
    [*Notes on Functional Programming with Haskell* 
	](<haskell_notes.pdf>),
    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.)

@.  [Haskell language website](<http://www.haskell.org>)

     a.  [*Haskell 2010 Language Report*
        ](<http://www.haskell.org/onlinereport/haskell2010/>) 
     #.  [*GHC User's Guide*
        ](<http://www.haskell.org/ghc/docs/latest/html/users_guide/>) 

@.  [*Haskell Cheat Sheet*
    ](<http://cheatsheet.codeslower.com/CheatSheet.pdf>) 

@.  [School of Haskell](<https://www.fpcomplete.com/school>) 
    online tutorials

@.  Miron Lipovaca.
    [*Learn You a Haskell for Great Good: A Beginner's Guide* 
	](<http://learnyouahaskell.com/>),
    a free online tutorial at <http://learnyouahaskell.com/>.  (It is
    also in print from No Starch Press, 2011.)

@.  Kees Doets and Jan van Eijck.
    [*The Haskell Road to Logic, Math and Programming*
    ](<http://fldit\-www.cs.uni\-dortmund.de/~peter/PS07/HR.pdf>),
    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*
    ](<https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwjsveil57TZAhUCyVMKHdv3DG4QFggvMAE&url=http%3A%2F%2Fwww.cs.yale.edu%2Fhomes%2Fhudak%2FPapers%2FHSoM.pdf&usg=AOvVaw0ito3odDctDREQ7Yw3QTsR>),
    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.

@.  Simon Marlowe. 
    [*Parallel and Concurrent Programming in Haskell: 
	Techniques for Multicore and Multithreaded Programming*
	](https://web.archive.org/web/20180117182938/http://chimera.labs.oreilly.com/books/1230000000929/index.html),
    2013. This book is also available in print, published by
	O\'Reilly Media, 2013.
	
@.  Bryan O\'Sullivan, Don Stewart, and John Goerzen.
    [*Real World Haskell*](<http://book.realworldhaskell.org>),
	2008.
	This book is also available in print, published by O\'Reilly Media
    in November 2008.


### Lua

@.  [Learn X in Y Minutes, Where X = Lua 
    ](<https://learnxinyminutes.com/docs/lua/>)

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

@.  Instructor's <a href="LuaSlides">Lua slides</a> 
	(from CSci 450, Fall 2016)

    a.  Background: The slides below are adapted, in part, from
        [*Programming in Lua, Slides for Course* 
		](<http://www.dcc.ufrj.br/~fabiom/lua/>)
        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 ](<LuaIntro/01IntroLua.html>) 
	    HTML slides based, in part, on Mascarenhas slide sets 0-5
	#.  [Advanced Lua Functions ](<LuaIntro/02IntroLua.html>) 
	    HTML slides based, in part, on Mascarenhas slide set 6 
	#.  [Modules in Lua ](<LuaIntro/03IntroLua.html>) 
	    HTML slides based, in part, on Mascarenhas slide set 9
	#.  [Lua Metatables ](<LuaIntro/04IntroLua.html>)
        HTML slides based, in part, on Mascarenhas slide set 10
    #.  [Lua Objects ](<LuaIntro/05IntroLua.html>) 
	    HTML slides based, in part, on Mascarenhas slide set 11 


### Python 3

@.  [Learn X in Y Minutes, Where X = Python3 
    ](<https://learnxinyminutes.com/docs/python3/>)

@.  Bernd Klein. [Python Course ](<https://www.python-course.eu>)


### Ruby

@.  [Learn X in Y Minutes, Where X = Ruby 
    ](<https://learnxinyminutes.com/docs/ruby/>)

@.  Chris Pine. [Learn to Program 
    ](<http://pine.fm/LearnToProgram/>)

@.  why the lucky stiff (Jonathan Gillette). 
    [why\'s (poignant) guide to Ruby
	](<http://mislav.uniqpath.com/poignant\-guide/>)


### Scala

@. [Learn X in Y Minutes, Where X = Scala 
   ](<https://learnxinyminutes.com/docs/scala/>) 

@.  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/>.

@.  Martin Odersky. [*Scala by Example* 
	](<http://www.scala-lang.org/docu/files/ScalaByExample.pdf>), 
	EPFL, 2014. \[[local](<localcopy/ScalaByExample.pdf>)\]

@.  Instructor's [Notes on Scala for Java Programmers 
	](<ScalaForJava/ScalaForJava.html>) 

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

    a.  Instructor's Notes on 
		[Functional Data Structures (Chapter 3) 
		](<FPS03/FunctionalDS.html>)
    #.  Instructor's Notes on 
		[Error Handling without Exceptions (Chapter 4) 
		](<FPS04/ErrorHandling.html>) 
    #.  Instructor's Notes on 
		[Strictness and Laziness (Chapter 5) 
		](<FPS05/Laziness.html>)


-----

| Copyright (C) 2020, 
  [H. Conrad Cunningham ](<http://www.cs.olemiss.edu/~hcc>)
| Format Updated 16 August 2020

