Books

8 Best Haskell Books in 2026: Beginner to Advanced

This post contains affiliate links. If you buy through them, we may earn a small commission at no extra cost to you. Learn more.

Programming in Haskell by Graham Hutton is the Haskell book to start with. Its second edition was updated for the Applicative, Foldable and Traversable changes that current compilers enforce. Add Effective Haskell or Haskell in Depth once you want to build real programs.

Original content from computingforgeeks.com - post 182553

The catch with Haskell books is age. Several well-known Haskell books predate changes that now stop their code at compile time, so we built the published example code for six of these eight books instead of trusting the cover. We checked those builds in November 2026 on Ubuntu 24.04 with GHC 9.10.3, the version GHCup recommends, and on GHC 9.14.1 wherever a dependency bound looked tight.

Which Haskell book should you buy first?

Choose by what you already know rather than by reputation, because the age of a Haskell book matters more than its fame. Each line below matches a reader to the book we would hand them:

  • You want one careful book that teaches the language properly: Programming in Haskell, Second Edition.
  • You already write code for a living and want to ship Haskell: Effective Haskell.
  • You want short lessons and a gentle pace: Get Programming with Haskell.
  • You learn best by building projects: Learn Haskell by Example.
  • You know the basics and need advanced types, libraries and project setup: Haskell in Depth.
  • Your team is about to run Haskell in production: Production Haskell.
  • You need parallelism, threads and STM: Parallel and Concurrent Programming in Haskell.
  • You want a fun read and can live with dated code: Learn You a Haskell for Great Good!, which is also free online.

For most people the pair that covers the most ground is Hutton for the fundamentals and Effective Haskell for building things. If you came from Java, C# or Python and dislike textbooks, swap Hutton for Learn Haskell by Example, which teaches through nine projects instead of chapters of theory.

How do the eight Haskell books compare?

The “code today” column is our own result from building each book’s published example code on the current toolchain, where a book has code we could build. It tells you how much setup friction to expect before you reach chapter one:

BookBest forCode today (GHC 9.10.3)PagesPublished
Programming in Haskell, 2nd ed.First bookFiles we tried compile, one partial-function warning3202016
Effective HaskellWorking programmersTwo projects build, hcat needs three cabal edits6702023
Get Programming with HaskellGentle startOfficial code zip, not built6162018
Learn Haskell by ExampleProject learnersBuilds with stack, pinned to GHC 9.4.74562024
Haskell in DepthIntermediate to advancedBuilds with no errors6642021
Production HaskellTeams in industryNo code repo4302023
Parallel and Concurrent Programming in HaskellConcurrency and parallelismBuilds on 9.10.3, solver fails on 9.14.13192013
Learn You a Haskell for Great Good!A light first readMonad and Writer examples fail4002011

Page counts and dates come from the Amazon catalog for the print edition. Prices ran from about $27 to $60 on November 1, and four of the eight listings showed limited stock. Check the current price and the seller before you order, because a third-party seller can charge well over list.

Does code from older Haskell books still compile?

Not always. Two library and language changes hit books written before GHC 7.10 hardest. Since that release, every Monad must also be an Applicative, as the Functor-Applicative-Monad Proposal describes. The transformers library also defines Writer as a type synonym over WriterT, so the Writer data constructor a 2011 book uses is gone.

We took two examples from Learn You a Haskell’s “For a Few Monads More” chapter to see the effect. You need GHC and cabal for this test, so run the setup steps at the end of this guide first. Then make a folder and install the mtl library into a local package environment:

mkdir ~/lyah && cd ~/lyah
cabal install --lib mtl --package-env . --overwrite-policy=always

Create the test file:

vim OldBook.hs

Paste this code. It defines a probability monad with only Functor and Monad instances and builds a Writer value with the old constructor, as the book does. We left out one line of the book’s Monad instance, fail _ = Prob [], because current GHC no longer has fail in the Monad class, so a faithful copy is rejected at that line first and never reaches the two errors below:

import Data.Ratio
import Control.Monad.Writer

newtype Prob a = Prob { getProb :: [(a, Rational)] } deriving Show

instance Functor Prob where
    fmap f (Prob xs) = Prob $ map (\(x,p) -> (f x,p)) xs

flatten :: Prob (Prob a) -> Prob a
flatten (Prob xs) = Prob $ concat $ map multAll xs
    where multAll (Prob innerxs,p) = map (\(x,r) -> (x,p*r)) innerxs

