2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
val remove_dir: string -> unit Lwt.t
|
|
|
|
|
|
|
|
val create_dir: ?perm:int -> string -> unit Lwt.t
|
|
|
|
val create_file: ?perm:int -> string -> string -> unit Lwt.t
|
|
|
|
|
|
|
|
val termination_thread: int Lwt.t
|
|
|
|
val exit: int -> 'a
|
|
|
|
|
|
|
|
module StringMap : Map.S with type key = string
|
|
|
|
|
|
|
|
(** Splits a string on slashes, grouping multiple slashes, and
|
|
|
|
ignoring slashes at the beginning and end of string. *)
|
|
|
|
val split_path: string -> string list
|
|
|
|
|
|
|
|
(** Splits a string on a delimier character, grouping multiple
|
|
|
|
delimiters, and ignoring delimiters at the beginning and end of
|
|
|
|
string, if [limit] is passed, stops after [limit] split(s). *)
|
|
|
|
val split: char -> ?limit: int -> string -> string list
|
|
|
|
|
|
|
|
val map_option: f:('a -> 'b) -> 'a option -> 'b option
|
2016-11-14 19:26:34 +04:00
|
|
|
val apply_option: f:('a -> 'b option) -> 'a option -> 'b option
|
2016-09-08 21:13:10 +04:00
|
|
|
val iter_option: f:('a -> unit) -> 'a option -> unit
|
|
|
|
val unopt: 'a -> 'a option -> 'a
|
|
|
|
val unopt_list: 'a option list -> 'a list
|
|
|
|
|
|
|
|
val display_paragraph: Format.formatter -> string -> unit
|
|
|
|
|
|
|
|
(** [remove nb list] remove the first [nb] elements from the list [list]. *)
|
|
|
|
val remove_elem_from_list: int -> 'a list -> 'a list
|
|
|
|
|
2016-10-06 20:30:04 +04:00
|
|
|
val remove_prefix: prefix:string -> string -> string option
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val filter_map: ('a -> 'b option) -> 'a list -> 'b list
|
|
|
|
|
2016-10-24 21:12:57 +04:00
|
|
|
val finalize: (unit -> 'a) -> (unit -> unit) -> 'a
|
2016-11-16 04:19:13 +04:00
|
|
|
|
2016-10-24 21:12:57 +04:00
|
|
|
val read_file: ?bin:bool -> string -> string
|
|
|
|
val write_file: ?bin:bool -> string -> string -> unit
|
2016-11-16 04:19:13 +04:00
|
|
|
|
2016-11-04 23:22:22 +04:00
|
|
|
(** Compose functions from right to left. *)
|
|
|
|
val (<<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
|