Polyglot
Languages Haskell
Volume Haskell

Haskell

A purely functional, statically typed, non-strict programming language standardised by an academic committee. The mainstream representative of the strongly typed functional tradition.

Paradigms
functional · declarative
Typing
static
Memory
gc
Version
GHC 9.10
First released
1990

Haskell is a purely functional, statically typed, non-strict (lazily evaluated) programming language with a Hindley–Milner-derived type system extended with type classes. Functions in Haskell are mathematical functions: a function applied to the same arguments yields the same result, and side effects — input, output, mutation, and concurrency — are expressed through explicit monadic types (IO, State, STM) that the type system tracks separately from pure computation. The language’s evaluation strategy is non-strict: a subexpression is evaluated only when its value is required, which permits the natural expression of infinite data structures and short-circuiting algorithms. Type inference relieves the programmer of most explicit type annotations; the compiler verifies the type of every expression and rejects ill-typed programs at translation time.

History

Haskell originated at the 1987 conference on Functional Programming Languages and Computer Architecture, where a committee was formed to design a standard non-strict, purely functional language to consolidate the dispersed prior research on lazy evaluation. The language is named after Haskell B. Curry, the logician and originator of combinatory logic. Haskell 1.0 was published in 1990; subsequent revisions through Haskell 1.4 (1997) culminated in Haskell 98, the first stable standard, in 1999. Haskell 2010 is the current standard. In practice, the substantial majority of Haskell code targets a particular release of the Glasgow Haskell Compiler (GHC) with selected language extensions enabled through the LANGUAGE pragma — OverloadedStrings, TypeFamilies, GADTs, RankNTypes, and many others. The language continues to evolve through the GHC project rather than through a successor standard; the current GHC release is 9.10.

Hello world

main :: IO ()
main = putStrLn "Hello, world!"

Build and execution with the standard toolchain:

ghc hello.hs && ./hello

The principal Haskell compiler is GHC (the Glasgow Haskell Compiler), the reference implementation maintained by a community of academic and industrial contributors. Two project-management tools coexist for non-trivial projects: Cabal, the original build system distributed with GHC, and Stack, a curator-style workflow built on top of Cabal that pins package versions to LTS snapshots. The official package registry is Hackage; Stackage provides curated, build-tested snapshots of Hackage suitable for use as a project’s dependency baseline.