instance Monad Prob where
    return x = Prob [(x,1%1)]
    m >>= f = flatten (fmap f m)

logNumber :: Int -> Writer [String] Int
logNumber x = Writer (x, ["Got number: " ++ show x])

main :: IO ()
main = print (fst (runWriter (logNumber 3)))

Compile it with GHC:

ghc OldBook.hs

GHC 9.10.3 stops with two errors, one for each change. The second one even suggests the fix, the lowercase writer function:

GHC 9.10.3 rejecting Learn You a Haskell code with No instance for Applicative Prob and Illegal term-level use of Writer

Both errors are quick to fix once you know the pattern. Add an Applicative instance, move return into it as pure, and swap the constructor for the function. This is the exact diff we applied:

--- OldBook.hs.orig
+++ OldBook.hs
@@ -1,5 +1,6 @@
 import Data.Ratio
 import Control.Monad.Writer
+import Control.Monad (ap)

 newtype Prob a = Prob { getProb :: [(a, Rational)] } deriving Show

@@ -10,12 +11,15 @@
 flatten (Prob xs) = Prob $ concat $ map multAll xs
     where multAll (Prob innerxs,p) = map (\(x,r) -> (x,p*r)) innerxs

+instance Applicative Prob where
+    pure x = Prob [(x,1%1)]
+    (<*>) = ap
+
 instance Monad Prob where
-    return x = Prob [(x,1%1)]
     m >>= f = flatten (fmap f m)

 logNumber :: Int -> Writer [String] Int
-logNumber x = Writer (x, ["Got number: " ++ show x])
+logNumber x = writer (x, ["Got number: " ++ show x])

 main :: IO ()
 main = print (fst (runWriter (logNumber 3)))

With those edits the file compiles under -Wall with no warnings, and the program prints the logged number:

Fixed Learn You a Haskell example compiling with ghc -Wall on GHC 9.10.3 and printing 3

An experienced Haskeller fixes this in a minute. A beginner who copies the book faithfully hits an error message about superclasses before they know what a superclass is, and that is where many people give up on Haskell. The Applicative error comes from a language change made after the book went to print, while the Writer one is older: mtl 2.0 dropped the constructor in October 2010. Either way, you cannot tell that from the cover or the reviews. That is why the older books sit lower in this list, and why we built the code before ranking anything.

1. Programming in Haskell, Second Edition

Graham Hutton is a professor at the University of Nottingham, and the book grew out of his more than 20 years of teaching Haskell. It assumes no programming experience at all.

Programming in Haskell Second Edition by Graham Hutton book cover
Programming in Haskell, Second Edition by Graham Hutton. Image: Cambridge University Press.

The author page for the book says the second edition is fully compliant with the current language, including the changes to applicative, monadic, foldable and traversable types. Part I covers pure programming and Part II moves to effects and more advanced topics, with exercises after every chapter. At 320 pages it is also one of the shorter books here.

Hutton also publishes lecture videos, slides and the example code for free. We downloaded the code archive from his site and ran the parser library, the calculator and the countdown solver on GHC 9.10.3:

Graham Hutton Programming in Haskell Parsing.hs, calculator and countdown code running on GHC 9.10.3

Every file we tried compiled, the parser returned the expected results, and the countdown solver found 780 solutions for the classic 765 puzzle. The only message was a -Wx-partial warning about head in the tic-tac-toe program, a warning recent GHC releases print for partial list functions. It does not stop the build.

The code is plain source files with no build project, so there is nothing to configure. After unzipping the archive, check these three things before the parsing chapter:

  • ghc -c Parsing.hs finishes with no errors.
  • ghc -e 'parse (some digit) "123abc"' Parsing.hs prints [("123","abc")].
  • ghc -e 'parse expr "2*3+4"' calculator.hs prints [(10,"")].

Look elsewhere if you want projects with databases, web servers or JSON. Hutton stays close to the language itself, so you finish knowing how Haskell works but not how to structure an application with a build file, libraries and tests. That gap is easy to fill later with Effective Haskell, so do not let it put you off as a first book. It ran about $27, well under its list price, which makes it the cheapest strong book in the list.

2. Effective Haskell

Rebecca Skinner wrote this one for developers who want to use Haskell for real work, not only learn it. The Pragmatic Bookshelf published it in August 2023.

Effective Haskell by Rebecca Skinner book cover
Effective Haskell by Rebecca Skinner. Image: The Pragmatic Bookshelf.

