Learn Haskell the functional way: pure functions, pattern matching, recursion and lists, from your first putStrLn to a small project.
8 lessons, 16 exercises. Runs Haskell GHC 9.12.
Not started
Hello, output
Write a Haskell program with a main action, print text with putStrLn, putStr and print, and add comments.
Values and names
Give names to values with top-level definitions, let and where, meet Haskell's basic types, and build text with show and ++.
Reading input and arithmetic
Read lines with getLine and readLn, turn text into numbers with read, and do arithmetic with div, mod and friends.
Making decisions
Choose between values with if-then-else, guards and case, using comparison and boolean operators.
Repetition without loops
Repeat work the Haskell way, with list ranges, mapM_, recursion, and takeWhile to stop early.
Functions
Define functions with type signatures, several parameters and pattern matching, and see how currying, where and recursion fit together.
Lists, tuples and lookups
Work with lists using map, filter and folds, pair values in tuples, and look things up in association lists.
Strings and a small project
Treat strings as lists of characters, transform them with Data.Char and list functions, then build a small grade report program.
Your progress is saved in this browser. Sign in to keep it on every device.