package commons

  1. Overview
  2. Docs
val (=) : string -> string -> bool
val (=|=) : int -> int -> bool
val (=$=) : char -> char -> bool
val (=:=) : bool -> bool -> bool
val (=*=) : 'a -> 'a -> bool
val pr : string -> unit
val pr2 : string -> unit
val pr2_gen : 'a -> unit
val pr2_once : string -> unit
val _already_printed : (string, bool) Stdlib.Hashtbl.t
val disable_pr2_once : bool Stdlib.ref
val before_return : ('a -> unit) -> 'a -> 'a
exception Todo
exception Impossible
exception Multi_found
exception UnixExit of int
val exn_to_s : exn -> string
val debugger : bool Stdlib.ref
val unwind_protect : (unit -> 'a) -> (Exception.t -> unit) -> 'a
val save_excursion : 'a Stdlib.ref -> 'a -> (unit -> 'b) -> 'b
val finalize : (unit -> 'a) -> (unit -> unit) -> 'a
val i_to_s : int -> string
val s_to_i : string -> int
val null_string : string -> bool
val (=~) : string -> string -> bool
val matched1 : string -> string
val matched2 : string -> string * string
val matched3 : string -> string * string * string
val matched4 : string -> string * string * string * string
val matched5 : string -> string * string * string * string * string
val matched6 : string -> string * string * string * string * string * string
val matched7 : string -> string * string * string * string * string * string * string
val spf : ('a, unit, string) Stdlib.format -> 'a
val join : string -> string list -> string
val split : string -> string -> string list
type filename = string
val pp_filename : Ppx_deriving_runtime.Format.formatter -> filename -> Ppx_deriving_runtime.unit
val show_filename : filename -> Ppx_deriving_runtime.string
val equal_filename : filename -> filename -> Ppx_deriving_runtime.bool
type dirname = string
type path = string
val is_directory : filename -> bool
val fullpath : filename -> filename
val filename_without_leading_path : string -> filename -> filename
val readable : root:string -> filename -> filename
val files_of_dir_or_files_no_vcs_nofilter : string list -> filename list
val input_text_line : Stdlib.in_channel -> string
val cat : filename -> string list
val write_file : file:filename -> string -> unit
val read_file : ?max_len:int -> filename -> string
val with_open_outfile : filename -> (((string -> unit) * Stdlib.out_channel) -> 'a) -> 'a
val with_open_infile : filename -> (Stdlib.in_channel -> 'a) -> 'a
val new_temp_file : string -> string -> filename
val _temp_files_created : (string, unit) Stdlib.Hashtbl.t
val save_tmp_files : bool Stdlib.ref
val erase_temp_files : unit -> unit
val erase_this_temp_file : filename -> unit
val cmd_to_list_and_status : ?verbose:bool -> string -> string list * Unix.process_status
exception CmdError of Unix.process_status * string
val cmd_to_list : ?verbose:bool -> string -> string list
val null : 'a list -> bool
val map : ('a -> 'b) -> 'a list -> 'b list

Same as List.map but stack-safe and slightly faster on short lists. Additionally, we guarantee that the mapping function is applied from left to right like for List.iter.

val flatten : 'a list list -> 'a list

Same as List.flatten but tail recursive.

val exclude : ('a -> bool) -> 'a list -> 'a list
val sort : 'a list -> 'a list
val uniq_by : ('a -> 'a -> bool) -> 'a list -> 'a list
val map_filter : ('a -> 'b option) -> 'a list -> 'b list

Same as List.filter_map but tail recursive.

val find_some : ('a -> 'b option) -> 'a list -> 'b
val find_some_opt : ('a -> 'b option) -> 'a list -> 'b option
val filter_some : 'a option list -> 'a list
val take : int -> 'a list -> 'a list
val take_safe : int -> 'a list -> 'a list
val drop : int -> 'a list -> 'a list
val span : ('a -> bool) -> 'a list -> 'a list * 'a list
val index_list : 'a list -> ('a * int) list
val index_list_0 : 'a list -> ('a * int) list
val index_list_1 : 'a list -> ('a * int) list
type ('a, 'b) assoc = ('a * 'b) list
val sort_by_val_lowfirst : ('a, 'b) assoc -> ('a * 'b) list
val sort_by_val_highfirst : ('a, 'b) assoc -> ('a * 'b) list
val sort_by_key_lowfirst : ('a, 'b) assoc -> ('a * 'b) list
val sort_by_key_highfirst : ('a, 'b) assoc -> ('a * 'b) list
val group_by : ('a -> 'b) -> 'a list -> ('b * 'a list) list
val group_assoc_bykey_eff : ('a * 'b) list -> ('a * 'b list) list
val group_by_mapped_key : ('a -> 'b) -> 'a list -> ('b * 'a list) list
val group_by_multi : ('a -> 'b list) -> 'a list -> ('b * 'a list) list
type 'a stack = 'a list
val push : 'a -> 'a stack Stdlib.ref -> unit
val hash_of_list : ('a * 'b) list -> ('a, 'b) Stdlib.Hashtbl.t
val hash_to_list : ('a, 'b) Stdlib.Hashtbl.t -> ('a * 'b) list
type 'a hashset = ('a, bool) Stdlib.Hashtbl.t
val hashset_of_list : 'a list -> 'a hashset
val hashset_to_list : 'a hashset -> 'a list
val optlist_to_list : 'a list option -> 'a list
val let* : 'a option -> ('a -> 'b option) -> 'b option
val (>>=) : 'a option -> ('a -> 'b option) -> 'b option
val (|||) : 'a option -> 'a -> 'a
type ('a, 'b) either =
  1. | Left of 'a
  2. | Right of 'b
val equal_either : ('a -> 'a -> Ppx_deriving_runtime.bool) -> ('b -> 'b -> Ppx_deriving_runtime.bool) -> ('a, 'b) either -> ('a, 'b) either -> Ppx_deriving_runtime.bool
val pp_either : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'b -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> ('a, 'b) either -> Ppx_deriving_runtime.unit
val show_either : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'b -> Ppx_deriving_runtime.unit) -> ('a, 'b) either -> Ppx_deriving_runtime.string
val partition_either : ('a -> ('b, 'c) either) -> 'a list -> 'b list * 'c list
type ('a, 'b, 'c) either3 =
  1. | Left3 of 'a
  2. | Middle3 of 'b
  3. | Right3 of 'c
val equal_either3 : ('a -> 'a -> Ppx_deriving_runtime.bool) -> ('b -> 'b -> Ppx_deriving_runtime.bool) -> ('c -> 'c -> Ppx_deriving_runtime.bool) -> ('a, 'b, 'c) either3 -> ('a, 'b, 'c) either3 -> Ppx_deriving_runtime.bool
val pp_either3 : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'b -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'c -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> ('a, 'b, 'c) either3 -> Ppx_deriving_runtime.unit
val show_either3 : (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'b -> Ppx_deriving_runtime.unit) -> (Ppx_deriving_runtime.Format.formatter -> 'c -> Ppx_deriving_runtime.unit) -> ('a, 'b, 'c) either3 -> Ppx_deriving_runtime.string
val partition_either3 : ('a -> ('b, 'c, 'd) either3) -> 'a list -> 'b list * 'c list * 'd list
val partition_result : ('a -> ('ok, 'error) Stdlib.result) -> 'a list -> 'ok list * 'error list
val memoized : ?use_cache:bool -> ('a, 'b) Stdlib.Hashtbl.t -> 'a -> (unit -> 'b) -> 'b
val cache_computation : ?use_cache:bool -> filename -> string -> (unit -> 'a) -> 'a
val with_time : (unit -> 'a) -> 'a * float
val pr_time : string -> (unit -> 'a) -> 'a
val pr2_time : string -> (unit -> 'a) -> 'a
val before_exit : (unit -> unit) list Stdlib.ref
val main_boilerplate : (unit -> unit) -> unit
module SMap : Stdlib.Map.S with type key = Stdlib.String.t
type 'a smap = 'a SMap.t
val jsoo : bool Stdlib.ref
OCaml

Innovation. Community. Security.