parallelism. An active, growing community exists around the language, and more than 5,400 third-party open-source libraries and tools are available in the online package repository Hackage. Code examples A "Hello, World!" program in Haskell (only the last line is strictly necessary): module Main (main) where -- not needed in interpreter, is the default in a module file main :: IO () -- the compiler can infer this type definition main = putStrLn "Hello, World!" The factorial function in Haskell, defined in a few different ways (the first line is the type annotation, which is optional and is the same for each implementation): factorial :: (Integral a) => a -> a -- Using recursion (with the "ifthenelse" expression) factorial n = if n < 2 then 1 else n * factorial (n - 1) -- Using recursion (with pattern matching) factorial 0 = 1 factorial n = n * factorial (n - 1) -- Using recursion (with guards) factorial n | n < 2 = 1 | otherwise = n * factorial (n - 1) -- Using a list and the "product" function factorial n = product [1..n] -- Using fold (implements "product") factorial n = foldl (*) 1 [1..n] -- Point-free style factorial = foldr (*) 1 . enumFromTo 1 As the Integer type has arbitrary-precision, this code will compute values such as factorial 100000 (a 456,574-digit number), with no loss of precision. An implementation of an algorithm similar to quick sort over lists, where the first element is taken as the pivot: -- Type annotation (optional, same for each implementation) quickSort :: Ord a => [a] -> [a] -- Using list comprehensions quickSort [] = [] -- The empty list is already sorted quickSort (x:xs) = quickSort [a | a <- xs, a < x] -- Sort the left part of the list ++ [x] ++ -- Insert pivot between two sorted parts quickSort [a | a <- xs, a >= x] -- Sort the right part of the list -- Using filter quickSort [] = [] quickSort (x:xs) = quickSort (filter (<x) xs) ++ [x] ++ quickSort (filter (>=x) xs) Implementations All listed implementations are distributed under open source licenses. Implementations that fully or nearly comply with the Haskell 98 standard, include: The Glasgow Haskell Compiler (GHC) compiles to native code on many different processor architectures, and to ANSI C, via one of two intermediate languages: C--, or