Legend:
Library
Module
Module type
Parameter
Class
Class type
Miscellaneous general purposes functions.
val rm : 'a->'a list->'a0 list
rm x l returns l without x.
val rm_first : 'a->'a list->'a list
rm_first x l returns l without the left-most occurence of x.
val list_is_included : 'a list->'a list-> bool
list_is_included l1 l2 tests if elements of l1 are included into l2.
val count_empty_list : 'a list list-> int
count_empty_list llist counts the number of empty list that occurs in the list of list llist
val compare_list : 'a list->'a->'a-> int
compare 2 elements according to the order defined by a list
val string_to_string_list : string ->string list
val append_and_sort : 'a list->'a list->'b list
Appends two lists and sorts the result
val append_and_sort_rev : 'a list->'a list->'b list
val list_are_equals : 'a list->'a list-> bool
list_are_equals l1 l2 tests if l1 and l2 contains the same elements (in any order).
val list_intersec : 'a list->'a list->'a list
list_intersec l1 l2 returns all the elements that are both in l1 and l2.
val diff_list_as_set : 'a list->'a list->'a list
diff_list_as_set l1 l2 returns all the elements that are in l1 and not in l2.
val sorted : 'a list-> bool
Checks is a list is sorted w.r.t. compare
val power_2 : int -> int
power a b returns a to the power of b
val readfile_rm_crtl_m : string -> string
val list_iter3 :
('a->'b->'c-> unit)->'a list->'b list->'c list->
unit
val list_fold_left3 :
('a->'b->'c->'d->'e)->'f->'g list->'h list->'i list->'j
val list_fold_left4 :
('a->'b->'c->'d->'e->'f)->'g->'h list->'i list->'j list->'k list->'l
val list_fold_left5 :
('a->'b->'c->'d->'e->'f->'g)->'h->'i list->'j list->'k list->'l list->'m list->'n
val list_map3 :
('a->'b->'c->'d)->'a list->'b list->'c list->'d0 list
val list_map4 :
('a->'b->'c->'d->'e)->'a list->'b list->'c list->'d list->'e0 list
val list_map6 :
('a->'b->'c->'d->'e->'f->'g)->'a list->'b list->'c list->'d list->'e list->'f list->'g0 list
val list_split3 : ('a * 'b * 'c) list->'a0 list * 'b0 list * 'c0 list
val list_split4 :
('a * 'b * 'c * 'd) list->'a0 list * 'b0 list * 'c0 list * 'd0 list
val list_split6 :
('a * 'b * 'c * 'd * 'e * 'f) list->'a0 list * 'b0 list * 'c0 list * 'd0 list * 'e0 list * 'f0 list
val list_split7 :
('a * 'b * 'c * 'd * 'e * 'f * 'g) list->'a0 list * 'b0 list * 'c0 list * 'd0 list * 'e0 list * 'f0 list * 'g0 list
val no_dup : 'a list->'a option
checks that a list does not contain any duplicate
val rm_dup : 'a list->'a list
Removes duplicates from a list (conserving its order)
val sort_list_string_pair : (string * 'a) list->(string * 'a) list
Sorts a list of pair which lhs is a string lexicographically w.r.t. to this string.
val merge : 'a list->'a0 list->'a0 list
Merges two lists without introducing duplicates, respecting the original elements ordering.
val unfold : ('a->'b)->'a->int ->'b0 list
unfold f i n calls n times f i and returns the n results into a list, e.g., [(f i); (f i); ...; (f i)]. Of course, this makes more sense if f is not side effects free.
val unfold_do : ('a->'b)->'a0->int ->'b list
val call_n_times : ('a->'a)->'a->int ->'a
call_n_times f i n applies fn times , e.g., f(f(f(f...(f i)))).
is_substring ss s test whether ss a sub-string of s
val is_substring : string ->string -> bool
val gauss_draw : float ->float -> float
gauss_draw m d generates a gaussian pseudo-random number of mean m and deviation d. The generation algorithm is based on the so-called << polar form of the Box-Muller transformation >> that I found it at the url http://www.taygeta.com/random/gaussian.html
val gauss_draw2 : float ->float -> float * float
Ditto, but returns 2 numbers. Indeed, the Box-Muller algorithm computes 2 of them anyway...
I define my own version of print_float to turn around a bug (or is it a bug in ocaml?) of sim2chro where it does not understand floats without digit (e.g., 4. instead of 4.0)
val format_float : string ->float -> string
val my_string_of_float : float -> string
val my_string_of_float_precision : float ->int -> string
val my_print_float : float ->'a-> unit
val get_extension : string -> string
returns the extension of a filename
val chop_ext_no_excp : string -> string
val remove_extension : string -> string
val cartesian_product : 'a list->'a list->('a->'a->'b)->'b list
val union_find : ('a list->'a0 list-> bool)->'a0 list list->'a list list
val from_char_pos_to_line_and_col : string ->int ->bool -> string * string