Links and Useful Resources

Haskell

Throughout most of the course, we will use the functional programming language Haskell. In particular, we will use Haskell as a metalanguage for describing programming language concepts. It is therefore absolutely essential that you develop your Haskell programming skills!

I recommend that you consult multiple Haskell tutorials/manuals in addition the assigned reading. Even better is if you’re able to find a way to write Haskell programs outside of class, for example, to help you solve problems in your other classes or just doing practice problems that you may find online.

Installing GHC

The Haskell compiler we’ll be using is GHC. You’ll also need a tool called cabal for installing Haskell packages (see below). The easiest way to install GHC and cabal varies by platform.

On Windows, install Haskell Platform, which includes both GHC and cabal.

On Mac, use Homebrew. First install Homebrew itself, if you don’t already have it on your system. Then install GHC and cabal with the following commands:

> brew install ghc
> brew install cabal-install

On Linux, use whatever package manager is standard on your distribution (e.g. apt on Ubuntu, dnf on Fedora). The cabal package you want is probably called cabal-install. Make sure that the GHC version installed is at least 8.4. If it’s not, you may need to install GHC in another way, such as using Stack.

Installing Doctest

Doctest is a useful tool for running examples written in the comments of a Haskell file as unit tests. We’ll use this in some homework assignments.

After you’ve installed GHC and cabal, you can install doctest with the following commands:

cabal update
cabal install doctest

Important: You will also need to add the directory that cabal installs its binaries into to your $PATH. Here are my best guesses as to where that will be:

  • Linux: ~/.cabal/bin
  • Mac: ~/.cabal/bin or ~/Library/Haskell/bin
  • Windows: C:\Program Files\Haskell\bin

Haskell Tutorials and Reference Manuals

  • Introduction to Haskell by Brent Yorgey – These class notes provide an excellent, concise introduction to Haskell. I’ll assign reading from this course notes in the first couple of weeks. This course is also a great source of additional practice problems.

  • Haskell: The Confusing Parts – An FAQ especially for folks coming to Haskell from a C/Java background, which I guess is many of the people in this class.

  • Real World Haskell – O’Reilly’s book-length introduction to Haskell focusing on practical applications. Available for free online.

  • Haskell Wikibook – An easy-to-navigate and thorough resource.

  • A Gentle Introduction to Haskell – Famous for being not-so-gentle, but a really great resource for refining your understanding of Haskell, once you get the basics down.

Haskell Style

Prolog

In the last couple weeks of the course, we will use the logic programming language Prolog. As with Haskell, I strongly recommend you supplement the course material with reading and exercises outside of class.

  • SWI-Prolog – The Prolog environment we’ll be using. I’ll assume you have this installed.

  • Learn Prolog Now! – This book provides a good introduction to Prolog and plenty of exercises for practice. Available for free online.

  • An Introduction to Logic Programming through Prolog – A free older textbook based on Prolog. I haven’t read this one but it looks like a pretty good resource.

  • Prolog Wikibook – Another one I haven’t read, but looks like a pretty good resource.


Back to course home page