In collector.diesel:
Sequences support the || concatenation operator. However, for long series of concatenations, using || many times can be inefficient and imply lots of copying. The collector extensible sequence data structure supports accumulating sequences for latter concatenation in one fell swoop.
Collectors can be created (optionally with a non-binding guess as to
how many things will be collected together) using new_collector. The
infix && operation is the more common way to construct
collectors. Collectors are flattened into a vector form using
flat_vector
, and collectors of character sequences can be flattened
into a simple string using flat_string
. To illustrate the use of
collectors versus concatenation: