OpamStd.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.
Like List.find
, but returning option instead of raising
Returns the first non-None
value returned by the passed function on the elements of the passed 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
Like List.find
, but returning option instead of raising
Like List.assoc
, but as an option, and also returns the list with the binding removed, e.g. equivalent to (List.assoc_opt x l, List.remove_assoc x l)
(but tail-recursive and more efficient)