Boost logo

Boost :

Subject: Re: [boost] Final lightweight monad, next gen futures and upcoming AFIO review
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-06-29 02:37:30


Le 26/06/15 13:00, Niall Douglas a écrit :
> On 26 Jun 2015 at 10:42, Andrzej Krzemienski wrote:
>
>>> monad is now space optimal, consuming as little as two bytes
>>> depending on configuration. monad<void> is now working, plus these
>>> new specialisations were added:
>>>
>>> * result<T>: empty/T/error_code (no exception_ptr).
>> To what run-time condition does an empty state correspond here? I used to
>> thing that you either have a result (T) or a reason why you do not have one
>> (error_code), but what does it mean that you have neither?
> Semantically speaking, after feedback from this list, and having
> attended Charley's C++ Now Presentation on ternary logic programming
> "Your CPU is Binary", I realised that it's worthwhile to formally
> specify future/monad/result as ternary logic primitives with ternary
> logic operators. option<T> remains boolean. This gives the following
> logic table:
>
> Empty => False (future/monad/result/option)
> Errored/Excepted => Indeterminate (future/monad/result)
> Value => True (future/monad/result/option)
The meaning of empty in optional/option and future is not the same. For
the fist is a valid state, for the second is an invalid state.
In addition asynchronous types have an additional state not-ready, e.g.
future can be invalid, not-ready, exceptional or valued.

Vicente


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