Magical
Haskell.
A new way to think.
A little magic to get you there.
Discover the beauty of functional programming, from the first spark of type theory to building your own AI agents.

Big ideas.
Gentle beginnings.
There’s a beautiful language hiding behind the unfamiliar symbols.
Explore it through playful metaphors, visual explanations, and code you can make your own. Build an intuition for types, learn how programs fit together, and follow those ideas all the way to practical AI.
For curious programmers, Haskell enthusiasts, and anyone who has ever wondered what all the monad fuss is about.
Read the publisher’s overviewFollow your
curiosity.
Thirteen chapters. A path from first principles to programs with a mind of their own.
Full table of contentsSmall functions.
Wonderful things.
01CHAPTERS 01—03Think in types.
Begin with an idea, a little imagination, and the building blocks of a new language.
- Types & functions
- Building new types
- Type & category theory, gently introduced
02CHAPTERS 04—08Find your composition.
Connect small pieces into expressive programs. Put the abstractions to work in a game of blackjack.
- Typeclasses & monoids
- Functors & applicatives
- Composing with monads
- I/O & transformer stacks
- A complete blackjack program
03CHAPTERS 09—13Make it intelligent.
Take functional ideas into AI: from your first chat agent to retrieval and multi-agent systems.
- Getting started with AI
- A terminal chat agent
- An AI framework for the web
- Deeper into Haskell & retrieval
- Multi-agent systems & Arrows
A gentle start. Plenty of room to go deep.
-- Small pieces. New possibilities.
spark :: String -> String
spark idea = idea ++ "!"
wonder :: String -> String
wonder = spark . reverse
-- λ> wonder "lleksaH"
-- "Haskell!"The magic is
in the making.
The book’s companion code is on GitHub. Explore the examples, experiment with an idea, and see where it takes you.
Explore the source codegit clone …/magicalhaskell.gitA little curiosity.
Infinite possibilities.
Let’s make something magical.
Available in paperback, PDF & EPUB.
