From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0K9YTwd027126 for ; Fri, 20 Jan 2012 10:34:32 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMBANozGU/RVdS2imdsb2JhbABDhQSobwgiAQEBCgkNBxIGIYFyAQEBBBICDwQZATcCAwwBBQUYCRYLAgIJAwIBAgEiAQUBHBMIAQEeh1ybcAqLIoM3hHiJMAIFC4h/ggaBFgSONYEZhUqFVYE3hwQ9gU+CMA X-IronPort-AV: E=Sophos;i="4.71,541,1320620400"; d="vcf'?scan'208";a="140692985" Received: from mail-wi0-f182.google.com ([209.85.212.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Jan 2012 10:34:32 +0100 Received: by wibhn14 with SMTP id hn14so453311wib.27 for ; Fri, 20 Jan 2012 01:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=pK7QY69+NuBe3r6Ae56BYRFjRvstx6dNgmrxQH3Ziw4=; b=gX40Vm5wwonQ6rLSoKRnqAy+gkYtRmiYN+VesxIfxVmoM18UMru1nYIxS6WDxO4pGw TH5Hf8CVTOtPCRBBB/HDOoqxy+Q7WJi2fYX547LB7VSGtLcWtp2SAdezyvUwRNe9diyi apF0xdQoi/2Q5rkKVnpvfvd6Gts8MLihWpjSo= Received: by 10.180.20.69 with SMTP id l5mr2280448wie.19.1327052072081; Fri, 20 Jan 2012 01:34:32 -0800 (PST) Received: from [193.55.250.228] (chercheurs2-228.saclay.inria.fr. [193.55.250.228]) by mx.google.com with ESMTPS id eq5sm7156027wib.2.2012.01.20.01.34.28 (version=SSLv3 cipher=OTHER); Fri, 20 Jan 2012 01:34:28 -0800 (PST) Sender: Fabrice Le Fessant Message-ID: <4F193523.6030008@inria.fr> Date: Fri, 20 Jan 2012 10:34:27 +0100 From: Fabrice Le Fessant User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: caml-list@inria.fr References: <4F1927BD.9040507@irisa.fr> <20120120091151.GA13799@pps.jussieu.fr> In-Reply-To: <20120120091151.GA13799@pps.jussieu.fr> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------070802010806080406070309" X-Validation-by: fabrice.le_fessant@inria.fr Subject: Re: [Caml-list] is there a more concise way to write this? This is a multi-part message in MIME format. --------------070802010806080406070309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/20/2012 10:11 AM, Jerome Vouillon wrote: > And the parentheses can be avoided by using a right associative > application operator: > > let (@@) f x = f x > let a = maybe out o @@ maybe value v @@ [] Since the "%revapply" primitive is available in SVN 3.12 (next 3.12.2 or 3.13), you will be able to use "pipes", without the penalty of expensive partial applications: external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply" let a = [] |> maybe value v |> maybe out o I am wondering now if we should also provide the "%apply" primitive too, to be able to choose the order... --Fabrice --------------070802010806080406070309 Content-Type: text/x-vcard; charset=utf-8; name="fabrice_le_fessant.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fabrice_le_fessant.vcf" begin:vcard fn:Fabrice LE FESSANT n:LE FESSANT;Fabrice org:INRIA Saclay -- Ile-de-France;P2P & OCaml adr;quoted-printable:;;Parc Orsay Universit=C3=A9 ;Orsay CEDEX;;91893;France email;internet:fabrice.le_fessant@inria.fr title;quoted-printable:Charg=C3=A9 de Recherche tel;work:+33 1 74 85 42 14 tel;fax:+33 1 74 85 42 49 url:http://fabrice.lefessant.net/ version:2.1 end:vcard --------------070802010806080406070309--