Yet Another Haskell Tutorial
Hal Daumé III
Copyright (c) Hal Daume III, 2002-2006. The preprint version of this tutorial is
intended to be free to the entire Haskell community, so we grant permission to copy
and distribute it for any purpose, provided that it is reproduced in its entirety, in-
cluding this notice. Modified versions may not be distributed without prior concent
of the author, and must still maintain a copy of this notice. The author retains the
right to change or modify this copyright at any time, as well as to make the book no
longer free of charge.
About This Report
The goal of the Yet Another Haskell Tutorial is to provide a complete intoduction to
the Haskell programming language. It assumes no knowledge of the Haskell language
or familiarity with functional programming in general. However, general familiarity
with programming concepts (such as algorithms) will be helpful. This is not intended
to be an introduction to programming in general; rather, to programming in Haskell.
Sufficient familiarity with your operating system and a text editor is also necessary
(this report only discusses installation on configuration on Windows and *Nix system;
other operating systems may be supported – consult the documentation of your chosen
compiler for more information on installing on other platforms).
What is Haskell?
Haskell is called a lazy, pure functional programming language. It is called lazy be-
cause expressions which are not needed to determine the answer to a problem are not
evaluated. The opposize of lazy is strict, which is the evaluation strategry of most
common programming languages (C, C++, Java, even ML). A strict language is one in
which every expression is evaluated, whether the result of its computation is important
or not. (This is probably not entirely true as optimizing compilers for strict languages
often do what’s called “dead code elmination” – this removes unused expressions from
the program.) It is called pure because it does not allow side effects (A side effect
is something t