Module 09 Study Guide
Learning Objectives (Haskell, CPL Ch.15)
We are learning elementary Haskell to get a taste of functional programming. The overall way of thinking about programming is very different in functional programming, so learning Haskell will introduce you to this new way of thinking about programming. Furthermore, many of the techniques used in Haskell are the same as in other functional languages, and are also useful in imperative programming.
In this first Haskell programming module, we are learning the most basic aspects of the language. Specifically, by the end of the module you should be able to
- Run the
ghci
Haskell interpreter and load and execute code - Use built-in arithmetic, boolean, and relational functions
- Use conditional expressions
- Create lists using
:
(cons), ranges, concatenation, and list comprehensions - Manipulate lists using various built-in functions
- Create and manipulate tuples
- Determine expression types and specify types
- Define functions
- Use parameter pattern matching in function definitions
- Use guards in function definition
- Use recursion for iteration in function definitions
- Write recursive helper functions and use parameters as accumulators and counters.
Resources
- CPL Chapter 15 (especially 15.1-15.4.1, 15.8, and 15.10-15.11)
- Installing Haskell
- Learn You a Haskell For Great Good! tutorial
- Wikibook
- Quick reference
- Functional Thinking Safari E-book
- Real World Haskell Safari E-book
- Hoogle Haskell Reference (Prelude)
Lab
Please complete the lab. You may begin it any time. You should try to finish it by Wednesday so you can start working on the programming assignment in class on Thursday (please bring your computer).
Programming Assignment
Please complete the project and submit your code on Canvas by the due date.