The publisher lists monad transformers, type families and GADTs, concurrency, databases, REST services and performance tuning, with exercises in every chapter. The book expects you to install the toolchain with GHCup, the same route we used. If you write Go, Java or Python today, this is the book that shows you what a Haskell service looks like end to end.

The source code download from Pragmatic holds three cabal projects. Two of them, args-demo and misc-examples, built on GHC 9.10.3 as published. The third, hcat, failed to parse at all, because its test suite lists a module named fizz in lowercase:

Effective Haskell hcat cabal file parse errors and the cabal-version and build-type fixes that let it build on GHC 9.10.3

Deleting that line exposed a second problem. The file declares cabal-version: >=1.10 with no build-type, so cabal 3.16 asks for an ancient Cabal library to run its setup script. These three edits got the hcat executable building:

  1. Delete the other-modules: fizz line from hcat.cabal.
  2. Change cabal-version: >=1.10 to cabal-version: 2.0.
  3. Add build-type: Simple under it, then run cabal build exe:hcat and confirm it links.

The hcat project’s stack.yaml still points at the old lts-11.16 snapshot, so build with cabal rather than stack. We stopped at a clean build: running the binary on a test file printed an error, so treat the zip as a reference and type the chapter’s code yourself. Pass on this book if you have never programmed before, because it moves fast and assumes you know why types matter. For an experienced developer that pace is the point: it reaches transformers, type families and a working service in one volume, which would take two or three of the other books here. It ran about $50 to $55 with limited stock.

3. Get Programming with Haskell

Will Kurt split this book into 42 short lessons for readers who know at least one other language. It is the slowest and friendliest route in the list.

Get Programming with Haskell by Will Kurt book cover
Get Programming with Haskell by Will Kurt. Image: Manning.

Manning groups the lessons into units on thinking in Haskell, functional basics, programming in types and real-world work such as I/O, random numbers and databases. Each lesson is short enough to finish in one sitting, which suits a learner with an hour in the evening better than Hutton’s denser chapters.

Manning publishes the official code as a zip from the book page. It holds plain .hs files for the early units and stack projects for units 6 and 7, all pinned to lts-7 Stackage snapshots, with files dated 2016 and 2017. We downloaded it but did not build it, so expect those old snapshots to need bumping on a current toolchain. The first lesson also sets you up with the Haskell Platform, while haskell.org now names GHCup as its main installer. Install with GHCup as shown at the end of this guide and ignore that part of lesson one.

Pick something else if you want depth, since the gentle pace means fewer advanced topics in 616 pages. It ran about $40 to $45 with limited stock.

4. Learn Haskell by Example

Philipp Hagenlocher, who made the “Haskell for Imperative Programmers” video course, wrote the newest book in this list. Manning released it in late 2024.

Learn Haskell by Example by Philipp Hagenlocher book cover
Learn Haskell by Example by Philipp Hagenlocher. Image: Manning.

The book builds nine projects across 17 chapters, including a small language for music and an image processing library. It is aimed at programmers who know an object-oriented language, and it teaches laziness, immutable data and monads as they come up in the projects rather than up front.

The official repository has eleven stack projects, and every one pins the same lts-21.12 snapshot. When we built the line-numbering project from chapters 3 and 4, stack downloaded its own GHC 9.4.7 next to our 9.10.3 and built cleanly:

Learn Haskell by Example lnums project built with stack using resolver lts-21.12 and GHC 9.4.7

That pin is good news for a learner, since the code builds exactly as the author tested it. The cost is a compiler download of about 170 MiB on first build, and more disk once it unpacks. The repository also ships a Dockerfile, and the README explains how to use it if you would rather not install anything locally.

Before you start a chapter project, confirm the stack side works, because every later chapter uses the same snapshot:

  • The project’s stack.yaml shows resolver: lts-21.12.
  • The first stack build ends with a “Registering library” line and no errors.
  • stack exec -- ghc --version reports 9.4.7, not your system GHC.

Choose a different book if you want a reference to look things up in, because the material is organised around projects, not topics. It ran about $45 to $50, below its $60 list price.

5. Haskell in Depth

Vitaly Bragilevsky served on the GHC Steering Committee from 2018 to 2022, and Simon Peyton Jones wrote the foreword. This is the book for your second year of Haskell.

Haskell in Depth by Vitaly Bragilevsky book cover
Haskell in Depth by Vitaly Bragilevsky. Image: Manning.

