4 ms·
It's a monad in Rust too (with Some being return, and and_then[1] being >>=). Rust's generics just aren't yet[2] flexible enough to abstract over monads within
by aweinstock 10y ago
It's a monad in Rust too (with Some being return, and and_then[1] being >>=). Rust's generics just aren't yet[2] flexible enough to abstract over monads within the language.
[1] https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then https://doc.rust-lang.org/std/option/enum.Option.html#method...
[2] https://github.com/rust-lang/rfcs/issues/324 https://github.com/rust-lang/rfcs/issues/324