Module type Signatures.MISC

val opt_print : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a option -> unit
val the : 'a option -> 'a
val getenv : ?⁠default:string -> string -> string
val with_input_file : ?⁠bin:bool -> string -> (Stdlib.in_channel -> 'a) -> 'a
val with_output_file : ?⁠bin:bool -> string -> (Stdlib.out_channel -> 'a) -> 'a
val with_temp_file : string -> string -> (string -> 'a) -> 'a
val read_file : string -> string
val copy_chan : Stdlib.in_channel -> Stdlib.out_channel -> unit
val copy_file : string -> string -> unit
val print_string_list : Stdlib.Format.formatter -> string list -> unit
val (!*) : 'a Stdlib.Lazy.t -> 'a

A shortcut to force lazy value (See Lazy.force).

val (&) : ('a -> 'b) -> 'a -> 'b

The right associative application. Useful when writing to much parentheses: << f (g x ... t) >> becomes << f& g x ... t >> << f (g (h x)) >> becomes << f& g& h x >>

val (|>) : 'a -> ('a -> 'b) -> 'b

The reversed application combinator. Useful to describe some operations chaining. << f x (g y (h z)) >> becomes << z |> h |> g y |> f x >>

val (@:=) : 'a list Stdlib.ref -> 'a list -> unit

r @:= l is equivalent to r := !r @ l

val memo : ('a -> 'b) -> 'a -> 'b
val memo2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
val memo3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd