roc icon indicating copy to clipboard operation
roc copied to clipboard

Generic `join_with` function

Open fpsvogel opened this issue 1 month ago • 1 comments

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!

fpsvogel avatar Nov 28 '25 04:11 fpsvogel

Similar additions to List would be useful for the Str.from_utf* functions too, since they also operate on a List.

fpsvogel avatar Dec 01 '25 14:12 fpsvogel

This exists now!

rtfeldman avatar Dec 25 '25 00:12 rtfeldman