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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 0990A7F2E5 for ; Wed, 9 Jan 2013 09:39:23 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of david.mentre@gmail.com) identity=pra; client-ip=209.85.223.175; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="david.mentre@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of david.mentre@gmail.com designates 209.85.223.175 as permitted sender) identity=mailfrom; client-ip=209.85.223.175; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="david.mentre@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f175.google.com) identity=helo; client-ip=209.85.223.175; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="postmaster@mail-ie0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBAL0r7VDRVd+vkWdsb2JhbABFvUoIFg4BAQEBCQkNBxIpgh8BBScZASoOAQMMAQUFCzsfAxIBBQEcBhOIBQMPDJtWjy6FHicNhjkBBQyRBAONOohSgRyNTBYpgViCPw X-IronPort-AV: E=Sophos;i="4.84,436,1355094000"; d="scan'208";a="167831881" Received: from mail-ie0-f175.google.com ([209.85.223.175]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 09 Jan 2013 09:39:22 +0100 Received: by mail-ie0-f175.google.com with SMTP id qd14so1677833ieb.20 for ; Wed, 09 Jan 2013 00:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=BWaemKyBqOj3wr1sWS4J5aEM4/XblKEylQI+pX881Ew=; b=RJ1YMo2xLp6P23h4r4KcT7GjexcVhizXcDrXKdajpmghnGCuLk6pmZngkYy1Cx2W/v CDWhNJuXJHRyFSIDy73mqT3HbkTW7z0pC+SHVngD59dLN6vlqwqCHmgRA1BBZzBRprE9 AqAm/Ijc4+gNx9EefCs6TCrDDoDtu74ouTxIkkj6TBmQlPzDWloby5c7zRn2toZsg7hB jqmN5IrSVd2u1BwcUXG7aubWZXiuoQwkwDVtRQDEQDu1r7wYvEGcAG9BQMBnDLP8+rJM dKrA8Bt9jUA4qxrOjLsnxjTcCmcnw48TV4qhKJuLkb4hMQfwbSfbtQqJxI2oKHSjGKuA YVgw== X-Received: by 10.50.178.67 with SMTP id cw3mr765493igc.53.1357720761144; Wed, 09 Jan 2013 00:39:21 -0800 (PST) MIME-Version: 1.0 Sender: david.mentre@gmail.com Received: by 10.50.153.233 with HTTP; Wed, 9 Jan 2013 00:38:51 -0800 (PST) In-Reply-To: <50ECE88D.9000905@riken.jp> References: <50ECE88D.9000905@riken.jp> From: David MENTRE Date: Wed, 9 Jan 2013 09:38:51 +0100 X-Google-Sender-Auth: Hcf8uES0fecp9KfMVKmh2VmBy-o Message-ID: To: Francois Berenger Cc: caml-list Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] some beautiful OCaml code Hello OCaml experts, 2013/1/9 Francois Berenger : > There is a full blog post about it there: > > http://functional-orbitz.blogspot.se/2013/01/introduction-to-resultt-vs-exceptions.html Regarding this blog post, the final code is using Polymorphic Variants (http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html#toc36). E.g. """ | _ -> Error (`Bad_line s) """ I never fully grasped polymorphic variants compared to regular ones but I always had the feeling the polymorphic variants where less safe that variants because they would allow more possibility to mix unrelated things[1]. Are the use of polymorphic variant mandatory to write code Return-Value-style code or can regular variants be used? Best regards, david [1] Of course this ability is the very thing that is of interest to people using polymorphic variants.