Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Idiom # 53: Join a list of strings

See programming-idioms.org:

Code

fold is the feature of choice to join elements of a set into a value of the element type. For type string, such operations are defined in feature strings. For concatenation with a separator, strings.concat sep is the operation to use.







Mathematically speaking, such an operation is called a monoid. This is why the type of the argument of fold is Monoid, while the operations declared in strings inherit from Monoid.

Running Example