by Tarean · 2y ago · 0 comments
Monads are types that let you build chains of lambdas, so you can mix control flow and variable scoping with the some type-specific logic.
Async IO/streams/optionals are monads. It's no accident that these could be programmed as nested callbacks/nested loops/nested if statements. That's the nested chain of Monad->lambda->Monad->...
Monads work well with syntax sugar (think async/await), and some languages like Haskell can abstract over them in neat ways.
No comments yet.