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 534B87EE89 for ; Wed, 25 Oct 2017 16:52:51 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=rich@annexia.org; spf=Pass smtp.mailfrom=rich@annexia.org; spf=Pass smtp.helo=postmaster@annexia.org Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rich@annexia.org) identity=pra; client-ip=80.68.91.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of rich@annexia.org designates 80.68.91.176 as permitted sender) identity=mailfrom; client-ip=80.68.91.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@annexia.org designates 80.68.91.176 as permitted sender) identity=helo; client-ip=80.68.91.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="postmaster@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AeK2zghFI8d2RFQCX/Yy4T51GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ75p8qwAkXT6L1XgUPTWs2DsrQf1LqQ7viocFdDyKjCmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWapAQfERTnNAdz?= =?us-ascii?q?Ov+9WsuL15z2hKiO/MjrYwRMhSKlbPtMIR+7t02FrskXhYp6Mqt31BbDr2FgdO?= =?us-ascii?q?FfxGcuLlWWyUXS/MC1qdRZ8i9Qsugtv/EGdOOyXaM+QKcSRGA8Mms1zMTtsxTT?= =?us-ascii?q?TALJ4WETBDZF2iFUChTIuUmpFqz6tTH3468kgHGX?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A+AgBZpPBZ/7BbRFBbGwEBAQMBAQEJA?= =?us-ascii?q?QEBFQEBAQECAQEBAQgBAQEBgwYugVKdSz8BAQEBAQEGgS+YSwqEJgGBFAKEbUM?= =?us-ascii?q?UAQEBAQEBAQEBAQFqKII4BQEeAQWCPAEFJxMuERALGAkTEg8tGwaKJhGrKTqKe?= =?us-ascii?q?QELJoMuggeBCT2FHYp6BaFzApRokzOWAYE5NiGBW4EHCEmCZYRfP4prgVUBAQE?= X-IPAS-Result: =?us-ascii?q?A0A+AgBZpPBZ/7BbRFBbGwEBAQMBAQEJAQEBFQEBAQECAQE?= =?us-ascii?q?BAQgBAQEBgwYugVKdSz8BAQEBAQEGgS+YSwqEJgGBFAKEbUMUAQEBAQEBAQEBA?= =?us-ascii?q?QFqKII4BQEeAQWCPAEFJxMuERALGAkTEg8tGwaKJhGrKTqKeQELJoMuggeBCT2?= =?us-ascii?q?FHYp6BaFzApRokzOWAYE5NiGBW4EHCEmCZYRfP4prgVUBAQE?= X-IronPort-AV: E=Sophos;i="5.43,431,1503352800"; d="scan'208";a="297880746" Received: from annexia.org ([80.68.91.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 25 Oct 2017 16:52:50 +0200 Received: from rich by annexia.org with local (Exim 4.89) (envelope-from ) id 1e7N31-0002eX-HG; Wed, 25 Oct 2017 15:52:47 +0100 Date: Wed, 25 Oct 2017 15:52:47 +0100 From: "Richard W.M. Jones" To: Philippe Veber Cc: "Petter A. Urkedal" , ptoscano@redhat.com, caml users Message-ID: <20171025145247.5rxad7qixivzn4vj@annexia.org> References: <86o9p2ywgc.fsf@gmail.com> <20171020113815.GD32138@nunchakus.loria.fr> <20171024133026.uovvzdbnamnzoknv@annexia.org> <20171025083530.gvggcenrgxolduse@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [Caml-list] What if exn was not an open type? On Wed, Oct 25, 2017 at 11:12:26AM +0200, Philippe Veber wrote: > isn't that a context where error monads do a pretty decent job? > > check_some_problem () >>= fun () -> > check_some_other_problem () >>= fun () -> > expect_something () >>= fun something -> > finally_do something Right, but the main problem with monads is they scare off ordinary programmers :-/ When writing open source code in OCaml we have two -- conflicting -- goals. Goal #1 is to write elegant, short, fast, safe code, and OCaml really wins there. Goal #2 is to attract outside programmers to work on the project, and that's pretty hard with OCaml code, but we manage it. But it gets much much harder if we use any concept which strays too far from imperative/C-like code. You will see if you look through our codebase that it's pretty imperative and -- quite deliberately -- avoids doing strange stuff with modules, functors or really anything which is "excessively functional" (sorry for the loose term, but I hope you know what I mean :-). However when I have the time after my current conference I will try to rewrite the code I linked to with monads to see if I can make something which is both simple and readable. Thanks, Rich.