Chapter 17. Haskell

Haskell was designed by a committee as a standard pure functional language during the late 1980's. It is based on ML and Miranda (from which it inherits its lazy evaluation semantics). The first definition was defined in 1990, and the current standard Haskell98 is considered a stable foundation of the language. By now, Haskell has become the most popular pure functional language. Looking at it after the ML chapters, it appears as a "purer" version of ML.

17.1. Software and Installation

We use the Hugs implementation of Haskell98 on Windows and Linux for our experiments. On Windows, it comes with an installer and a small graphical development environment winhugs.exe which can be used to enter code interactively as we have done before. The window also contains a browser for the classes and modules (see below). Starting Hugs loads the standard module Prelude and then waits for our commands at the prompt.

ahohmann@kermit:~$ hugs
__   __ __  __  ____   ___      _________________________________________
||   || ||  || ||  || ||__      Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__||  __||     Copyright (c) 1994-2003
||---||         ___||           World Wide Web: http://haskell.org/hugs
||   ||                         Report bugs to: hugs-bugs@haskell.org
||   || Version: November 2003  _________________________________________

Haskell 98 mode: Restart with command line option -98 to enable extensions

Type :? for help
Prelude> 

As an alternative, all examples can be run using the Glasgow Haskell Compiler system, or GHC for short. It also comes with an interpreter called ghci which works similar to Hugs. In face, GHC is the more complete Haskell98 implementation including some standard library functions missing in Hugs (which probably have been added to Hugs by the time you are reading this).

References

Simon Thompson's Haskell book [THOMPSON99]> is a very readable and up-to-date introduction to Haskell.

Simon Thompson, 0-201-34275-8, Addison-Wesley, 1999, Haskell - The Craft of Functional Programming: Second Edition.