220 10931 <2524692.K0qNjsgtn9@drako> article
Path: news.gmane.org!not-for-mail
From: Ivan =?utf-8?B?xIx1a2nEhw==?= <ivan.cukic@yandex.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: N4015: A proposal to add a utility class to
 represent expected monad
Date: Wed, 28 May 2014 23:10:06 +0200
Organization: KDE
Lines: 52
Approved: news@gmane.org
Message-ID: <2524692.K0qNjsgtn9@drako>
References: <94ded66f-1c50-47b9-8a04-b83805443da9@isocpp.org> <1534916.IcxgtEDE2B@drako> <5384FDF2.6060904@hyc.io>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1401311417 21070 80.91.229.3 (28 May 2014 21:10:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 28 May 2014 21:10:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC7PT47XTQNRBMNBTGOAKGQELBXX4FA@isocpp.org Wed May 28 23:10:12 2014
Return-path: <std-proposals+bncBC7PT47XTQNRBMNBTGOAKGQELBXX4FA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f200.google.com ([209.85.212.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC7PT47XTQNRBMNBTGOAKGQELBXX4FA@isocpp.org>)
	id 1Wpl6w-00028D-Lm
	for gclcip-std-proposals@m.gmane.org; Wed, 28 May 2014 23:10:10 +0200
Original-Received: by mail-wi0-f200.google.com with SMTP id r20sf2086138wiv.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 May 2014 14:10:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:organization
         :user-agent:in-reply-to:references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=ABYURWaJnuFqlSguczjYHfWT39mrqdX5lIL0LNZ8keI=;
        b=Rny3BPPkf5d/DczvehtAB22izUuakNsbY1OEZ6qYYkwpcZguUJ+hvpvxARtyAbMsN7
         lxVUTc/GvB/mL6dQb1oIk7Ah+D1dAk5XNXiGzNstfAjc2CuW1uVxiKKDvU6IhYwjW3+y
         Zt8Xv1WCctjitZhfWfolRY46NVj8jl6x0B6jknvYCfbkNT4uFYXFESacuDvCsC3YE/ld
         gCC9PoXYs2O/5sFKI6psIuZEUaCuZ+czvGQ2xvQA0dEYcuJobCRZg/bHDY6LNIMO4lk4
         vXrjYrFHoLjX78mbdavd48oebMo4BKn8HX6zDdxfrBPEMQ3M0VWxSoH4X+40gK6VLBw8
         dW8w==
X-Gm-Message-State: ALoCoQmAwa5mAj5TOuJL/BXZUUQTjRT3WRDm7exozYeI8Z7hgh1tdtYnURR3VY5FUrx3A/eHXu3I
X-Received: by 10.180.207.42 with SMTP id lt10mr3768609wic.6.1401311410373;
        Wed, 28 May 2014 14:10:10 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.4.106 with SMTP id j10ls75640laj.31.gmail; Wed, 28 May
 2014 14:10:09 -0700 (PDT)
X-Received: by 10.112.255.10 with SMTP id am10mr2212410lbd.54.1401311408979;
        Wed, 28 May 2014 14:10:08 -0700 (PDT)
Original-Received: from forward7l.mail.yandex.net (forward7l.mail.yandex.net. [2a02:6b8:0:1819::7])
        by mx.google.com with ESMTPS id tt10si45722145lbb.30.2014.05.28.14.10.08
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 28 May 2014 14:10:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of ivan.cukic@yandex.com designates 2a02:6b8:0:1819::7 as permitted sender) client-ip=2a02:6b8:0:1819::7;
Original-Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [37.140.190.28])
	by forward7l.mail.yandex.net (Yandex) with ESMTP id 477F3BC024C
	for <std-proposals@isocpp.org>; Thu, 29 May 2014 01:10:08 +0400 (MSK)
Original-Received: from smtp3o.mail.yandex.net (localhost [127.0.0.1])
	by smtp3o.mail.yandex.net (Yandex) with ESMTP id F10181E18F7
	for <std-proposals@isocpp.org>; Thu, 29 May 2014 01:10:07 +0400 (MSK)
Original-Received: from cable-178-148-120-90.dynamic.sbb.rs (cable-178-148-120-90.dynamic.sbb.rs [178.148.120.90])
	by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id l7VxhNurpk-A7pihnvk;
	Thu, 29 May 2014 01:10:07 +0400
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(Client certificate not present)
X-Yandex-Uniq: be5a3b58-14f3-49f1-8626-7b6cdc6fbbc9
User-Agent: KMail/4.13.1 (Linux/3.14-1-amd64; KDE/4.13.1; x86_64; git-e3b1eb8; 2014-05-17)
In-Reply-To: <5384FDF2.6060904@hyc.io>
X-Original-Sender: ivan.cukic@yandex.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ivan.cukic@yandex.com designates 2a02:6b8:0:1819::7 as permitted
 sender) smtp.mail=ivan.cukic@yandex.com;       dkim=pass header.i=@yandex.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:10931
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10931>

Hi Pierre,

> First of all, thank you for the feedback.

Thank you for the proposal - I'd love to see a few more functional parts like 
this in STL.

> std::exception_ptr being the default type for E might not be a good
> idea. Exceptions are a way to handle error but expected is another. The

Well, integer error codes vs typed errors... I guess we could start a holy war 
over this :)

> This is true, however in practice I suspect that users will use a type
> definition on expected with their own error type:
> 
> template <class T>
> using expectation = expected<error_condition, T>;
> 
> We get back our "happy path" :-)

Yes, I guess that will become a new common idiom. Honestly, I'm not overly 
happy about STL things needing a typedef/using to make them useful, but yes, 
this would be ok.

> IMHO, we didn't use fancy names neither we invented any :-) map and bind

I agree map/fmap/bind are already established names, but outside of C++. This 
remark was not aimed for this proposal per se, but more of a general worry 
that we started introducing monads into C++ without predefining the common 
terminology.

> Note that we add a syntax for a do-notation like in the section 7.1.

Yes, saw that. That is one of the things I'd put in a separate proposal - I'm 
guessing it will receive more resistance than just the expected<...> template.

Cheerio,
Ivan


KDE, ivan.cukic at kde.org, http://ivan.fomentgroup.org/ 
gpg key id: 850B6F76, keyserver.pgp.com

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
