diff --git a/src/core/CCFun.ml b/src/core/CCFun.ml index 0796dee4..fb762291 100644 --- a/src/core/CCFun.ml +++ b/src/core/CCFun.ml @@ -14,19 +14,14 @@ let opaque_identity x = x include Sys include CCShims_.Stdlib +include Fun let compose f g x = g (f x) let compose_binop f g x y = g (f x) (f y) -let flip f x y = f y x - let curry f x y = f (x,y) -let id x = x - -let const x _ = x - let uncurry f (x,y) = f x y let tap f x = ignore (f x); x diff --git a/src/core/CCFun.mli b/src/core/CCFun.mli index d7d4713f..66a39de3 100644 --- a/src/core/CCFun.mli +++ b/src/core/CCFun.mli @@ -3,6 +3,8 @@ (** {1 Basic Functions} *) +include module type of CCShims_.Stdlib.Fun + val (|>) : 'a -> ('a -> 'b) -> 'b (** A 'pipe' operator. [x |> f] is the same as [f x]. *) @@ -22,16 +24,6 @@ val (@@) : ('a -> 'b) -> 'a -> 'b (** [f @@ x] is the same as [f x], but right-associative. @since 0.5 *) -val id : 'a -> 'a -(** Identity function. *) - -val const : 'a -> 'b -> 'a -(** Produce a function that just returns its first argument. - [const x y = x] for any [y]. *) - -val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c -(** Reverse the order of arguments for a binary function. *) - val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c (** Convert a function which accepts a pair of arguments into a function which accepts two arguments. [curry f x y] is [f (x,y)]. *)