About This Title

Pages: 100
Published: January 2025
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 2025

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:

  • B1.0 2025/10/02

Contents & Extracts

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

  • Introduction
  • Lazy Evaluation
    • Looking for a Needle in a Stack of Infinities
    • Haskell for Very Full Stack Developers
    • Say Cheese
    • Diving Head First into a Bottomless Pit
    • The Least You Can Possibly Do
    • Do You Even Lift?
  • Syntax and Language Extensions
  • Type Classes
    • Traversing Tuples
    • A Slightly Off-White Hat
    • If At First You Don’t Succeed, Trie, Trie Again
  • The Type System
    • Round Trip Tickets
    • A Grand Un-Unified Theory
    • Non-Functional Dependencies
    • Time Flies Like an Arrow
  • Popular Libraries
    • The Atomic Age
    • Setters, and Other Kinds of Dogs

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 2025

Beta Books: What do I get?

Related Titles:

About This Title

Pages: 100
Published: January 2025
ISBN: 9798888651902
Edition: 1
In Beta