## Interview with Simon Peyton Jones

Jeremy interviews Simon Peyton Jones, lead designer of the Glasgow Haskell Compiler

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. …

## 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 …

## 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 …

## 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 …

## 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 …

## 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 …

## Haskell Programming Tutorial: Recursive Functions on Lists

Computing with lists There are two approaches to working with lists: Write functions to do what you want, using recursive definitions that traverse the list structure. Write combinations of the …

## Functional Maps and Folds versus Imperative Loops

This tutorial explains the relationship between the higher-order list operations map, foldl and foldr and loops in an imperative language. The source code can be found on GitHub Summary map …

## 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.

## 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.

## 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 …