Manning describes it as covering web services and networking, the lens, singletons and servant libraries, project organisation with Cabal and Stack, error handling, testing and pure parallelism, plus advanced types and concurrency. It assumes you already know the basics from a book like Hutton’s.

Its example repository is kept current. The cabal build follows the newest compatible libraries, helped by a cabal.project.local that relaxes a few bounds, rather than the lts-22.17 snapshot its stack.yaml pins. The last commit, from April 2025, reads “Fix builds for GHC 9.10+”, and the whole project built on GHC 9.10.3 with no errors:

Haskell in Depth hid-examples repository building with cabal build all on GHC 9.10.3

Plan for a long first build. The examples pull in a few hundred dependencies, including charting and web libraries, and cabal build all took about 21 minutes on our 4 vCPU VM while another build ran next to it. Later builds reuse the cache, so only the first one is slow.

Leave it for later if Haskell is new to you, because the early chapters move quickly through what other books spend a hundred pages on. It ran about $60 with no discount shown on Amazon, the most expensive book in this list.

6. Production Haskell

Matt Parsons wrote this for people who want to write Haskell in industry. It is less about the language and more about running it on a team.

Production Haskell Succeeding in Industry with Haskell by Matt Parsons book cover
Production Haskell: Succeeding in Industry with Haskell by Matt Parsons. Image: Matt Parsons.

The Leanpub page says the book covers technical topics such as Template Haskell and type-level programming alongside the social and engineering side of a Haskell project. That second half is rare. Most Haskell books stop at “it compiles”, and this one asks whether your colleagues can maintain it.

It is self-published, so the Amazon paperback has a B0 ASIN, which Amazon assigns to books on the newer 979 ISBN prefix. The ebook is sold separately on Leanpub. There is no companion code to build, so we only checked the listing.

Skip this book as a learning text, since it assumes you can already write Haskell. It ran about $30 to $35 for the paperback.

7. Parallel and Concurrent Programming in Haskell

Simon Marlow built much of GHC’s parallel runtime, and this 2013 O’Reilly book is still the reference on threads, parallelism and STM in Haskell.

Parallel and Concurrent Programming in Haskell by Simon Marlow book cover
Parallel and Concurrent Programming in Haskell by Simon Marlow. Image: O’Reilly Media.

The example repository shows the range: a parallel Sudoku solver, channels, STM queues such as TChan and TBQueue, an Async library and distributed chat programs. Community pull requests keep it alive, and the latest merge, in May 2025, added GHC 9.10 support. It built on GHC 9.10.3 in about three minutes.

Then we pointed the same code at GHC 9.14.1, the series GHCup tags as latest. The solver refused, because the package caps base below 4.22 and template-haskell below 2.24, the versions that compiler ships:

parconc-examples building on GHC 9.10.3 but failing the cabal solver on GHC 9.14.1 because of base and template-haskell bounds

Relaxing only base moved the failure to template-haskell, so the simple answer is to stay on the GHC GHCup recommends. Bounds like these only move when someone tests the package on the new compiler and raises them, and for a repository kept alive by volunteer pull requests that can take months. That lesson applies to every book here, and it is the cheapest fix in this guide: install the recommended compiler, not the newest one, and the example code is far more likely to build.

Pass on it while you are still learning the language, because it assumes you read Haskell comfortably. The examples still build on the recommended GHC, which is good evidence that the core material has aged well. It ran about $35 to $40 with limited stock.

8. Learn You a Haskell for Great Good!

Miran Lipovača’s illustrated book from 2011 is the oldest in this list, and its free online edition keeps it in front of new learners.

Learn You a Haskell for Great Good by Miran Lipovaca book cover
Learn You a Haskell for Great Good! by Miran Lipovača. Image: No Starch Press.

The writing is relaxed and funny, and the early chapters on types, recursion and higher-order functions explain the ideas as well as any book here. The later monad chapters are where the age shows, as our test above found. Those are exactly the chapters a learner reaches when the material gets hard.

You can read it free before you buy. A community fork at learnyouahaskell.github.io carries the full text under a Creative Commons licence, maintained with the author’s blessing, and its maintainers say some content is outdated. Buy the print copy if you like reading on paper or want to support the author, not for newer code.

Pass on the print edition if it is your only book. Pair it with Hutton, who covers the same ground with code that compiles. It ran about $40 with limited stock.

Which Haskell books can you read for free?

