News for hackers. Stuff that matters.
Re:Announcing Rust 1.13 by saghm on Thursday November 10, 2016 @10:05PM (#12927228)
I think this would actually be more comparable to the Either monad. Also, "without extra syntax or macros" is kind of a trivial distinction, as `>>=` is just a function, not some sort of magic.

That being said, I really wish there were some sort of equivalent of `try` or `?` for options in Rust. I don't feel like I want monads in Rust in general, but when dealing with options, I definitely miss the Maybe monad.

Re:Announcing Rust 1.13 by jstimpfle on Thursday November 10, 2016 @10:25PM (#12927364)
"extra syntax or macros" refers to OP's example of "?". That ">>=" is not magic is exactly what I said (meant to say).
Re:Announcing Rust 1.13 by saghm on Friday November 11, 2016 @12:24AM (#12928187)
I guess I'm not seeing why having a function rather than a macro is really that much of a distinction in this case. Either way, it's essentially just a namespaced block of code that compiles down to an AST fragment; I don't think the facts that one of them uses the stack and that they're compiled at slightly different times really make much of a difference here.
Re:Announcing Rust 1.13 by neikos on Friday November 11, 2016 @04:17AM (#12929137)
If you don't mind unstable you can implement it yourself for Option. https://doc.rust-lang.org/src/core/up/src/libcore/ops.rs.htm...

I am sure it will come soon (tm) though

Re:Announcing Rust 1.13 by saghm on Friday November 11, 2016 @08:35PM (#12936041)
I usually just implement a `try_option` macro, which works well enough. I just wish it were a built-in thing in the language, as I don't like having to implement it for every new project, but I really don't want to include an external crate just for one macro.