mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 19:55:31 -05:00
add CCOrd.Infix
This commit is contained in:
parent
6823015b63
commit
d76d3b95e3
2 changed files with 15 additions and 0 deletions
|
|
@ -123,3 +123,10 @@ let array ord a1 a2 =
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let map f ord a b = ord (f a) (f b)
|
let map f ord a b = ord (f a) (f b)
|
||||||
|
|
||||||
|
let (>|=) x f = map f x
|
||||||
|
|
||||||
|
module Infix = struct
|
||||||
|
let (>|=) = (>|=)
|
||||||
|
let (<?>) = (<?>)
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,11 @@ val map : ('a -> 'b) -> 'b t -> 'a t
|
||||||
Example:
|
Example:
|
||||||
[map fst CCInt.compare] compares values of type [(int * 'a)] by their
|
[map fst CCInt.compare] compares values of type [(int * 'a)] by their
|
||||||
first component. *)
|
first component. *)
|
||||||
|
|
||||||
|
val (>|=) : 'b t -> ('a -> 'b) -> 'a t
|
||||||
|
(** Infix equivalent of {!map} *)
|
||||||
|
|
||||||
|
module Infix : sig
|
||||||
|
val (<?>) : int -> ('a t * 'a * 'a) -> int
|
||||||
|
val (>|=) : 'b t -> ('a -> 'b) -> 'a t
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue