Idiomatic Monads in Rust
In particular, this approach avoids the need for either higher-kinded types (e.g. as in this design) or full abstraction over traits (e.g. “traits for traits”). In particular, the design is significantly influenced by several quirks found in the Rust type system that will be unobvious to those who have not already come across them. The traits are the correct way to abstract over functions in Rust: there’s no single function type constructor .
Source: varkor.github.io