Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

COMP 311 / COMP 544: Functional Programming (Fall 2020)



Instructors

Robert "Corky" Cartwright

TA

TBA

Lectures

Online using Zoom

Lecture Times

9:40am–11:00am TR

Instructor Emailcork@rice.eduOnline DiscussionPiazza – Rice Comp 311

 


Brief Description

This class provides an introduction to functional programming. Functional programming is a style of programming in which computations are solely expressed in terms of applications of functions to arguments (which themselves can be functions). This style of programming has a long history in computer science, beginning with the formulation of the Lambda Calculus as a foundation for mathematics. It has become increasingly popular in recent years because it offers important advantages in designing, maintaining, and reasoning about programs in modern contexts such as web services, parallel (multicore) programming, and distributed computing. Course work consists of a series of programming assignments in the Racket, Java, and Java Haskell programming languages plus occasional written homework assignments on underlying theory.

Grading, Honor Code Policy, Processes, and Procedures  

Grading will be based on your performance on weekly programming assignments and two exams: a midterm and a final. All work in this class is expected to be your own, and you are expected not to post your solutions or share your work with other students, even after you have taken the course. Please read the Comp 311 Honor Code Policy for more details on how you are expected to work on your assignments. There will also be a final exam, as described in the syllabus.

All students will be held to the standards of the Rice Honor Code, a code that you pledged to honor when you matriculated at this institution. If you are unfamiliar with the details of this code and how it is administered, you should consult the Honor System Handbook. This handbook outlines the University's expectations for the integrity of your academic work, the procedures for resolving alleged violations of those expectations, and the rights and responsibilities of students and faculty members throughout the process.

 
Accommodations for Students with Special Needs  

Students with disabilities are encouraged to contact me during the first two weeks of class regarding special needs. Students with disabilities should also contact Disabled Student Services in the Ley Student Center and the Rice Disability Support Services.


General Information

 

Course Syllabus


 
Homework Submission Guide
Office Hours


Instructors
   
Instructor




Corky Cartwright
MWF

TuTh

 

9


1:

25

30pm-

10:40am

2:30pm

By appointment

Online via Zoom

 

Online via Zoom

Teaching Assistants

Agnishom

Andrew Obler

Chunxiao Liao

TBA

TBA

TBA

TBA

TBA

TBA

Online via Zoom

Online via Zoom

Online via Zoom

TBA

TBA


TextbooksOnline Recommended VideosDevelopment Environment

 

Lecture Schedule (Subject to Change Without Notice)

...

  • . The interface is "textually transparent" as we will show in class.
  • DrJava is the supported IDE for Java in this course, but you are welcome to use any IDE such as IntellJ or Eclipse.
  • We are still evaluating IDEs for Haskell.


Lecture Schedule (In Progress)


08

Week

Day

Date

Lecture Topic and Resources

Work AssignedWork Due

1

Tu

Aug 27

Overview, Motivation

  

Motivation and the Elements (Constants) of Racket

HTDP Part 1 (Ch 1-8)Sep 03 

ThAug 29Computation by Reduction, Types, Core ScalaHomework 0[Canceled for Hurricane Laura]
Sep 05 

2

Tu

Sep 0301

Ints, Doubles, Error Conditions, Programming with Intention

  

Conditionals, Function Definitions and Computation by Reduction

Homework 1

Review Ch 8

HTDP Part 2 (Ch 9-10)

Sep 08
3 ThSep 0503

The Program Design Recipe


BeakerX Notebook: Source, PDF
  

for Racket focusing on using recursion

to process lists and natural numbers

Preface, 9.4

HTDP Part 2 (Ch 11-13)

Sep 10

43

Tu

Sep 1008

Conditionals, Functions on Ranges & Point Values, Compound Data
BeakerX Notebook A: Source, PDF
BeakerX Notebook B: Source, PDF

  

Data Definitions, Data-driven Structural Recursion,

Homework 2

HTDP Part 3

