3 ms·
So there's this talk https://fsharpforfunandprofit.com/posts/recipe-part2/ https://fsharpforfunandprofit.com/posts/recipe-part2/ that pops up here every now and
by Avshalom 7y ago
So there's this talk https://fsharpforfunandprofit.com/posts/recipe-part2/ https://fsharpforfunandprofit.com/posts/recipe-part2/ that pops up here every now and then. In it he builds these monads to allow for functions that may or may not throw errors or care about thrown errors etc. Similarly IO monads in Haskell and Mercury are often described as secretly threading the entire world through the monad and returning an entirely new world thus allowing for side effects in purely functional code.
In a stack based language those aren't interesting ideas, they're just naturally emergent.
The other thing is that it makes it utterly trivial to pull out or insert code in a function. allowing for some radical refactoring.