On 28 Jun 2015 at 21:05, Michael Marcin wrote:
I mean: result is like "give me T or it's an error". There is no
empty state. Empty would already be an error state. I'd only understand
empty if it's an async operation that didn't finish already.
What's the state of a default constructed result?
Is it an error state?
Is it empty?
Or is it not default constructible?
In my dirty monad, result<T> (there is no result) is always
default constructed to empty. If you want it constructed to something
else, simply pass that into its constructor. There is also a
make_monad(T/error_code/exception_ptr).
In Rust's Result, there is no default construction. You must
choose either a T or a E at the point of construction, failure to do
so is a compile time error.
Niall
--
ned Productions Limited Consulting
http://www.nedproductions.biz/
http://ie.linkedin.com/in/nialldouglas/