2 ms·
> Yes Rust has .and_then which is same as >>= (sometimes also called flatMap or bind), but still the syntax isn’t lightweight enough. Rust has try! and ?. The
by amluto 9y ago
> Yes Rust has .and_then which is same as >>= (sometimes also called flatMap or bind), but still the syntax isn’t lightweight enough.
Rust has try! and ?. The latter is quite lightweight.
- kccqzy 9y agoThese are not replacements for >>= because they don’t work with other monads. For example you cannot use try! and ? on lists/vectors.