module Lists:sig..end
Additional functions to the List module
val init : int -> (int -> 'a) -> 'a listList.init n f returns a list of n elements
that were created by calling the function f
with parameter from 0 to n-1
val return : ('a -> 'b option) -> 'a list -> 'bsimilar to List.find but returns
the result of the function application
val return_opt : ('a -> 'b option) -> 'a list -> 'b optionsame than List.return but exceptionless
val map_opt : ('a -> 'b option) -> 'a list -> 'b listList.map and List.filter in one round
val assoc_err : 'a -> ('a * 'b) list -> err:string -> 'bsame than List.assoc but with a custom error message
val assoc_def : 'a -> ('a * 'b) list -> def:'b -> 'bsame than List.assoc but with a default value
val assoc_replace : 'a -> 'b -> ('a * 'b) list -> ('a * 'b) listreplace the associated value for the first key in an association list
Failure "assoc_replace" if the key doesn't existval take : int -> 'a list -> 'a listtakes the n-th first elements of the list
Exception: Failure "take",
if there are less than n elements availableval drop : int -> 'a list -> 'a list
val uniq : 'a list -> 'a list
val index : 'a -> 'a list -> int list
val starts_with : 'a list -> 'a list -> bool