Pre-RFC: Catching Functions

The major difference between catch/async/for/etc. and Haskell do notation is that they compose with imperative control flow and with each other; that is not true in Haskell and the number one deal-breaker to "going full monad" in Rust IMO. (Another is that Rust doesn't have HKT and so can't straightforwardly express a Monad trait anyway, let alone base its syntax on one.)

This is an excellent article with more details on this perspective: http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/. The idea is that continuations are a much better building block in an imperative language like Rust, because they offer similar power with better composability.

6 Likes