Re:Rust and the Blub Paradox
by steveklabnik on Saturday January 23, 2016 @02:42PM
(#10959721)
The usual implementation of the Either/Option monads already does this though:
and
The end result is still a value of that type. You get the short-circuting behavior as soon as you hit Nothing/Left.
[ Parent
| on HN ]
It only short-circuits to the end of the do block. But once you leave the do block the error isn't propagated anymore.
Re:Rust and the Blub Paradox
by steveklabnik on Saturday January 23, 2016 @03:12PM
(#10959856)
Right. Maybe this is because I tend to write small functions, but the amount of things that end in `Ok(())` especially with IO still makes me think it would be useful.