Skip to main content
×
Home
    • Aa
    • Aa
  • This chapter is unavailable for purchase
  • Print publication year: 2007
  • Online publication date: June 2012

Chapter 2 - First steps

Summary

In this chapter we take our first proper steps with Haskell. We start by introducing the Hugs system and the standard prelude, then explain the notation for function application, develop our first Haskell script, and conclude by discussing a number of syntactic conventions concerning scripts.

The Hugs system

As we saw in the previous chapter, small Haskell programs can be executed by hand. In practice, however, we usually require a system that can execute programs automatically. In this book we use an interactive system called Hugs, which is the most widely used implementation of Haskell.

The interactive nature of Hugs makes it well suited for teaching and prototyping, and its performance is sufficient for most applications. However, if greater performance or a stand-alone executable version of a program is required, a number of compilers for Haskell are also available, of which the most widely used is the Glasgow Haskell Compiler. This compiler also has an interactive version that operates in a similar manner to Hugs, and can readily be used in its place for the purposes of this book.

The standard prelude

When the Hugs system is started it first loads a library file called Prelude.hs, and then displays a > prompt to indicate that the system is waiting for the user to enter an expression to be evaluated.

Recommend this book

Email your librarian or administrator to recommend adding this book to your organisation's collection.

Programming in Haskell
  • Online ISBN: 9780511813672
  • Book DOI: https://doi.org/10.1017/CBO9780511813672
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×