Boost logo

Boost :

Subject: Re: [boost] [review] Review of Outcome (starts Fri-19-May)
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2017-05-17 21:42:57


Le 16/05/2017 à 00:48, Niall Douglas via Boost a écrit :
>>> Vicente, when he reviewed Outcome's docs, was pretty appalled at how
>>> error handling focused they are. His view is that Expected is an
>>> EITHER monad where E is exactly like T, and he was not happy that
>>> Outcome presents Expected as if it is solely for use for returning
>>> stuff from functions.
>>>
>>> And, he is right.
>> No, he isn't. The whole point of expected<> is that T is not like E.
>> That's why T is _expected_, and E is _unexpected_. It's in the name.
>>
>> When T is like E, you use variant<T, E>. Or variant<E, T>.
>>
>> My own idea of expected<T, E...> takes one T and an arbitrary amount of
>> Es, and while all Es are alike, T isn't.
>>
>> And this aside, the general idea is to provide alternative to
>> exceptions, which kind of implies returning stuff from functions, does
>> it not?
> As you might guess, Vicente would say that Expected *can* be used for
> returning stuff from functions, but also a long list of other stuff.
>
> But I won't put words in his mouth. He is subscribed here too after all,
> he can answer himself if he chooses to.
Thanks Niall. I can speak for myself.
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk