Haskell

**Haskell**  is a purely functional programming language. It is named after Haskell Brooks Curry, a U.S. mathematician who contributed a lot to logic. Haskell is based on lambda calculus and uses the Greek letter lambda as its logo. The main implementations are the Glasgow Haskell Compiler (GHC), and Hugs, a Haskell interpreter.

## Examples

The following is an example Hello World program in Haskell:

One way to create an infinite list of Fibonacci numbers is this:

## Concept

The language is similar to traditional mathematics, in which all variables are pure, meaning they cannot change during the program's runtime. All equations must remain true in principle. For any impure actions, there is the IO monad, which itself is pure, but creates side effects when ran.

Functions are treated like normal values, meaning they can be applied to other functions. 2+ argument functions are fundamentally a one argument function, a function that takes in some input and returns a function in the process of partial application. Traditional variables are treated like zero argument functions.

The order of variable declarations within the file does not matter, allowing for mutual recursion, where variables are defined in terms of each other.

### Data Types

|Data Type|Purpose|
| --- | --- |
|Integer|A signed integer using arbitrary precision arithmetic, meaning the number can be as large as possible|
|Char|Short for "character". Any character stored in Unicode.|
|String|A list of characters.|
|Boolean|See boolean.|
|[a]|List data type, stored as a linked list.|
|a -> b|Function between data types a and b.|
|Double and Float|Floating point numbers, commonly used for decimals due to its efficiency.|

### Type Classes

A type class is a descriptor of a data type. These are used to make functions more general. For example, the addition operator has a type signature ofThis statement translates to "given some data type that is a number, you can add two variables of that type to create a new one".
|Type Class|Description|Example Functions|Example Data Types|
| --- | --- | --- | --- |
|Eq a|Ensures a data type (in this case, a) can be equated|(==): Checks equality between two variables of the same data type|Integer, String|
|Ord a|Places order between variables of a data type|(>) & (<): Compares two variables of the same data type|Integer, Char|
|Num a|Allows for basic mathematical operators between variables of this data type|(+), (-), (*)|Integer, Float, Double|

### Lazy Evaluation

Lazy evaluation is where expressions aren't evaluated immediately, sometimes never evaluated. This allows for infinitely long lists, and avoids unnecessary calculations.

## Influence

Haskell was influenced by many earlier programming languages. These were Clean, FP, Gofer, Hope and Hope<sup>+</sup>, Id, ISWIM, KRC, Lisp, Miranda, ML and Standard ML, Orwell, SASL, SISAL, and Scheme.

Haskell itself has influenced many later programming languages, such as Agda, Bluespec, C++11/Concepts, C#/LINQ, Cayenne, Clean, Clojure, CoffeeScript, Curry, F#, Isabelle, Java/Generics, Mercury, Perl 6, Python, Scala, Visual Basic 9.0.

## Infobox (programming language)

- **name**: Haskell
- **logo**: Haskell-Logo.svg
- **paradigm**: functional programming, functional, lazy/non-strict programming language, non-strict, modular programming, modular
- **designer**: Simon Peyton Jones, Lennart Augustsson, Dave Barton, Brian Boutel, Warren Burton (computer scientist), Warren Burton, Joseph Fasel, Kevin Hammond (computer scientist), Kevin Hammond, Ralf Hinze, Paul Hudak, John Hughes (computer scientist), John Hughes, Thomas Johnsson, Mark Jones (computer scientist), Mark Jones, John Launchbury, Erik Meijer (computer scientist), Erik Meijer, John Peterson (computer scientist), John Peterson, Alastair Reid (computer scientist), Alastair Reid, Colin Runciman, Philip Wadler
- **latest release version**: Haskell 2010
- **latest test version**: Announced as Haskell 2014
- **typing**: static typing, static, strong typing, strong, type inference, inferred
- **implementations**: Glasgow Haskell Compiler, GHC, Hugs, NHC, JHC, Yhc, UHC
- **dialects**: Helium (Haskell), Helium, Gofer (software), Gofer
- **operating system**: Cross-platform
- **file ext**: `.hs`, `.lhs`