Home / Search / The Algebra of Code, Volume 1: Explore Set Theory, Abstract Algebra, and Category Theory with Functional Programming
Cover of The Algebra of Code, Volume 1: Explore Set Theory, Abstract Algebra, and Category Theory with Functional Programming
  • ISBN-13 · 9781718501607
  • ISBN-10 · 1718501609
  • Publisher · No Starch Press
  • Format · paperback, 648 pages
  • Published · 2027
  • Language · English

The Algebra of Code, Volume 1: Explore Set Theory, Abstract Algebra, and Category Theory with Functional Programming

Rent this book

Free return shipping included
Total rental price$27.50

Please Note: Rental books are typically used and do not come with any unused access code cards.

Return by 2026-12-08. Prepaid return label included; extend at any point for the difference in price.

Buy from a seller

No copies for sale right now — but you can rent it above.

Check back soon — sellers list new copies every day.

About this book

Discover the mathematics hiding inside the code you already write. Functions, types, composition, data structures. You use these ideas in code every day. Look a little closer and something surprising appears: math. The Algebra of Code teaches functional programming and mathematics together, using F# as a laboratory where you can run abstract ideas and see what they do. You don't need to know F# going in. Part I gets you reading and writing it, and everything you learn carries over to Haskell, OCaml, Scala, and the functional corners of C# and TypeScript. You'll build numbers and sets from scratch, turn algebraic expressions into data structures, write programs that simplify equations, build Boolean logic, and automate pieces of mathematical reasoning. Along the way, familiar programming concepts reveal deeper connections: algebraic data types follow rules that look remarkably like ordinary algebra, and function composition with strong typing leads toward category theory. More than 500 short coding exercises have you implement, test, break, and explore every idea yourself. By the time you reach lambda calculus, rings, and categories, they're structures you've already worked with in code. Volume 1 stands on its own, taking you from functional programming fundamentals through the mathematical ideas that make the deeper connections possible. It is the first of a planned three. For programmers with solid experience who want to understand math at a deeper level. No proofs or advanced math required. The math makes you a better programmer. The programming makes the math make sense.