# Functional Programming in Haskell

This is an introductory course on functional programming in Haskell. It is designed for first year computing students in Nottingham, but the lectures are also made available on [YouTube](http://tinyurl.com/haskell-notts2).

The course is based on part I of [Programming in Haskell](http://people.cs.nott.ac.uk/pszgmh/pih.html).\
It is recommended for following the course, to purchase the below textbook, watch the youtube videos, slides are provided below to follow along, and then to try out to programming examples with resources below as well. \
All resources and links are provided at the bottom of the page.\
\
All credit goes to the [Graham Hutton](https://people.cs.nott.ac.uk/pszgmh/), University of Nottingham.

### 🧭 What This Course Covers

The course is based on *Part I* of Graham Hutton’s textbook **Programming in Haskell** and introduces foundational topics such as:

* Basic syntax and functions
* Recursion and higher-order functions
* Custom data types and pattern matching
* List comprehensions
* Lazy evaluation and interactive programs

The full lecture series is available **free on YouTube**, accompanied by slides and example code.

***

### 🪜 Step-by-Step Learning Path

#### ✅ Step 1: Bookmark the Main Page

📎 [Go to Course Page](https://people.cs.nott.ac.uk/pszgmh/pgp.html)

This is your hub. It includes the video lectures, downloadable slides, and example code.

***

#### ✅ Step 2: Watch Lectures in Order

Each lecture builds on the last. Follow the sequence exactly:

1. **Start with Lecture 1** (Course Overview + Demo)
2. Work through **Lectures 2–17**, one at a time
3. Take notes, pause often, and try coding along

***

#### ✅ Step 3: Read the Book (Optional but Helpful)

📖 *Programming in Haskell* (2nd edition) fills in background and provides exercises not covered in the videos.

Use it to:

* Reinforce concepts
* Get deeper explanations
* Practice with written exercises

***

#### ✅ Step 4: Code Along with Examples

Download the example code (linked on the course site) and run them in your local Haskell environment or an online interpreter like [replit](https://replit.com/) or [Try Haskell](https://tryhaskell.org/).

Experiment with:

* Modifying functions
* Creating your own recursive patterns
* Implementing mini-projects like the Countdown game

***

#### ✅ Step 5: Do the Exercises

Some lectures include hands-on exercises (especially Recursion and IO). Try solving them yourself before checking any solutions.

***

### 🛠 Tools You’ll Need

* **GHC** (Glasgow Haskell Compiler)\
  Install from haskell.org
* **Editor**: Use VS Code with the Haskell extension or any editor that supports Haskell
* **Hoogle**: Use Hoogle to search for functions, types, and documentation

***

### 🧠 Tips for Success

* Watch each video at 1x speed—these are concept-heavy lectures
* Type *everything* manually, even if code is provided
* Don’t skip recursion or lazy evaluation—they're core to Haskell
* Use GitHub to track your progress or share your code

***

### 🌟 Bonus: What to Do After This Course

Once you’ve finished:

* Continue to *Part II* of the textbook (monads, functors, etc.)
* Explore other Haskell resources like:
  * **Learn You a Haskell for Great Good**
  * **Real World Haskell**
  * **Haskell Programming from First Principles**

<figure><img src="/files/EkgpusUs9jJ3dS6a4UoH" alt=""><figcaption></figcaption></figure>

### Lectures

1. [Course Overview](https://youtu.be/qThX0aoW9YI)
2. [Haskell Demo](https://youtu.be/Qmi6T2AKA3k)
3. [Introduction](https://youtu.be/RS3X-KpefdE)
4. [First Steps](https://youtu.be/7hM4LrJVxDk)
5. [Types and Classes](https://youtu.be/6w38pf__nZk)
6. [Defining Functions](https://youtu.be/xBeI-TftpF8)
7. [List Comprehensions](https://youtu.be/oq7-RPLp3sI)
8. [Recursive Functions](https://youtu.be/RB2Ca7uqsUg)
9. [Exercises on Recursion](https://youtu.be/NpsUylZCVSA)
10. [Higher-Order Functions](https://youtu.be/4cqtYzG1Tfw)
11. [How To Think Recursively](https://youtu.be/14corMR2sQ4)
12. [Declaring Types and Classes](https://youtu.be/JDrMF0ondUU)
13. [The Countdown Problem](https://youtu.be/rQ0AoSV90QQ)
14. [Interactive Programming](https://youtu.be/oDqHNkQK97k)
15. [Exercises on Interaction](https://youtu.be/LOxP_jxI4KI)
16. [Lazy Evaluation](https://youtu.be/84bwnE2KZiA)
17. [Course Wrap Up](https://youtu.be/Q6g-uXi9Rko)

*Additional material:*

* [YouTube playlist](http://tinyurl.com/haskell-notts)
* [Demo code](http://people.cs.nott.ac.uk/pszgmh/pgp-countdown.hs)
* [Lecture slides](http://people.cs.nott.ac.uk/pszgmh/PGP-Haskell.zip)
* [Standard prelude](http://people.cs.nott.ac.uk/pszgmh/prelude-new.pdf)

### Resources

* [Course moodle page](https://moodle.nottingham.ac.uk/course/view.php?id=137725) (internal version of this page)
* [Haskell home page](http://www.haskell.org/) (for all things Haskell)
* [GHC](http://haskell.org/downloads/) (the Glasgow Haskell Compiler)
* [Hoogle](http://www.haskell.org/hoogle/) (for searching the libraries)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://committees.docs.intersectmbo.org/intersect-open-source-committee/about/open-source-office-oso/guides-and-educational-resources/functional-programming-in-haskell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
