Haskell track: introduction


Haskell is fun to program in. It's like it lets me create my own little programming language that didn't have math until I added it! All this, and no debugging, really.

    -- Jared Updike, Caltech senior

This is the home page for the Haskell track of CS 11. This information is for the Fall 2007 term.


Administrative information

All the administrative information for the Haskell track is on this page.

About the Haskell programming language

The Haskell language is named after Haskell Curry, one of the major figures in the development of the theoretical foundations of functional programming languages (notably the theory of combinatory logic). The Haskell language has many interesting features, including:

Haskell is a highly enjoyable language to program in for many tasks, but it isn't perfect. Here are a few of the problems that are commonly encountered:

Despite this, people have written and are writing real applications in Haskell. Some of the best-known applications include:

In addition, one of the nice things about Haskell is that it will definitely open your mind to a new way of writing programs. One thing to be aware of about Haskell is that, as one IRC poster said, "Haskell is bad, it makes you hate other languages." Once you start programming in Haskell, programming in most other languages will start to feel like wading waist-deep through a swamp. I love programming in Haskell, and I hope you will too.


About functional programming

Functional programming is a paradigm of programming (i.e. a particular way of writing programs) which contrasts greatly with the more common imperative and object-oriented paradigms. Haskell is a pure functional language, which means that it only supports functional programming. But what exactly is functional programming?

First off, functional programming means that functions are data. This means that functions can be passed as arguments to other functions, they can be created on the fly, they can be returned from a function, and they can be stored into data structures. Most computer languages (e.g. C) will allow you to pass a function as an argument to another function (although Java doesn't even allow that unless you wrap the function in an object) but they won't allow you to create a function on the fly. In addition to this, functions can hold references to data objects that existed when they were created and use them when they're invoked (such functions are called "closures" and are really like lightweight objects).

Another key aspect of functional programming is that data should be persistent. Put differently, it means that you cannot use mutable data in pure functional programming. So re-assigning the values of variables is impossible in Haskell! Most programmers probably think that it's impossible to program without using mutable variables all over the place, but it is indeed possible; it just requires that you think differently. Instead of using variables, you use constants: values that are bound to an identifier which don't change after being assigned. This is more like the way we think in mathematics: when we say that "a = 5" we mean that "a" represents the number "5" from that point on, not just until we change it to something else. In fact, one of the interesting aspects of functional programming is that it's much more amenable to mathematical verification of algorithm correctness than imperative programming is.

The fact that data is persistent in Haskell has a large number of effects on the way you write programs in the language, including:


Lectures


Assignments


Grades

Current grades for all students are located on this page.


Miscellaneous stuff


Books and References