Module type Signatures.MISC

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

A shortcut to force lazy value (See

azy.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 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