cleanup: remove stubs for code always present on 4.08

This commit is contained in:
Simon Cruanes 2023-07-10 11:55:43 -04:00
parent 61887100ae
commit 492484a9a2
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 20 deletions

View file

@ -2,24 +2,18 @@
(** {1 Basic Functions} *)
[@@@ocaml.warning "-32"]
let opaque_identity x = x
[@@@ocaml.warning "+32"]
(* import standard implementations, if any *)
include Sys
include Stdlib
include Fun
let compose f g x = g (f x)
let compose_binop f g x y = g (f x) (f y)
let curry f x y = f (x, y)
let uncurry f (x, y) = f x y
let[@inline] compose f g x = g (f x)
let[@inline] compose_binop f g x y = g (f x) (f y)
let[@inline] curry f x y = f (x, y)
let[@inline] uncurry f (x, y) = f x y
let tap f x =
let[@inline] tap f x =
ignore (f x);
x
@ -67,8 +61,6 @@ let rec iterate n f x =
module Infix = struct
(* default implem for some operators *)
let ( |> ) = Stdlib.( |> )
let ( @@ ) = Stdlib.( @@ )
let ( %> ) = compose
let[@inline] ( % ) f g x = f (g x)
let ( let@ ) = ( @@ )

View file

@ -71,13 +71,6 @@ val iterate : int -> ('a -> 'a) -> 'a -> 'a
Infix operators. *)
module Infix : sig
val ( |> ) : 'a -> ('a -> 'b) -> 'b
(** [x |> f] is the same as [f x]. A 'pipe' operator. *)
val ( @@ ) : ('a -> 'b) -> 'a -> 'b
(** [f @@ x] is the same as [f x], but right-associative.
@since 0.5 *)
val ( %> ) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c
(** [(f %> g) x] or [(%>) f g x] is [g (f x)]. Alias to [compose]. *)