Module Misc (.ml)

module Misc: sig .. end
This module contains miscellaneous utilities.

val iter : ('a -> 'b) -> 'a list -> unit
iter is similar to List.iter, but does not require f to return a result of type unit. Use with caution.
val assocp : ('a -> bool) -> ('a * 'b) list -> 'b
If l is a list of pairs of a key and a datum, and if p is a predicate on keys, then assocp p l returns the datum associated with the first key that satisfies p in l. It raises Not_found if no such key exists.
module StringSet: Set.S  with type elt = string
Sets of strings.
module StringMap: sig .. end  with type key = string
Maps over strings.
val debug : bool Pervasives.ref
A debugging flag.
val print_separated_list : string -> ('a -> string) -> 'a list -> string
Prints a list of elements, with one occurrence of the separator between every two consecutive elements.
val make_indexes : 'a -> ('a -> int) * (int -> 'a) * ('a -> int)
Returns a pair of function import and export to assign a unique integer to a given value.
val last : 'a list -> 'a
Returns the last element of a list. Linear complexity.