The Haskell Programming Language

An imperative language

Scheme is still imperative

A more realistic example

Factoring out an expression

Haskell: Works with fewer ifs and buts

Overview of Haskell

Haskell’s History

The brevity of Haskell

Quicksort in two lines!

Haskell syntax

Syntax: Haskell vs. Scheme

Hugs98 Haskell Users Gofer System

One gotcha of Hugs98

Learning Haskell

Some simple expressions

When things do not go according to plan...

More errors...

A simple example

Fibonnaci numbers Mathematical notation

Fibonnaci numbers in Haskell Two different approaches

Indentation matters!

Implicit vs. explicit grouping

Explicit grouping is useful at the repl

Function application

Functions with multiple arguments

Currying

Partial application

Specializations

Lambda expression syntax

Functions vs. operators

Other operators

Why use tuples for arguments?

Ackermann function (Wilhelm Ackermann, 1928)

Patterns

Wildcards in patterns

Patterns and case expressions

Conditionals

List shorthands

List comprehension

Compare to using higher order functions

Comprehension instead of nested loops

Values have types

Functions have types too

Built in types

Dynamic vs. Static typing

Advantages of static typing

Static typing rules

Application rule

Cancellation rule

Function rule

List rule

Tuple rule

Length of list of integers

Applying len to [Char]

What does len rely on?

Type variables

Polymorphic functions

Type inference

Type unification

Unification is the intersection of the described types

Evaluation in Haskell

Not all arguments get evaluated

Eager evaluation vs. lazy evaluation

Lazy evaluation is efficient

No need for special forms

Outside-in evaluation avoids intermediate lists