Basics for Haskells
Haskell basics cover how programs are written as expressions and functions with no mutation. Every value has a type, which GHC usually infers, and type classes such as Eq, Ord and Show define shared behaviour across types. This first unit gives the vocabulary for reading signatures like a -> b -> a.
Stage: Foundations · Part of the Haskell roadmap · Last reviewed 19 November 2026
What to learn in Basics
- Write functions with explicit type signatures and call them in GHCi
- Use guards, pattern matching and where bindings in definitions
- Work with lists, tuples and basic types like Int and String
- Explain what a type class constraint such as Ord a means
- Define a data type and derive Show and Eq for it
Basics interview questions
What does it mean that Haskell functions are pure?
A pure function returns the same result for the same arguments and does nothing else, such as writing to a file or changing a variable. This makes code easier to test and reason about, and lets the compiler optimise safely.
What is a type class in Haskell?
A type class declares a set of operations that types can support, such as Eq for equality or Show for converting to text. A function can require a class constraint, so it works for any type that provides those operations.
Where Basics fits in the Haskell roadmap
Basics belongs to the Foundations stage (intermediate level), which takes about 23 hours. Pure functions.
Other units in this stage
Back to the full Haskell roadmap