Haskell has an unusual amount of good free material, and one of the best known paid books is not on Amazon at all. Before spending money, know what each option gives you:

  • Learn You a Haskell is free online through the community fork, with the monad chapters still in their 2011 form.
  • Real World Haskell from 2008 was published free online under a Creative Commons licence, and its 28 chapters include monad transformers, concurrency and STM. Its book site no longer resolves, but the Internet Archive copy still reads fine.
  • Haskell Programming from First Principles by Christopher Allen and Julie Moronuki is not free, but it is sold only as a $59 digital book through Lorepub, whose print run has sold out, so you will not find a new copy on Amazon.
  • Hutton’s lecture videos, slides and example code for Programming in Haskell are free on his site.

Free material works for a first look, but it ages without anyone fixing the code, because nobody is paid to chase each compiler release. Our Learn You a Haskell test showed what that costs a beginner. A current paid book plus Hutton’s free lectures is the cheapest route that avoids those compile errors, and it still costs less than one of the advanced books on its own.

What should you check before buying a Haskell book?

Amazon search mixes these titles with very cheap self-published Haskell books that list no publisher, and with used copies of editions older than the ones above. A few minutes on the listing and in the code repository tells you whether the book matches the compiler you will install:

  • The listing shows the publisher and edition from the table above, such as the Second Edition of Programming in Haskell.
  • The book was published after 2015, or its code defines an Applicative instance for every Monad.
  • The companion repository has a commit from the last two years, or at least a tag for the printed book.
  • The stack.yaml snapshot or tested-with line names a GHC close to the one GHCup recommends.

Haskell sits close to Scala in spirit, and our Scala books guide runs the same code tests on the JVM side. If you are weighing functional against class-based design, the object-oriented programming books make a useful contrast. The wider list of programming books covers other languages, our C and C++ books guide helps when you reach Haskell’s FFI chapters, and a Linux laptop for programming gives GHC the RAM those long first builds want.

How do you set up GHC to follow along with a Haskell book?

Install GHCup, the main installer on haskell.org, and let it pick the recommended GHC, cabal and stack. We used these steps on Ubuntu 24.04, and the GHCup page gives the same bootstrap command for WSL2 on Windows:

  1. Install the build dependencies from the distribution packages.
  2. Run the GHCup bootstrap script as your normal user, not root.
  3. Load the GHCup environment and confirm GHC reports the recommended version.

Start with the compiler toolchain and libraries GHC links against:

sudo apt-get update && sudo apt-get install -y build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev pkg-config zlib1g-dev git unzip

Then run the bootstrap script. Non-interactive mode installs GHC, cabal and stack without prompts, and the no-stack-hook setting keeps stack’s default behaviour of installing each project’s pinned GHC under ~/.stack:

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 sh

Non-interactive mode does not edit ~/.bashrc, so run source ~/.ghcup/env in every new shell or add that line to ~/.bashrc yourself. Load it now and list what was installed:

source ~/.ghcup/env
ghcup list -c installed -r
ghcup list -t ghc -c available -r | grep -E "recommended|latest|installed"
ghc --version
cabal --version

Our run installed GHC 9.10.3 tagged as recommended, with cabal 3.16.1.0 and stack 3.11.1, while GHC 9.14.1 showed up as latest but not installed:

ghcup list showing GHC 9.10.3 recommended and GHC 9.14.1 latest with cabal 3.16.1.0 on Ubuntu 24.04

Keep that recommended compiler as your default. Haskell in Depth, Programming in Haskell and Parallel and Concurrent Programming all built on it, and a stack project such as Learn Haskell by Example fetches its own pinned GHC anyway. Move to a newer GHC only when the book’s repository says it supports one.

Keep reading

Best Machine Learning Books (2026): Textbooks, Python, Free PDFs AI Best Machine Learning Books (2026): Textbooks, Python, Free PDFs Best C++ and C Programming Books for 2026: Beginner to Advanced Books Best C++ and C Programming Books for 2026: Beginner to Advanced Best System Design Books for Interviews and Architecture in 2026 Books Best System Design Books for Interviews and Architecture in 2026 Best OpenShift Books for Admins and EX280 Candidates Books Best OpenShift Books for Admins and EX280 Candidates Best API Design Books: REST, gRPC and GraphQL Books Best API Design Books: REST, gRPC and GraphQL 9 Best Object-Oriented Programming and Design Patterns Books Books 9 Best Object-Oriented Programming and Design Patterns Books

Leave a Comment

Press ESC to close