Summer, 2019




Useful Links

Week 
Dates 
Lecture & Readings/Videos 
Assignments and Practice Problems 
1  T 5/21 W 5/22 Th 5/23 
Administrative matters; Overall Plan for the course; Motivation: Why learn functional Programming? Lecture Slides: PDF Here is my channel where I will post lecture videos: YT BareBones Haskell: Constructing data expressions, functions on data expressions, expressions as trees, rewrite semantics; Reading: Hutton Chapters 1 & 2; also you could look at section 8.2 on data declarations (just for the basic idea; ignore anything you don't understand). Lecture Slides: PDF Also, make sure you remember recursive tree traversals, particularly preorder and postorder; here is my CS 112 lecture on this: PDF Here is a video talkthrough of the last couple of slides from Lecture 2, which I did not finish in section A1: HTML Function definition by pattern matching; polymorphic types. Reading: Hutton, Ch. 3.1  3.7 Lecture Slides: PDF Polymorphic data and functions; type checking; function definitions; modules Reading: Hutton, Ch. 3.8  end, 4.1  4.4 Lecture Notes: PDF 
Analytical Homework Zero Solution: PDF Practice Problems on data and function definitions and computation by matching and rewriting: HTML Practice Problems 2 A Alternate (using buildin syntax for Integers, tuples, and lists) HTML
Practice Problems 2 B Alternate (using buildin syntax for Integers, tuples, and lists) HTML Presented in lab on Thursday, due W 5/29: HWs from weeks 1 and 2 
2  T 5/28 W 5/29 Th 5/30 F 5/31 
Functions as firstclass values; map and filter;lambda expressions; functions manipulating functions; modules. Reading: Hutton, Finish chapter 4. On modules, read HTML up to right before the section on Data.List. Lecture Notes: PDF Basic Haskell: Haskell builtin list and tuple types; Case expressions; Betareduction for lambda expressions and let expressions; HO programming continued: Curried functions; (if time) Function composition with currying. Reading: Hutton Ch. 4 & 7 Lecture Slides: PDF Curried functions, HO programming paradigms concluded: foldr; Type classes. Reading: Hutton 5 & 15.115.5 Lecture Slides: PDF Type classes Continued. Reading: Hutton, reread Ch. 3 and then read 8.1  8.5, and also section 12.1 (on Functors) This section from "Learn you a ...." is also worth reading on the basic type classes: HTML Also the beginning of this section, about the Functor type class, is very good: HTML The first part of this, Functors with Pictures, is very good: HTML Lecture Slides: PDF Type classes concluded. Reading: Same as last time. Reread it! Lecture Slides: PDF

Analytical Homework One Solution: PDF
Comments on HW 02 Coding (lang0 .. lang4): MP4 Here is a short video with some hints: HTML Practice Problems 3: HTML Quiz 1 Study Guide: HTML 
3  M 6/3 T 6/4 W 6/5 Th 6/6 
SOLUTION TO QUIZ ONE: PDF Monads: the Maybe Monad Lecture Slides: PDF MonadLectureCode1: HS MonadLectureCode2: HS Video walk throughs of these two files have been uploaded to the YT channel linked at the top of this page, as well as a brief summary of my lecture. Required Readings:
Optional readings (if you are interested):
Here are some videos on monads:
Even more optionally, here are some informative links about monads: Monads continued; the Ok Monad; the List Monad; List Comprehensions Lecture Slides: PDF MonadLectureCode3: HS Video walk throughs of this file, and a twopart summary of my lecture have been uploaded to the YT channel. Code discussed in class (videos posted to YT channel soon): WriterMonad.hs: HS ReaderMonad.hs: HS The State MonadLecture Slides: PDF 

4  M 6/10 T 6/11 W 6/12 Th 6/13 
Implementing a functional language: Syntax, ContextFree Grammars, Parse Trees, Derivations; Parsing and Abstract Syntax Trees. Lecture Slides: PDF Reading on ContextFree Grammars: PDF Another reading: HTML Complete BNF for Haskell (see section 9.5): HTML Parsing and Grammars Example parser code from lecture: HS Video short lecture on parsing: HTML Lambda Calculus 1 Reading: Introduction to the Lambda Calculus: PDF Lambda Calculus 2: Confluence and Evaluation order Haskell: Lazy evaluation and infinite data structures Lecture Notes: PDF Reading: Hutton, 12.1  12.5 Infinite Lists; Lazy evaluation in Haskell concluded. Reading: Finish chapter 15 in Hutton, then read this more precise exposition: HTML Lecture Notes: PDF 
Analytical Homework 3 Solution: PDF 
5  M 6/17 T 6/18 W 6/19 Th 6/20 
Conclusions on lazy evaluation in Haskell; foldl vs foldl' Read section 7.4 in Hutton on foldl. Here is a rather complete introduction to lazy vs strict evaluation: HTML Reading on scope (from stack overflow, with nice code examples): HTML Lecture Notes: PDF Implementing imperative features: assignments, loops, and mutable state. Comments on the Project: general overview and static type checking Lecture Slides: PDF Comments on Project: Testing Lecture Slides: PDF YouTube Video on Basic Testing: YT YouTube Video on Program Testing with Quickcheck. YT and files discussed there: DIR. Study guide for Quiz 2:HTML 
Analytical Homework 04 Solution: PDF 
6  M 6/24 T 6/25 W 6/26 Th 6/27 
Work on Final Project, due Friday 6/28 at midnight. 