The biggest problem is borrowing across “
>>=”, which is why
await exist with the underlying immobile generator work: to allow for writing normal borrowing Rust code in an
Second: how do you interpret
?, and other imperitive control operators inside a Monoid context? Third: higher kinded polymorphism doesn’t work cleanly in the existing Rust type system, and the fact that
Mut exist splits everything even more.
Monads are powerful and work great to solve a problem in the lazy thunk boxed world of FP. In the imperative, (implicit-) allocation-averse, eager world of Rust, there are a lot of problems introduced that make the problem a lot more complicated than “just use Monads”.
If you can solve all the problems in the linked twitter thread, I’m sure the community would love to hear it (and honestly, you might be able to convince someone to publish it). Until the day these problems are solved, though, “use Monads” is far from a constructive position to hold until you put a lot of qualifiers on it.