Haskell/Overview

Haskell is a standardized functional programming language with non-strict semantics. Haskell features include support for recursive functions, datatypes, pattern matching, and list comprehensions. By combining these features, functions that would be difficult to write in a procedural programming language are almost trivial to implement in Haskell. The language is, as of 2011, the functional language on and in which the most research is being performed.

The examples below give a taste of Haskell, oriented toward those familiar with other programming languages.

Examples
The classic definition of the factorial function:

A cute definition using Haskell's built-in list notation and the standard  function:

Both definitions above should compile into the same efficient code via a smart compiler using equational reasoning.

A naive implementation of a function which returns the nth number in the Fibonacci sequence:

A function which returns a list of the Fibonacci numbers in linear time:

The previous function defines an infinite list, which is possible because of lazy evaluation.

One could implement  as: ( is an operator which gets the nth element of a list).

The Quicksort algorithm can be expressed in Haskell concisely as: (Note that, conventionally, quicksort swaps values in-place; however, since Haskell's lists are immutable, this requires values to be copied instead.)

Non-skipping stable merge sort is

where  is the function composition operator ,   is a lambda expression (a nameless function), and the predefined function      repeatedly applies a function fun  until a condition cond  is met; with   keyword introducing the local definitions showcasing the use of patterns (with   matching a non-empty list with the head   and tail  ) and guards.

The Hamming numbers sequence is just

using sections (partially applied operators) and the built-in function  working with lists, whether finite or not, due to lazy (i.e. by-need ) evaluation. Also, enclosing function's name into back-quotes turns it into infix operator so that sub-expressions are automatically formed as if by placing parentheses appropriately, forming a nested expression, as in 2+3+5 --> ((2+3)+5) ; and a comment line is introduced by two dashes.

Finally, the infinite list of prime numbers by trial division is or as unbounded incremental Sieve of Eratosthenes with ordered lists, defining primes corecursively as natural numbers which are not multiples of primes. Or with arrays,

It's not just for quicksort!
Haskell is also used to build "real world" programs, including graphical or web user interfaces. To get a taste of Haskell in the real world, check out web frameworks in Haskell and Haskell in industry articles on the Haskell wiki, or darcs, an advanced revision control system written in Haskell.