This function replaces surround_many as it attempts to fit
as many algebra documents on the same line if and only if
all documents are simple.
A simple document is a document made only of strings,
without breaks. This allows us to print lists of complex
structures with one element per line but lists of integers
or lists of atoms still try to fit as much as possible in a
single-line.
There are two main optimizations:
1. We have optimized Module.concat/2 (it is roughly 100% faster)
2. We have optimized rendering of Inspect.Algebra by skipping
the intermediate s_doc representation. This reduces memory
allocation and skips one extra pass on rendering.
This implementation slightly changes the semantic of Lindig's algorithm
to allow elements that belong to the same group to be printed together
in the same line, even if they do not fit the line fully. This was achieved
by changing `:break` to mean a possible break and `:flat` to force a flat
structure. Then deciding if a break works as a newline is just a matter
of checking if we have enough space until the next break that is not
inside a group (which is still flat).