Get value out of your monad
summary
Argues that the right answer to “how do I get the value out of my monad” is to stop extracting values and inject behavior into the monad, using C# examples: Lazy, Task, LINQ Select, Maybe/Option and a reservation example that moves DB reads/writes to the boundary (hexagonal ports/adapters). Demonstrates implementing select many/flatten for nested monads so domain code stays synchronous and pure while the controller handles Task and DB side effects, producing working async endpoints without leaking Task into core logic.
AI-written summary · about
chapters (19)
- 0:00Start
- 1:35How Do I Combine Dependency Injection with a Sink and a Weight without Leaky Abstractions
- 1:56A Restaurant Reservation System
- 2:57Core Logic
- 5:36Domain Driven Design
- 13:02The Xy Problem
- 14:00How Do I Get the Value out of My Monad
- 14:47Structure Preserving Projection
- 15:21Apply a Function to each Element in a Collection
- 19:10Select Method
- 22:13Query Syntax
- 22:48What a Monad Is
- 29:06Generic Type Constraints
- 35:07Create a Contract
- 40:44Projection Function
- 41:39Move the Impure Operations to the Boundary of the System
- 42:04Port and Adapters
- 43:28Repository Create
- 53:06Compiler Warning
related talks
32mDiscussion: Are Free Monads Really Free?
42mMonads you already use without knowing it
01h 01mAsync injection
39mDemystifying Monads with Java
01h 01mAsync injection
36mAn introduction to monadic structures and functional programming
01h 02mAsync injection
18mEasy, intuitive, direct-style syntax for Monad-comprehensions!
