Haskell
A purely functional, lazily evaluated language with type classes, compiled to native code by GHC.
- What it is
- Programming languages (compiled to machine code),Functional programming
- Type
- Open source
- Made by
- GHC developers and the Haskell community
- License
- BSD-3-Clause (GHC)
- Facts checked
- 8 October 2026
What it is
Haskell is purely functional: a function of type Int -> Int can’t read or write mutable variables or do input and output, so every call with the same argument returns the same value. Effects are values of type IO, run only when they reach main. Evaluation is non-strict (lazy): an expression is computed only when its result is needed, which makes infinite lists and user-defined control structures ordinary code. Type classes, such as Eq, Show and Monad, give overloading in a principled way: a function can work on any type that has an instance of a class.
The standard language is defined by the Haskell 2010 report, but in practice Haskell means GHC, the Glasgow Haskell Compiler. It is both a batch compiler and an interactive interpreter, GHCi. Its default backend, the native code generator, compiles all the way to assembly for the target machine; an LLVM backend and backends for JavaScript and WebAssembly are also available. GHC adds many language extensions on top of the report, grouped into editions: GHC2021 is the default, and GHC2024 is newer.
Why teams pick it
- Purity is visible in the types: a function without
IOin its type can’t perform side effects, and the compiler enforces it - Type classes and type inference keep generic code short without giving up type safety
- Laziness makes infinite data structures, such as the list of all primes, ordinary values that you consume as far as you need
- GHC compiles to fast native code, and GHCi gives an interactive loop for trying code
Watch out for
- Laziness makes memory use hard to predict: even experienced programmers find space behavior hard to predict, and space leaks need heap profiling and strict features such as
seqto fix - Pure code needs effects threaded through types such as
IOand other monads, which takes time to learn - Real-world Haskell is GHC’s dialect, with many extensions beyond the Haskell 2010 standard, so you learn a language edition plus the extensions a codebase turns on
Alternatives
What all compiled to machine code have in common →How it fits with other technologies
What uses Haskell
An infinite list, a type class and an `IO` action · haskell
-- Laziness: an infinite list is fine, only what is used gets computed.
primes :: [Integer]
primes = sieve [2 ..]
where
sieve (p : xs) = p : sieve [x | x <- xs, x `mod` p /= 0]
-- A type class: any type with an instance can be described.
class Describe a where
describe :: a -> String
data Coin = Heads | Tails
instance Describe Coin where
describe Heads = "heads"
describe Tails = "tails"
instance Describe Bool where
describe b = if b then "yes" else "no"
-- Purity: side effects happen only in IO, here in main.
main :: IO ()
main = do
print (take 10 primes) -- [2,3,5,7,11,13,17,19,23,29]
putStrLn (describe Tails ++ ", " ++ describe True) -- tails, yesSee it in a real stack
No architecture uses Haskell yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from1987–2010
By 1987 more than a dozen non-strict, purely functional languages existed, all similar in power and theory. At the FPCA ’87 conference in Portland, Oregon, researchers agreed that this diversity was holding the whole family back, and formed a committee to design one common language. It was named after the logician Haskell B. Curry.
The committee wanted a language for teaching, research and building large systems, fully described by a formal syntax and semantics, and free for anyone to implement. The Haskell 1.0 report, edited by Paul Hudak and Philip Wadler, appeared on April 1, 1990. Work on GHC had already begun in January 1989 at the University of Glasgow. After four revisions, the committee froze a stable version as Haskell 98, and Haskell 2010 followed.
Haskell’s ideas spread well beyond its own users. Monadic I/O, invented because a lazy, pure language had no good way to do input and output, is counted by its designers among Haskell’s main contributions. LINQ in C# 3.0 is based on Haskell’s monad comprehensions, and languages from Mercury to Clean adopted type classes.
Why it’s built this way
- Lazy evaluation
- Laziness is what brought the designers together: the committee existed to unify the many non-strict languages of the 1980s.
- Purity
- With demand-driven evaluation, the order of side effects can’t be predicted, so a lazy language had to be pure. Its designers later wrote that laziness’s biggest benefit was keeping Haskell pure.
- Type classes
- Proposed by Wadler in February 1988 to handle overloaded numeric operators and equality, which Miranda and Standard ML had each solved in a different, unsatisfying way.
- Monadic I/O
- Early Haskell’s I/O was clumsy enough to embarrass its designers. Monads gave a way to sequence effects without giving up purity.
Timeline
- 1987
Committee formed at FPCA ’87 to design a common lazy functional language
- 1988
Wadler proposes type classes to the committee
- 1989
Work on GHC begins at the University of Glasgow
- 1990
Haskell 1.0 report published on April 1
- 1997
The Haskell Workshop decides to freeze a stable Haskell 98
- 2010
Haskell 2010 report, edited by Simon Marlow
Sources7 · facts checked 8 October 2026
- Haskell 2010 report, chapter 1: Introduction (purely functional, non-strict, type classes)
- A gentle introduction to Haskell: Type classes and overloading
- Hudak et al.: A history of Haskell (laziness, purity, space leaks) · archived copy, original
- GHC User’s Guide: Introduction (batch compiler and GHCi)
- GHC User’s Guide: GHC backends (native code generator, LLVM)
- GHC User’s Guide: Controlling editions and extensions (GHC2021 default, GHC2024)
- GHC license (BSD-style, University of Glasgow)