About This Title

Pages: 120
Published: January 2026
ISBN: 9798888651902
In Beta

Haskell Brain Teasers

Exercise Your Mind

by Rebecca Skinner

Challenge and exercise your functional programming knowledge by tackling these 20 fun, funky, and functional puzzles on Haskell programming topics such as lazy evaluation, Haskell syntax, type classes, the type system, and popular libraries. Gain new insight into why Haskell is the way it is. Build mind-bending self-referential and circular data structures, unpick the seams of reality with unsafePerformIO, build enhanced DSLs with QualifiedDo, and roll back time with STM. Review or get introduced to Haskell’s common quirks such as the unary minus and pattern guards while mastering newer language features up to GHC 9.12, including linear arrows and Or Patterns.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $14.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

This book is in Beta, final version expected Jan 2026

Beta Books: What do I get?


Employ powerful techniques and recognize common pitfalls as you solve fiendish Haskell puzzles across five different topic areas.

Don’t sleep on the lazy evaluation puzzles: they’ll challenge you to predict the behavior of programs that rely on laziness in unexpected ways. Think syntax and language extensions puzzles should be easy? Think again as you deal with the perversity of the unary minus operator, and puzzles based on new extensions such as QualifiedDo. Prepare to be perplexed with Type Class puzzles on ad hoc polymorphism, deriving strategies, and record fields. Want more? Try mixing classic ambiguous type puzzles with advanced new features like linear types. Want to read and debug more esoteric code and exotic language features? Then take on the Libraries puzzles, designed to challenge beginner and advanced readers as you peer into lenses, step into STM, and test the limits of your understanding with the singletons library.

After trying your hand at each puzzle, read through the solution to get more insight into key Haskell features, and use the references to build a reading list to dive deeper into new areas of the language.

What You Need

To run the puzzles yourself you’ll need a recent (>= 9.12.1) version of GHC and the core libraries. Puzzles that include additional libraries may require specific versions of the libraries. On macOS or Linux machines, you can use nix with the provided flake.nix and flake.lock files to get an appropriate environment with all required software at the correct versions. Windows users should be able to run puzzles by installing the appropriate Windows-native versions of GHC and the required libraries, or by using the nix flake from a Linux virtual machine.

Resources

Releases:

2025/12/18
B6.0
Added final puzzle: “Time Flies Like an Arrow.”
2025/11/27
B5.0
2025/10/27
B3.0
Added new puzzle: “A Very Nice Recipe for Soup” Reorganized some sections as the book moves closer to its final form
2025/10/15
B2.0
Added a puzzle.

Contents & Extracts

Note: Contents and extracts of beta books will change as the book is developed.

Table of Contents

  • Lazy Evaluation
    • Looking for a Needle in a Stack of Infinities
      • Discussion
      • Further Reading
    • Haskell for Very Full Stack Developers
      • Discussion
      • Further Reading
    • Say Cheese
      • Discussion
      • Further Reading
    • Diving Head First into a Bottomless Pit
      • Discussion
      • Further Reading
    • The Least You Can Possibly Do
      • Discussion
      • Further Reading
    • Do You Even Lift?
      • Discussion
      • Further Reading
  • Syntax and Language Extensions
    • Oh Em Dash
      • Discussion
      • Further Reading
    • Playing with Matches
      • Discussion
      • Further Reading
    • Many Roads, One Destination
      • Discussion
      • Further Reading
    • A View of the Future
      • Discussion
      • Further Reading
    • FQDN - Fully Qualified Do Notation
      • Discussion
      • Further Reading
  • Type Classes
    • Traversing Tuples
      • Discussion
      • Further Reading
    • A Slightly Off-White Hat
      • Discussion
      • Further Reading
    • If At First You Don’t Succeed, Trie, Trie Again
      • Discussion
      • Further Reading
    • A Nice Recipe for Soup
      • Discussion
      • Further Reading
    • Field Theory
      • Discussion
  • The Type System
    • Round Trip Tickets
      • Discussion
      • Further Reading
    • A Grand Un-Unified Theory
      • Discussion
      • Further Reading
    • Non-Functional Dependencies
      • Discussion
      • Further Reading
    • Time Flies Like an Arrow

Author

Rebecca Skinner is the author of Effective Haskell, and a software engineer with more than 10 years of experience in Haskell and functional programming across industries including fintech, security, and data science. She currently volunteers as a member of the Haskell.org committee.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $14.95 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

This book is in Beta, final version expected Jan 2026

Beta Books: What do I get?

Related Titles:

About This Title

Pages: 120
Published: January 2026
ISBN: 9798888651902
Edition: 1
In Beta