Module OpamStd.List
val cons : 'a -> 'a list -> 'a list
val concat_map : ?left:string -> ?right:string -> ?nil:string -> ?last_sep:string -> string -> ('a -> string) -> 'a list -> string
Convert list items to string and concat.
sconcat_map sep f x
is equivalent to String.concat sep (List.map f x) but tail-rec.
val find_opt : ('a -> bool) -> 'a list -> 'a option
Like
List.find
, but returning option instead of raising
val to_string : ('a -> string) -> 'a list -> string
val remove_duplicates : 'a list -> 'a list
Removes consecutive duplicates in a list
val find_map : ('a -> 'b option) -> 'a list -> 'b
Returns the first non-
None
value returned by the passed function on the elements of the passed list.- raises Not_found
if all of them yield
None
val insert_at : int -> 'a -> 'a list -> 'a list
Inserts a value at the given index (starting from 0) in the list (start or end if index < 0 or > length respectively). Not tail-recursive