> it looks like leaving exceptions does not make a language simpler.
I don't think that this ever was the claim. Rust leaves exceptions out because they make code hard to work with and because it prefers errors be acknowledged. I don't think monadic errors are "simpler" than exceptions.
(Though I suspect they are simpler to teach than exceptions to people who have learned neither)
Once `?` lands in Rust I expect these "gyrations" become much simpler.
> Are we going to see
>
> date.if_weekday(|day| { ... })
>
> and similar cruft for every type? I hope not.
Not sure where this comes from. As the others have mentioned, closures are pretty cheap, but anyway you don't need to use the control flow primitives. There are many ways of dealing with errors, including using `if let`, `match`, `unwrap_or_else`, `try!`, and the upcoming `?`.
I don't think that this ever was the claim. Rust leaves exceptions out because they make code hard to work with and because it prefers errors be acknowledged. I don't think monadic errors are "simpler" than exceptions.
(Though I suspect they are simpler to teach than exceptions to people who have learned neither)
Once `?` lands in Rust I expect these "gyrations" become much simpler.
> Are we going to see > > date.if_weekday(|day| { ... }) > > and similar cruft for every type? I hope not.
Not sure where this comes from. As the others have mentioned, closures are pretty cheap, but anyway you don't need to use the control flow primitives. There are many ways of dealing with errors, including using `if let`, `match`, `unwrap_or_else`, `try!`, and the upcoming `?`.