From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 121F6801D7 for ; Tue, 24 Oct 2017 13:17:23 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-qt0-f172.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.216.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.216.172 as permitted sender) identity=mailfrom; client-ip=209.85.216.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qt0-f172.google.com) identity=helo; client-ip=209.85.216.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-qt0-f172.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AWaaMqRcsbWD1OK3GK9vrLGVrlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc2ybR7h7PlgxGXEQZ/co6odzbGJ4+a9ASQp2tWojjMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQgpBw7nOAFp?= =?us-ascii?q?CuPwE4/Ux4TrhqHhs6HUNj5wzG6meZt1Nh+3sQzVuM4Gx4BlL/Bi5AHOpy5ncu?= =?us-ascii?q?5MxG5sbWmYnxvm6934qJFq+T5RtvZn7MVAXL/3ZYw3SLVZCHItNGVjt56jjgXK?= =?us-ascii?q?UQbavihUaW4RiBcdX1nI?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D2AAAdIO9ZhqzYVdFcHAEBBAEBCgEBF?= =?us-ascii?q?QEBAQECAQEBAQgBAQEBhBhuJweDc4E2miqCUYZqjH+CEQojhAMBgRQChFgHQRY?= =?us-ascii?q?BAQEBAQEBAQEBARIBAQEICwsIKC+COAUDBB6COwEBAQECASMdARsSCwEDAQsGB?= =?us-ascii?q?QQHDQ0dAgIiAREBBQEKEgYTEol1AQMNCBCaSUCMDIIFBQEcgwkFg2sKGScDCli?= =?us-ascii?q?CewEBAQEGAQEBAQEBARkCBhKDHIIHgVCFE4RpSYJngmEFiDcMkDCIeoIvhTaNE?= =?us-ascii?q?IJykDKVaxQFH4EVDxcKggI0ISVeNYIvCYIaKh+BdT42iXaBQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0D2AAAdIO9ZhqzYVdFcHAEBBAEBCgEBFQEBAQECAQEBAQg?= =?us-ascii?q?BAQEBhBhuJweDc4E2miqCUYZqjH+CEQojhAMBgRQChFgHQRYBAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEICwsIKC+COAUDBB6COwEBAQECASMdARsSCwEDAQsGBQQHDQ0dAgIiARE?= =?us-ascii?q?BBQEKEgYTEol1AQMNCBCaSUCMDIIFBQEcgwkFg2sKGScDCliCewEBAQEGAQEBA?= =?us-ascii?q?QEBARkCBhKDHIIHgVCFE4RpSYJngmEFiDcMkDCIeoIvhTaNEIJykDKVaxQFH4E?= =?us-ascii?q?VDxcKggI0ISVeNYIvCYIaKh+BdT42iXaBQQEBAQ?= X-IronPort-AV: E=Sophos;i="5.43,427,1503352800"; d="scan'208,217";a="297637609" Received: from mail-qt0-f172.google.com ([209.85.216.172]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 24 Oct 2017 13:17:22 +0200 Received: by mail-qt0-f172.google.com with SMTP id 31so29845092qtz.9 for ; Tue, 24 Oct 2017 04:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TWU8U0isggMpNv40KO0/1yoj8i/P9cIQTxdyjW8fklU=; b=Yc5VZv4yjSerNhMTA1rsL8OHumWj/1vZLAKgVMjf9nSU7tItAyTrtYJd6ZxuDR2lRr kKJ6zt5qzqsVUdXRzOz5xCgdfe32LAjZHdeWdLgTVHwW5pvD1vfy5FMsJKRHkFHefbEM a+pzYclDodjTlo2P7JdCihuxLoGmi3NtaGthJKWWFNx0aDTEALpkUO2TPDPJ3a7XKtW7 SQ2TSFDi8LH134CXl+E68cDBbY6PHL/4Lkd7SYZihfnTm2o2p5pRlMLrRQBwiJ0c8zvx 5sfe4ilxS748xJz7oGXzn/qLE0XX80+EkDyNbOkXT7GLKmRwdkBHggnM3U/BQEYYCWkL S83w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TWU8U0isggMpNv40KO0/1yoj8i/P9cIQTxdyjW8fklU=; b=dX0j2IVN9w8XsqtL+OlF3LmsZQBJMXDT2htByh7mqZj7RTMQj0o2s7RAwHWbCqUVVQ gfj97YJJqK7XLDDEpcyXfnURZQgpRT4mjqHhnAaHkyN7SesBjHfButIEO2RUDQ14S5jS 7Ff/PJ1QFiYbfsNgk71DncMALimz4Xontn7znPnsXfomrSC8JLoy0m4h1F4cqutjo+Rz 9Ah1opy3qLuB20JFUgm0NBk+8PfS6VPmLSiHYBKbBBEL6UzRpjvi9o1z4Ms9HX2PuP4s qNTR4MjxfsnBtE4Plg46PW8/GwXhXUcKykmdkvslsBNUDfF1FzhV+Mk+hAOx8MqGeiKx 0Tvg== X-Gm-Message-State: AMCzsaUEoCESCaRsfJKjogfM083uT0SXBCuCGazXVzjMq+LborrBio30 VqjuyIbI7yRR+qFQjFz0qDxQvDC81KeiwwZUAQhS0A== X-Google-Smtp-Source: ABhQp+SEXdXoBklGnQRXB04CZIVbbjZmeudhdD5OEZJ6Y++syc1+mgjPzHBgW0lnJgekoN4dP4G4Rtbi/152+qXd7JA= X-Received: by 10.200.48.37 with SMTP id f34mr24966310qte.228.1508843841193; Tue, 24 Oct 2017 04:17:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.178.65 with HTTP; Tue, 24 Oct 2017 04:16:40 -0700 (PDT) In-Reply-To: References: <86o9p2ywgc.fsf@gmail.com> <867evnz79e.fsf@gmail.com> From: Gabriel Scherer Date: Tue, 24 Oct 2017 13:16:40 +0200 Message-ID: To: SP Cc: caml users Content-Type: multipart/alternative; boundary="001a11377fc02d1c33055c4915c1" Subject: Re: [Caml-list] What if exn was not an open type? --001a11377fc02d1c33055c4915c1 Content-Type: text/plain; charset="UTF-8" Participants to this discussion may be interested in the article "Catch me if you can", by David Teller, Arnaud Spiwack and Till Varoquaux, 2008: https://hal.inria.fr/inria-00432575 This is the year 2008 and ML-style exceptions are everywhere. Most modern > languages, whether academic or industrial, feature some variant of this > mechanism. Languages such as Java even feature static coverage-checking for > such exceptions, something not available for ML languages, at least not > without resorting to external tools. In this document, we demonstrate a > design principle and a tiny library for managing errors in a functional > manner, with static coverage-checking, automatically-inferred, structurally > typed and hierarchical exceptional cases, with a reasonable run-time > penalty. Our work is based on OCaml and features monads, polymorphic > variants, compile-time code rewriting and trace elements of black magic. On Tue, Oct 24, 2017 at 1:11 PM, SP wrote: > On 22/10/2017 13:39, Malcolm Matalka wrote: > > I'm one of those people that uses result everywhere + result monad where > > the error case is a polymorphic variant. This lets me get the value of > > an open type with power of an exhaustive pattern match check. No > > strings needed. > > Nice! > > -- > SP > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a11377fc02d1c33055c4915c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Participants to this discussion may be interested in the a= rticle "Catch me if you can", by David Teller, Arnaud Spiwack and= Till Varoquaux, 2008:

=C2=A0 https://hal.inria.fr/inria-00432575

This is the year 2008 and ML-style excepti= ons are everywhere. Most modern languages, whether academic or industrial, = feature some variant of this mechanism. Languages such as Java even feature= static coverage-checking for such exceptions, something not available for = ML languages, at least not without resorting to external tools. In this doc= ument, we demonstrate a design principle and a tiny library for managing er= rors in a functional manner, with static coverage-checking, automatically-i= nferred, structurally typed and hierarchical exceptional cases, with a reas= onable run-time penalty. Our work is based on OCaml and features monads, po= lymorphic variants, compile-time code rewriting and trace elements of black= magic.

On Tue, Oct 24, 2017 at 1:11 PM, SP <sp@orbitalfox.com> wrote:
On 22/10/20= 17 13:39, Malcolm Matalka wrote:
> I'm one of those people that uses result everywhere + result monad= where
> the error case is a polymorphic variant.=C2=A0 This lets me get the va= lue of
> an open type with power of an exhaustive pattern match check.=C2=A0 No=
> strings needed.

Nice!

--
=C2=A0 =C2=A0 SP

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a11377fc02d1c33055c4915c1--