Module Std_extra.Utils

Various utility functions and modules. Includes pretty-printer, extended Stdlib Sets and Maps, unicode characters and more.

val pp_dot : unit Types.pp

print a "." separator with break

val pp_semicolon : unit Types.pp

print a "; " separator with breaking space

val use_color : bool Stdlib.ref

Toggle on/off ansi codes in printf. Default is Unix.isatty

val use_unicode : bool Stdlib.ref

Toggle on/off unicode displays

module Unicode : sig ... end

Unicode symbols (or full text equivalent if unicode is off)

val printf : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a

Set to Ocolor_format.printf or Format.printf to enable/disable coloring

val debug_printf : ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a

Print debug information in step by step mode

val debug_pause : unit -> unit

Pause (using read_line) in step by step mode

val set_debug : bool -> unit

Set/unset step by step mode

val hash_combine : int -> int -> int

Function used to combine a pair of hashes

val hash_sum : log_total:int -> nb:int -> int -> int

hash_sum ~nb ~log_total h returns a hash for contructor ~nb (between 0 and 2^(~log_total)-1) whose arguments hash top h

val swap : ('a * 'b) -> 'b * 'a
val compare_pair : ('a -> 'a -> int) -> ('b -> 'b -> int) -> 'a -> 'a -> 'b -> 'b -> int

Compare a pair in lexicographic order

val compare_inf : int
val compare_sup : int
val order_of_compare : int -> Types.order
val equal_of_compare : int -> bool
val compare_of_order : Types.order -> int
val equal_of_order : Types.order -> bool
val order_of_poly_order : ('a, 'b) Types.poly_order -> Types.order
val equal_of_poly_equal : ('a, 'b) Types.poly_equal -> bool
val unary_order_of_compare : (('a -> 'a -> int) -> 'at -> 'at -> int) -> ('a -> 'a -> Types.order) -> 'at -> 'at -> Types.order
module Set (A : Types.TYPE) : Types.SET with type elt = A.t

Set with extra stuff (pretty-printer)

exception Bottom

Exception raised when reaching an impossible state

module MapExtra (M : Stdlib.Map.S) : sig ... end
module Map (A : Types.TYPE) : Types.MAP with type key = A.t

Map with extra stuff (pretty-printer)