MWF 8:10pm - 9:00am (A1)
MC Reynolds 317
Dr. Brent Yorgey yorgey@hendrix.edu (501) 450-1377 Office Hours
Functional programming takes as its central organizing principle the idea of evaluating expressions rather than executing instructions. It supports programming at a high level of abstraction and carefully controlling side effects, which are critical given the ever-increasing sophistication of software systems. This course explores functional programming in depth, combining practical programming experience in Haskell with a deep exploration of the underlying theory. Covered topics include algebraic data types and pattern matching, static type systems, recursion and induction, folds, lambda calculus, laziness, functors, and monads. A few weeks will also be spent learning about computer-checked formal proofs using the dependently typed functional language/proof assistant Agda.
Upon completing this course, you will be able to:
Haskell
The Craft of Functional Programming
Agda
AgdaPad
You will need to install a Haskell toolchain on your computer. Follow these instructions to install GHCup, which is a tool for managing all the major components of a Haskel toolchain (GHC, cabal, stack, haskell-language-server, etc.).
cabal
stack
haskell-language-server
For editing Haskell code, I recommend using Visual Studio Code, which has excellent Haskell support. But if you have a different favorite editor, it will probably work with Haskell just fine.
You should follow this style guide when writing Haskell code in this class.
You will prepare and submit for my approval a grading contract explaining your chosen final grade and what you will do to achieve it. You will then earn your chosen final grade by fulfilling the agreed-upon contract.
This may be different than what you are used to. Professor Cathy Davidson of CUNY perfectly sums up the reasons for doing things this way:
The advantage of contract grading is that you, the student, decide how much work you wish to do this semester; if you complete that work on time and satisfactorily, you will receive the grade for which you contracted. This means planning ahead, thinking about all of your obligations and responsibilities this semester and also determining what grade you want or need in this course. The advantage of contract grading to the professor is no whining, no special pleading, on the student’s part. If you complete the work you contracted for, you get the grade. Done. I respect the student who only needs a C, who has other obligations that preclude doing all of the requirements to earn an A in the course, and who contracts for the C and carries out the contract perfectly.
There is no specific format required for a grading contract, but it must have the following components:
Your desired course grade. You may choose to contract for an A, B, or C (if you’re wondering about D’s and F’s, see below). Note that your grading contract should not explain the reasons for your choice. I will not judge you because of your choice, and you do not need to justify it: there are as many different valid reasons for choosing to work toward a particular final grade as there are students. If you do wish to explain to me the reasons for your choice—which you are in no way required to do—you may do so in an email, a personal conversation, etc., but it should not go in your contract.
A description of the work and requirements you will complete, in checklist format. It doesn’t have to be super detailed, but you do have to explicitly include everything. For example, you can’t just say “I will complete all the assignments listed in the syllabus”; you must actually list them. This is so that you and I both know that you are explicitly aware of the requirements, and to help you keep track of what you have completed and what you have yet to complete. You also have some choice in terms of which assignments you complete, so you must record your choice in the contract.
For example, a grading contract might look like this:
My desired course grade in Functional Programming is a B. To achieve this grade, I will complete the following:
You must turn in an initial proposed grading contract by the start of class on Friday, January 19th. After the initial submission, I may require some revisions before I approve your contract.
Two times during the semester (Thursday, February 22 and Thursday, April 4) you are required to reflect on your progress in the course and complete an evaluation of your work, comparing it against what you agreed to in your grading contract. Your evaluation should:
Contain a copy of your original grading contract, with items you have completed checked off.
Revise your grading contract with more specific details as appropriate, for example, regarding which projects you intend to complete.
Include a 1-2 paragraph reflection, which answers questions such as the following:
Your evaluation is also an opportunity to request an adjustment to your contract in either direction. If you find that you will be unable to meet the obligations of your contract, you may request to move to a lower grade and its requirements. Contrariwise, if you find that you’ve been performing above the obligations of your contract, you may request to fulfill the requirements for a higher grade.
Note, however, that you don’t have to wait for an evaluation to adjust your contract. If your life has really gone off the rails (or if, say, you are finding the class easier and more enjoyable than you thought!) just come and talk to me about adjusting your contract.
[Adapted from Cathy Davidson.] You cannot intentionally contract for a grade of D (and certainly not for an F). However, I reserve the right to award a grade of D or F to anyone who fails to meet their contractual obligations in a systematic way. A “D” grade denotes some minimal fulfilling of the contract (typically, I would want to see at least 5 projects complete). An “F” denotes absence of enough satisfactory work, as contracted, to warrant passing of the course. Both a “D” and “F” denote a breakdown of the contractual relationship.
12 weekly problem sets will be assigned, with a mix of coding and written exercises. Problem sets will generally be assigned and due each Friday. Coding exercises must be submitted in .hs or .lhs format; written exercises must be submitted as a .pdf.
.hs
.lhs
.pdf
In addition to problem sets, there will be two larger coding projects in the course.
Each project will be worth up to 3 points, depending on the level to which it is completed. Each project will have a specification explaining what you must do to complete the project to each level. Generally speaking, level 1 denotes a minimal completion of the basic learning objectives for the project, level 2 denotes a fuller completion of the learning objectives, and level 3 requires some extra depth.
Projects may be completed individually, or in groups of up to 3. However, note that in order to get an A or B in the course, you must complete at least one project individually.
Each student starts the semester with five virtual tokens which they can spend however they wish. Tokens are non-transferable.
Conversely, additional tokens may be earned at any time:
main = interact solve solve :: String -> String solve = ...
You may complete a final project which extends or ties together some of the things we have learned over the course of the semester.
Important dates:
You may work by yourself, or in groups of up to three students. Groups of five are right out.
You have quite a bit of latitude in what sort of project you choose to complete (subject to approval, of course). Possible types of projects include (but are not limited to):
Your project should somehow go beyond what we have covered in class, that is, completing the project should require you to learn something new.
You must submit a project proposal by Tuesday, April 9th explaining what you intend to do. The proposal should be about 1 page, and must clearly explain:
I will provide feedback on your proposal to ensure that your project is at an appropriate level of difficulty.
During the afternoon on Friday, May 3, you will give a short presentation of your project. The presentation could take many forms depending on the type of project. For example, it could just be a demo, if you primarily produced some sort of artifact; it could be a presentation with slides or a chalkboard talk explaining something.
Since giving a good presentation is not really a learning goal of this course, there is no particular specification or set of criteria that a presentation must meet. However, here are some suggestions for giving a good presentation:
You may submit your project in one of two ways:
By submitting a .tar, .tgz or .zip file
.tar
.tgz
.zip
By submitting a link to a publically accessible source repository, e.g. on github or bitbucket. Be sure to submit a link to one or more specific commits, tags, etc. representing what you would like to be graded, rather than just to the repository in general.
To complete the project to Level 1:
To complete the project to Level 2:
Ensure that your code uses good Haskell style.
Make sure your code is simplified as much as possible, for example, without redundant pattern-matching.
Turn on {-# OPTIONS_GHC -Wall #-} and make sure your code generates no warnings.
{-# OPTIONS_GHC -Wall #-}
Ensure your project is well-documented, with plenty of comments explaining the code, thorough README and INSTALLING files, good examples (if appropriate), etc.
README
INSTALLING
To complete the project to Level 3, the project must go beyond the content of the course in some significant way. I am aware that this is rather vague; if you would like to get Level 3 credit for the project, I encourage you to talk to me about it during the planning phase so that we can agree on an appropriate topic, and get feedback from me before the final deadline to make sure you are on track.
I will provide feedback on final projects that do not meet the specifications, allowing you an opportunity to address the issues and turn in a revised project.
Although you and I play different roles in the course, we both have your learning as a common goal. There are things I expect from you as a student in the course, but there are also things you can expect of me as the course instructor and facilitator.
If I am not fulfilling my responsibilities outlined below, you are welcome (and encouraged!) to call me out, perhaps via the anonymous feedback form. I will also initiate a conversation if you are not fulfilling yours. However, none of us will meet all of the expectations perfectly—me included!—so it’s also important that we have grace and patience with one another.
Attendance in this class is not required as part of your grade. However, I do expect you to attend and appreciate knowing in advance if you will need to miss class.
If you have a documented disability or some other reason that you cannot meet the above expectations, and/or your learning would be best served by a modification to the usual course policies, I would be happy to work with you—please get in touch (via Teams or email)! The course policies are just a means to an end; I don’t care about the policies per se but I do care about you and your learning.
It is the policy of Hendrix College to accommodate students with disabilities, pursuant to federal and state law. Students should contact Julie Brown in the Office of Academic Success (505.2954; brownj@hendrix.edu) to begin the accommodation process. Any student seeking accommodation in relation to a recognized disability should inform the instructor at the beginning of the course.
Hendrix College values a diverse learning environment as outlined in the College’s Statement on Diversity. All members of this community are expected to contribute to a respectful, welcoming, and inclusive environment for every other member of the community. If you believe you have been the subject of discrimination please contact Dean Mike Leblanc at leblanc@hendrix.edu or 501-450-1222 or the Title IX Coordinator Allison Vetter at titleix@hendrix.eduor 501-505-2901. If you have ideas for improving the inclusivity of the classroom experience please feel free to contact me. For more information on Hendrix non-discrimination policies, visit hendrix.edu/nondiscrimination.
Hendrix recognizes that many students face mental and/or physical health challenges. If your health status will impact attendance or assignments, please communicate with me as soon as possible. If you would like to implement academic accommodations, contact Julie Brown in the office of Academic Success (brownj@hendrix.edu). To maintain optimal health, please make use of free campus resources like the Hendrix Medical Clinic or Counseling Services (501.450.1448). Your health is important, and I care more about your health and well-being than I do about this class!