← codetypingtest

Haskell typing test

Haskell looks unlike anything else in the test. There are no loops and few brackets. Instead you type signatures with :: and ->, guards with |, and function composition with a single dot. Short programs can still be slow, because nearly every word is a new name or a symbol.

Start the Haskell typing test

What you'll type in Haskell

Example: FizzBuzz in Haskell

Guards replace if and else, and mapM_ (putStrLn . fizzBuzz) does the printing. Notice the type signature line above each definition.

fizzBuzz :: Int -> String
fizzBuzz n
  | mod n 15 == 0 = "FizzBuzz"
  | mod n 3 == 0 = "Fizz"
  | mod n 5 == 0 = "Buzz"
  | otherwise = show n

main :: IO ()
main = mapM_ (putStrLn . fizzBuzz) [1 .. 15]

Type this program now

Tips for typing Haskell faster

All 20 Haskell programs

Every program is real, working Haskell. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages