The preprint version of this tutorial is intended to be available 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, including this notice. Modified versions may not be distributed without prior
consent of the authfreeor, 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.
The goal of theYet 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. Suf\ufb01cient familiarity with your operating system and a text editor is also necessary (this report only discusses installation on con\ufb01guration on Windows and *Nix system; other operating systems may be supported \u2013 consult the documentation of your chosen compiler for more information on installing on other platforms).
Haskell is called a lazy, pure functional programming language. It is calledlazy be- cause expressions which are not needed to determine the answer to a problem are not evaluated. The opposize of lazy isstrict, 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\u2019s called \u201cdead code elmination\u201d \u2013 this removes unused expressions from the program.) It is calledpure because it does not allow side effects (A side effect is something that affects the \u201cstate\u201d of the world. For instance, a function that prints something to the screen is said to be side-effecting, as is a function which affects the value of a global variable.) \u2013 of course, a programming language without side effects would be horribly useless; Haskell uses a system ofmonads to isolate all impure com- putations from the rest of the program and perform them in the safe way (see Chapter 9 for a discussion of monads proper or Chapter 5 for how to do input/output in a pure language).
Haskell is called afunctional language because the evaluation of a program is equivalent to evaluating a function in the pure mathematical sense. This also differs from standard languages (like C and Java) which evaluate a sequence of statements, one after the other (this is termed animperative langauge).
This action might not be possible to undo. Are you sure you want to continue?