More.ListLists.
include module type of Stdlib.Listcons_if true v vs is (v :: vs) and cons_if false v vs is vs.
distinct cmp l are the distinct elements of l according to cmp. The first occurence of an element in l is kept and their order in l is preserved.
val classify :
?cmp_elts:('a -> 'a -> int) ->
?cmp_classes:('b -> 'b -> int) ->
classes:('a -> 'b list) ->
'a list ->
('b * 'a list) listclassify ~cmp_elts ~cmp_classes ~classes els bins elements els into classes as determined by classes. cmp_elts is used to compare elements and cmp_classes to compare classes, both default to compare.
val fold_stop_on_error :
('a -> 'b -> ('b, 'e) Stdlib.result) ->
'a list ->
'b ->
('b, 'e) Stdlib.resultfold_stop_on_error f l acc folds f on the elements of l starting with acc and stops at the first error.
iter_stop_on_error f acc applies f to the elements of l and stops at the first error.
val iter_iter_on_error :
error:((unit, 'e) Stdlib.result -> unit) ->
('a -> (unit, 'e) Stdlib.result) ->
'a list ->
(unit, int) Stdlib.resultiter_iter_on_error ~error f applies f to the elements of l and invokes error on those that do. Returns Ok () if there were no errors and Error count, with count the number of errors if there were some.