Async/Await for the Monadic Programmer
summary
Compares monadic for-comprehensions (Futures, Cats combinators, error handling via MonadError) with C#/Scala-style async/await and Cats Effect IO, showing how async blocks let you start tasks concurrently and await results, how early-return/validation patterns map (or don’t) to monads, and why async/await trades referential transparency for simpler linear code. Demonstrations include translating real Scala code to C# async style, common pitfalls (sequential awaits inside loops) and where each approach actually wins.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:27Seattle
- 0:49Inner Product
- 1:29Perspective
- 2:23C Sharp
- 6:37Outline
- 7:25Monads
- 7:37Four Comprehension
- 9:57Request
- 12:14Local variables
- 12:48Fail fast
- 13:52Fail types
- 14:42Handling errors
- 16:14Early returns
- 17:57Forward comprehension
- 20:35AsyncAwait
- 21:35AsyncAwait Example
- 24:24AsyncAwait Translation
- 25:35Error Handling
- 28:32Validation
- 28:57Await
- 31:23Switching to Await
- 34:57Functional Style
- 35:48Use Cases
- 36:57Local Code
- 37:43Moving on
- 38:01Conclusion
- 40:01References
related talks
44mCAN WE FREE CONCURRENT PROGRAMMING FROM THE MONADIC STYLE
36mAn introduction to monadic structures and functional programming
46mOptimusPrimeT
18mEasy, intuitive, direct-style syntax for Monad-comprehensions!
42mMonix Task: Lazy, Async and Awesome
45mSimplifying Asynchronous Code With Scala Async
27mComputation Expressions in Scala
29mPRACTICAL MONAD TRANSFORMERS
