roc
roc copied to clipboard
Generic `join_with` function
In a Zulip conversation, @rtfeldman suggested a List.join_with to complement the existing Str.join_with:
Str.join_with : List(Str), Str -> Str
List.join_with : List(item), item -> item
where [item.join_with : List(item), item -> item]
The immediate context was me wanting to call join_with on a List, which is currently impossible since join_with is a Str function:
my_list.join_with(" ") # missing method error!
Similar additions to List would be useful for the Str.from_utf* functions too, since they also operate on a List.
This exists now!