Language

Haskell

First appeared
1990
Paradigm
Purely functional, lazy, statically typed
Toolchain
GHC 9.6.6
Container image
debian:trixie-20261027-slim + ghc 9.6.6-4

Haskell was designed by a committee of researchers and published in 1990, to give the many lazy functional languages of the time one common standard. It’s the only purely functional language on this site: there are no loops and no variables that change, so a value, once defined, stays put. Repetition comes from recursion, folds such as sum and foldl', and list comprehensions. Here it is compiled with GHC, with every warning turned into an error.

We use only base, the library every Haskell program starts with. GHC also installs a few separate packages, such as containers for maps, but like Ruby’s bundled gems they aren’t part of the standard library, so we leave them out and keep counts in plain lists. There’s no CSV reader and no statistics, and splitting a string on commas means writing a small function. The split, vector, and statistics packages from Hackage, Haskell’s package archive, aren’t installed.

Quirks

Concepts in Haskell

Run the examples locally

You need Docker and Python 3. The harness builds the pinned container and runs every Haskell example:

git clone https://github.com/qnixon/dswithx.git
cd dswithx
python3 harness/run_tests.py --language haskell