val map_combine : 'a list -> 'b list -> ('a -> 'c) -> ('c * 'b) listval combine_array : 'a array -> 'b list -> ('a -> 'c) -> ('c * 'b) listval combine_array_append :
'a array ->
'b list ->
('c * 'b) list ->
('a -> 'c) ->
('c * 'b) listval map_snd : ('a * 'b) list -> ('b -> 'c) -> ('a * 'c) listval map_last : 'a list -> (bool -> 'a -> 'b) -> 'b listmap_last f xs will pass true to f for the last element, false otherwise. For empty list, it returns empty
val append_one : 'a list -> 'a -> 'a listval fold_right3 :
'a list ->
'b list ->
'c list ->
'd ->
('a -> 'b -> 'c -> 'd -> 'd) ->
'dval fold_left_with_offset :
'a list ->
'acc ->
int ->
('a -> 'acc -> int -> 'acc) ->
'accval same_length : 'a list -> 'b list -> boolval split_at : 'a list -> int -> 'a list * 'a listsplit_at n l will split l into two lists a,b, a will be of length n, otherwise, it will raise
val split_at_last : 'a list -> 'a list * 'asplit_at_last l It is equivalent to split_at (List.length l - 1) l
val filter_mapi : 'a list -> ('a -> int -> 'b option) -> 'b listval length_ge : 'a list -> int -> boollength xs = length ys + n
input n should be positive TODO: input checking
val length_larger_than_n : 'a list -> 'a list -> int -> boolval stable_group : 'a list -> ('a -> 'a -> bool) -> 'a list liststable_group eq lst Example: Input:
stable_group (=) [1;2;3;4;3]
Output:
[[1];[2];[4];[3;3]]
TODO: this is O(n^2) behavior which could be improved later
val find_first_not : 'a list -> ('a -> bool) -> 'a optionfind_first_not p lst if all elements in lst pass, return None otherwise return the first element e as Some e which fails the predicate
find_opt f l returns None if all return None, otherwise returns the first one.
val find_opt : 'a list -> ('a -> 'b option) -> 'b optionval find_def : 'a list -> ('a -> 'b option) -> 'b -> 'bval rev_iter : 'a list -> ('a -> unit) -> unitval for_all_snd : ('a * 'b) list -> ('b -> bool) -> boolval for_all2_no_exn : 'a list -> 'b list -> ('a -> 'b -> bool) -> boolfor_all2_no_exn p xs ys return true if all satisfied, false otherwise or length not equal
val split_map : 'a list -> ('a -> 'b * 'c) -> 'b list * 'c listf is applied follow the list order
val sort_via_array : 'a list -> ('a -> 'a -> int) -> 'a listval sort_via_arrayf : 'a list -> ('a -> 'a -> int) -> ('a -> 'b) -> 'b listval assoc_by_string : (string * 'a) list -> string -> 'a option -> 'aassoc_by_string default key lst if key is found in the list return that val, other unbox the default, otherwise assert false
val assoc_by_int : (int * 'a) list -> int -> 'a option -> 'aval concat_append : 'a list list -> 'a list -> 'a list