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 …
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 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 …
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 …
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 …
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, …
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 …
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 …
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: …