Skip to main content

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

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.

Back to the full Haskell roadmap