WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] forward pipe operator

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] forward pipe operator
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 23 Aug 2010 13:58:23 +0100
Delivery-date: Mon, 23 Aug 2010 06:19:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1282568287 -3600
# Node ID 630c51dcfc241050ce34303920291b837671cd42
# Parent  08e77bc9468cd5b7e364b86d54140f5b7e33fb61
Adds a forward pipe operator to the higher-order function library. The forward 
pipe operator facilitates left-to-right function composition.

Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>

diff -r 08e77bc9468c -r 630c51dcfc24 stdext/fun.ml
--- a/stdext/fun.ml     Mon Aug 23 13:56:55 2010 +0100
+++ b/stdext/fun.ml     Mon Aug 23 13:58:07 2010 +0100
@@ -17,4 +17,6 @@
 let comp2 f g a b = f (g a b)
 let (+++) f g a b = comp2 f g a b
 
+let (|>) a f = f a
+
 let ($) f a = f a
diff -r 08e77bc9468c -r 630c51dcfc24 stdext/fun.mli
--- a/stdext/fun.mli    Mon Aug 23 13:56:55 2010 +0100
+++ b/stdext/fun.mli    Mon Aug 23 13:58:07 2010 +0100
@@ -7,4 +7,6 @@
 val comp2 : ('b -> 'c) -> ('a1 -> 'a2 -> 'b) -> ('a1 -> 'a2 -> 'c)
 val (+++) : ('c -> 'd) -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'd
 val (++) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
+(** Forward pipe operator: facilitates left-to-right function composition. *)
+val (|>) : 'a -> ('a -> 'b) -> 'b
 val ($) : ('a -> 'b) -> 'a -> 'b
 stdext/fun.ml  |  2 ++
 stdext/fun.mli |  2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)


Attachment: xen-api-libs.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] forward pipe operator, David Scott <=