Advanced Functional Programming with Elixir
Model Behavior, Manage Complexity, and Maximize Maintainability
by: Joseph Koski
| Published | 2026-01-15 |
|---|---|
| Internal code | jkelixir |
| Print status | In Print |
| Pages | 250 |
| User level | Intermediate |
| Keywords | elixir;functional programming;functional programming with elixir;domain-driven design;monoids;monads;composing logic;modeling data;software modeling;composing software patterns;BEAM;erlang;real-world elixir;production-ready elixir; |
| Related titles | Learn Functional Programming with Elixir Books that would be a good follow-up: Domain Modeling Made Functional (one of my favorites) |
| ISBN | 9798888651797 |
| Other ISBN | |
| BISACs | COM051000COM062000COM062000 |
Highlight
Combine advanced functional programming concepts with production-ready Elixir and proven domain-driven design techniques to write cleaner, more thoughtful software. You’ll explore foundational ideas like equality, ordering, predicates, monoids, and monads—then go beyond syntax as you develop intuition for composing logic, modeling behavior, and growing systems. With a focus on maintainable, declarative code over theory, you’ll gain practical, composable patterns you can apply right away.
Description
Get ready to manage crowds, adjust priorities, and keep everyone safe in FunPark, a place that never sits still. Your job is to model that complexity and build the systems that keep everything running smoothly, even as the business team is still figuring out what they want and the experts keep rewriting the rules.
Using core abstractions—equality, ordering, predicates, monoids, and monads—you’ll break problems into small, composable pieces that are both well-behaved and easy to combine. Rather than getting bogged down in theory or formal proofs, you’ll dive into real-world Elixir—using protocols, structs, and pattern matching to express shared behavior across your domain. Along the way, you’ll build the vocabulary and mental models you need to organize complex logic, supported by a production-ready open-source library you can use, extend, and explore in your own projects.
Whether you’re an Elixir developer mastering functional programming or a functional programmer exploring Elixir, you’ll discover how to write code that’s easier to reason about—and create systems that stay understandable, even as they grow.
Contents and Extracts
- Introduction
- How This Book Works
- Who This Book Is For
- Online Resources
- Conventions Used In This Book
- Build FunPark: Model Real-World Data
- Define the Ride Model
- Implement Fast Passes for Priority Access
- Model the Patrons
- Speak the Language
- What We’ve Learned
- Implement Domain-Specific Equality with Protocols
- Polymorphic Equality
- Implement Equality for FunPark Contexts
- Equality Is Contextual excerpt
- Transform Inputs Before Matching
- Harness Equality for Collections
- What We’ve Learned
- Create Flexible Ordering with Protocols
- Define Order with a Protocol
- Implement Order for FunPark Contexts
- Transform Inputs Before Comparison
- Harness Order for Collections
- Reverse the Order
- Reduce Repetitive Code with Macros
- What We’ve Learned
- Combine with Monoids
- Define the Protocol
- Combine Numbers with Sum
- Combine Equality
- Combine Order
- Generalize Maximum
- Manage Complexity
- What We’ve Learned
- Define Logic with Predicates
- Simple Predicates
- Combine Predicates
- Predicates That Span Contexts excerpt
- Compose Multi-Arity Functions with Curry
- Harness Predicates for Collections
- Model the FastPass
- Fold Conditional Logic
- What We’ve Learned
- Compose in Context with Monads
- Build the Monad excerpt
- Model Neutrality with Identity
- What We’ve Learned
- Access Shared Environment with Reader
- Build the Structures
- Monad Behaviors
- Avoid Prop Drilling
- Dependency Injection
- Shared Configuration
- What We Learned
- Manage Absence with Maybe
- Build the Structures
- Fold Branches
- Lift Other Contexts
- Bridge Elixir Patterns
- Define Equality
- Establish Order
- Lift Custom Comparisons
- Model Absence in a Monoid
- Implement the Monadic Behaviors
- Refine Lists
- Filter Within Composition
- What We’ve Learned
- Model Outcomes with Either
- Structure of Either
- Validation
- From Bind to Combine
- Make Errors Explicit
- What We’ve Learned
- Coordinate Tasks with Effect
- Build the Effect
- Deferred Transformation
- Effectful Store
- Maintenance Repository
- Inject Behavior, Not Configuration
- Flip the Logic
- What We’ve Learned
- Answers
- Equality Chapter Answers
- Order Chapter Answers
- Monoid Chapter Answers
- Predicate Chapter Answers