composition operator
added composition operator to utils module
This commit is contained in:
parent
438281f1e1
commit
b8b93651af
@ -434,8 +434,8 @@ let addr_encoding =
|
||||
let public_key_encoding =
|
||||
let open Data_encoding in
|
||||
conv
|
||||
(fun public_key -> MBytes.to_string (Crypto_box.of_public_key public_key))
|
||||
(fun str -> Crypto_box.to_public_key (MBytes.of_string str))
|
||||
(MBytes.to_string << Crypto_box.of_public_key)
|
||||
(Crypto_box.to_public_key << MBytes.of_string)
|
||||
string
|
||||
|
||||
let peers_file_encoding =
|
||||
|
@ -121,3 +121,5 @@ let rec remove_elem_from_list nb = function
|
||||
| [] -> []
|
||||
| l when nb <= 0 -> l
|
||||
| _ :: tl -> remove_elem_from_list (nb - 1) tl
|
||||
|
||||
let (<<) g f = fun a -> g (f a)
|
||||
|
@ -38,3 +38,5 @@ val remove_elem_from_list: int -> 'a list -> 'a list
|
||||
|
||||
val filter_map: ('a -> 'b option) -> 'a list -> 'b list
|
||||
|
||||
(** Compose functions from right to left. *)
|
||||
val (<<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
|
||||
|
Loading…
Reference in New Issue
Block a user