]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
Module Fun gets operators for function composition and application.
authorMatthias Goergens <matthias.goergens@citrix.com>
Tue, 2 Feb 2010 15:42:13 +0000 (15:42 +0000)
committerMatthias Goergens <matthias.goergens@citrix.com>
Tue, 2 Feb 2010 15:42:13 +0000 (15:42 +0000)
Exposes function composition (++) and function composition with two
arguments (+++) to the Fun module of our extended standard library.
Adds and exposes function application ($).

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
stdext/fun.ml
stdext/fun.mli

index 8cd5d9aa617c134ac3b704f5a5ec31a4c9f17027..951040634093121190b340b760ec93aec3edd60c 100644 (file)
@@ -16,3 +16,5 @@ let (++) f g x = comp f g x
 
 let comp2  f g a b = ((++) ++ (++)) f g a b
 let (+++) f g a b = comp2 f g a b
+
+let ($) f a = f a
index 634d946cdd9ef24683d8ec7aea8f71c83ca02ed5..c4da94634be54bdad5730ffb9a26cccbb329cd1a 100644 (file)
@@ -4,3 +4,6 @@ val id : 'a -> 'a
 val flip : ('a -> 'b -> 'c) -> ('b -> 'a -> 'c)
 val on : ('b -> 'b -> 'c) -> ('a -> 'b) -> 'a -> 'a -> 'c
 val comp : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c)
+val (+++) : ('c -> 'd) -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'd
+val (++) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
+val ($) : ('a -> 'b) -> 'a -> 'b
\ No newline at end of file