C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Lack of monadic operations in 'std::expected'

From: Oleksandr Koval <oleksandr.koval.dev_at_[hidden]>
Date: Tue, 18 Oct 2022 21:32:06 +0300
https://wg21.link/P2505

On Tue, Oct 18, 2022 at 9:27 PM Shiroki Satsuki via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> 'std::expected' adds a nice way of handling errors without using the
> exception system and will be included in C++ 23. 'std::optional' is
> going to have monadic operations in this version too.
>
> However, the current 'std::expected' proposal
> (https://wg21.link/p0323r10) makes no mention of monadic operations,
> neither 'transform' (aka 'map') nor 'and_then' (aka 'bind' or
> 'flatMap'). A generic associated types 'rebind<U>' is included, though.
>
> It would be a pity if functional programming lovers must wait until C++
> 26 for a complete 'Either' monad.
>
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>


-- 
Regards,
Oleksandr Koval.

Received on 2022-10-18 18:32:19