From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1F3B48179A for ; Tue, 30 Jul 2013 19:57:43 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of michipili@gmail.com) identity=pra; client-ip=209.85.215.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of michipili@gmail.com designates 209.85.215.176 as permitted sender) identity=mailfrom; client-ip=209.85.215.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ea0-f176.google.com) identity=helo; client-ip=209.85.215.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="postmaster@mail-ea0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlcCAFH991HRVdewlGdsb2JhbABbhlS7TYEeFg4BAQEBBw0SFAQkgiQBAQUnGQEbHAEBAwwGBQsNCRMDDwkDAgECARERAQUBHAYNAQcCh3kBAw8EmnSMUYJ/hFgKGScNZId0AQUMjimBSQeECQOPG4hEj2c/hDw X-IPAS-Result: AlcCAFH991HRVdewlGdsb2JhbABbhlS7TYEeFg4BAQEBBw0SFAQkgiQBAQUnGQEbHAEBAwwGBQsNCRMDDwkDAgECARERAQUBHAYNAQcCh3kBAw8EmnSMUYJ/hFgKGScNZId0AQUMjimBSQeECQOPG4hEj2c/hDw X-IronPort-AV: E=Sophos;i="4.89,778,1367964000"; d="scan'208";a="22775568" Received: from mail-ea0-f176.google.com ([209.85.215.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jul 2013 19:57:42 +0200 Received: by mail-ea0-f176.google.com with SMTP id q16so3756121ead.35 for ; Tue, 30 Jul 2013 10:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=meHqwZnJrBNZIU+PPRj8QAdSGsaSl7seJ5ViwNnheRM=; b=k7wl9ube3rx3RdoQODled9sShAdOKegWlMBe2HdH8SHbmPXMkTDnHm+6qcU4ZQjzys OOq8pWuYOQZYBe8Kzf/1Ja+BKFGZTb8Wei6bw5btshll2mlrsoQKY7M3y3jZxdhHQ9tk uRrKUlGIDCHTs5aAG5L4LZBNuMmSOvtBKT7SDp5TSc/jm3kgKQR9v5pp6jGHFD/8U1SN RhsUIrHYfTZoPyMgg4MmwQxwRdRI/yiC6Ft1TruYv/Zm36iXLeOA5cQI88YXaVj1Hxu1 UWltkg8L2qJeKw41ZJQXVLtzE+XJH1Xnws4aRjvrFDc7/rfqudIkowb46XRVRcuzY15/ A92g== X-Received: by 10.14.203.194 with SMTP id f42mr65976107eeo.53.1375207061966; Tue, 30 Jul 2013 10:57:41 -0700 (PDT) Received: from llea.celt.neu (xdsl-89-0-83-142.netcologne.de. [89.0.83.142]) by mx.google.com with ESMTPSA id i2sm112282125eeu.4.2013.07.30.10.57.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 10:57:40 -0700 (PDT) Message-ID: <51F7FE93.4080508@gmail.com> Date: Tue, 30 Jul 2013 19:57:39 +0200 From: Michael User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121104 Firefox/16.0 SeaMonkey/2.13.2 MIME-Version: 1.0 To: Xavier Leroy CC: caml-list@inria.fr References: <51F662B2.7070102@inria.fr> In-Reply-To: <51F662B2.7070102@inria.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Writing Awk in OCaml Hello Xavier, Xavier Leroy wrote: > On 2013-07-28 10:43, Michael wrote: >> With the above signature, we can write (1) >> >> bind u f1: row -> state -> stat >> bind (bind v f1) f2 : row -> state -> stat >> >> But it would be quite nice to be able to write the following expressions so >> that they are defined and correctly type (2): >> >> bind u f1 : row -> state -> state >> bind v f1 f2 : row -> state -> state >> >> Is there any way to rewrite things so that the cumbersome (1) can be replaced >> by the slick (2) ? > Just use a left-associative infix symbol for "bind", it will be real slick: > > let (++) = bind > > v ++ f1 ++ f2 (* i.e. bind (bind v f1) f2 *) > > Hope this helps, > thank you very much for your answer, it is nearly perfect! It has however a drawback: I thought I had found a plausible alibi to learn how to produce and use these strange variadics! It looks like I have to find something else. :) Best regards, Michael