From 12089933b8b08ebf11cce674bc218b5daebdf5d9 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Tue, 2 Feb 2010 15:42:13 +0000 Subject: [PATCH] Module Fun gets operators for function composition and application. 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 --- stdext/fun.ml | 2 ++ stdext/fun.mli | 3 +++ 2 files changed, 5 insertions(+) diff --git a/stdext/fun.ml b/stdext/fun.ml index 8cd5d9a..9510406 100644 --- a/stdext/fun.ml +++ b/stdext/fun.ml @@ -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 diff --git a/stdext/fun.mli b/stdext/fun.mli index 634d946..c4da946 100644 --- a/stdext/fun.mli +++ b/stdext/fun.mli @@ -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 -- 2.39.5