Skip main navigation

Recommended Reading

Jeremy visited Simon Thompson at the University of Kent to find out about Haskell textbooks. Simon has a huge collection of programming language books. Book Recommendations Simon mentions four textbooks …

Summary

Haskell programs compute by reduction, i.e. gradually replacing expressions by their values. A function takes one or more arguments and computes a result. Given the same arguments, the result will …

Reduction, Functions and Lists

Reduction A model of program execution A programmer needs a concrete model for how a program is executed. For imperative programs, we can execute statement by statement, keeping track of …

More Basic Elements by Example

A few more basic (and not-so-basic) elements of Haskell through comparison with other languages. We will not go into detail on the Haskell constructs, just show the similarities with constructs …

Summary

Expressions in Haskell are similar to those in other languages. There are only expressions in Haskell, i.e. no statements. Things that look like assignments are not updates of values but …

Introduction to Expressions and Equations

Expressions Haskell has no statements, only expressions! In an imperative language like C or Java, there are expressions that denote small scale computations (2*x), and statements that handle sequencing, looping, …

Basic Elements By Example

 Expressions In almost all programming languages you can create expressions such as: (b*b-4*a*c)/2*a and you can assign these expressions to variables: v = (b*b-4*a*c)/2*a In Haskell, you can do this …

Dollars in Haskell

The dollar operator is useful for greater flexibility in function application, although you could use more brackets instead. There are further details about dollars on the Learn You a Haskell …

Introducing Pairs in Haskell

Pairs, like lists, are a technique for building composite data out of individual values. A pair of Integers can be written as: (1,2) and a pair of Strings might be: …