Skip main navigation

Course Feedback

At this half-way stage of the course, Jeremy will record a short feedback video that reviews the first three weeks, to address some of your comments and questions. The video …

Brief History of Haskell

Once upon a time, there was a mathematician named Alonzo Church at Princeton University. Church was Alan Turing’s PhD supervisor. Church devised a mathematical model of functions called lambda calculus. …

Type Classes

Inevitably, we have glossed over some of the more complex parts of Haskell while we have been introducing the language. Now it’s time to explore one of the ideas we …

Grow a Tree

In Computer Science, trees grow upside-down. The unique root is at the top, and the leaves are at the bottom. The binary tree data type is often used for storing …

Define Your Own Data Types

So far we have looked at the basic built-in data types like Int and Boolean. We can combine these basic types to generate custom data types, using algebraic sums and …

Summary

The basic mechanism for computing on any datastructure in Haskell is recursion. Recursion always has a base case and an induction case. For lists, the base case is the empty …

Writing a Haskell Program: The Guessing Game

We are going to write a moderately long Haskell program, consisting of multiple functions and I/O actions. Guessing Game The program is going to be a guessing game, called Starman. …

How to Run GHCi

We used the online Haskell interpreter (tryhaskell) for the first few programming exercises. Now we want to move to GHCi, for some larger and more complex Haskell development.

Installing Haskell for Yourself

GHC stands for the ‘Glasgow Haskell Compiler’. This is actually a set of components that allow you to execute Haskell programs on your local machine. GHC works on Windows, Mac …

I/O and a First Encounter with Monads

Pure Functions So far, we have concentrated on pure functions. These kinds of functions take values as arguments, do some processing of those values, then return a result value. A …

Why I/O?

Computers interact with the outside world via input and output (I/O). The Haskell programming language has specific support for I/O operations, which we will explore in the next few steps.

Zip that List

The zip function is used to combine a pair of lists into a list of pairs. Since lists are such fundamental data structures in functional programming, it’s important to be …