Sep 16
5 ThSep 12Methods, Objects, Grading  10Mutually Recursive Definitions and Help FunctionsHTDP Ch 15-17Sep 17

64

Tu

Sep 17

Abstract Datatypes

Homework 1Homework 0

15

Local Definitions and Lexical Scope

Homework 3

 HTDP Parts 5-6

Sep 23

7 

Th

Sep 19

Recursively Defined Types

  

17

Lambda the Ultimate and Reduction Semantics

LawsOfEval.pdfSep 26

85

TuSep 24

Functions as Values

  19


Functional Abstraction and Polymorphism
Oct 6

9

 

Th

Sep 2624

1st-Class Functions, Imports

  

Functions as Values

Homework 4Oct 5

106

Tu

Oct 01

Named Arguments, Varargs, String Interpolation, Packages

Homework 2Homework 1

Sep 29

Generative (Non-structural) Recursion



Oct 6

11 

Th

Oct 03

Generic Types, Type Hierarchy, Variance
Supplement: Producers and Consumers

  

7

01

Lazy Evaluation and Non-strict Constructors



12

Tu

Oct

Type Hierarchy, Variance, Generic Map Function  

06

Techniques for Implementing Lazy Evaluation

Homework 5*Oct 14

13 

Th

Oct 10

Fold, Zip, Flatten, For Expressions

  

08

A Glimpse at Imperative Racket and Memoization




8

Tu

Oct 15

Midterm Recess (no classes)

  

13

Racket Review

Sample Exam

Sample Exam Key


13 

Th

Oct 17

Scala Immutable Collections, Call by Name

Homework 3Homework 2

15

On to Java!

OO Design Notes

FriOct 16Midterm

149

Tu

Oct 22

Monads, For-expression desugaring  Adapting the HTDP Design Recipe to JavaHomework 6 Oct 27

15 

Th

Oct 24

Operators, Accumulators
BeakerX Notebook: Source, PDF

  

Higher-order Functional Programming in Java



16

10

Tu

Oct 29

Video: Growing a Language, by Guy L. Steele, Jr.
Exam 1 at 7pm in DCH 1064

  

Four Key Idioms for Encoding FP in Java

Homework 7Nov 6

17 

Th

Oct 31

Scala Parser Combinators

  

The Singleton and Visitor Patterns



1811

Tu

Nov 0503

Lazy and Infinite Sequences

  

 

Th

Nov 07

Semantics of Exceptions

Homework 4Homework 3

12

Tu

Nov 12

Traits and Mixins
BeakerX Notebook A: MTG with Mixins – Source, PDF
BeakerX Notebook B: Stackable Mixins – Source, PDF

  

 

Th

Nov 14

Additional Scala Features

  

13

Tu

Nov 19

State Monad
BeakerX Notebook: Source, PDF

  

 

Th

Nov 21

Video: What to Leave Implicit, by Martin Odersky

Homework 5Homework 4
14TuNov 26No Class  

 

Th

Nov 28

Thanksgiving Holiday (no classes)

  

15

Tu

Dec 03

Course Wrap-Up

  
 ThDec 05Exam 2 (in class) Homework 5
16TuDec 10Study Day (no classes)  

 

Sat

Dec 14

Final exam/project date scheduled by university
(last day to to submit assignments for this course)

  

Java Generics and Their Role in FP in Java

Homework 8*Nov 16

19

Th

Nov 05

The Strategy Pattern: Functions as Arguments in Java



20

Tu

Nov 10

Core Haskell (call-by-name, lazy constructors) (Agnishom)



21

Th

Nov 12

Haskell Pattern Matching (Agnishom)

Homework 9Nov 19

22

Tu

Nov 17

Haskell Type Classes (Agnishom)


Dec 16

23

Th

Nov 19

Haskell Monads (Agnishom)

Final Project**

*Assignments marked with * are double assignments that count twice as much as regular assignments.  **indicates the project in lieu of a final examination* Lectures slides not yet updated from last year are marked with an asterisk.