Inspect.Algebra.flex_break
flex_break
, go back to Inspect.Algebra module for more information.
Specs
flex_break(binary()) :: doc_break()
Returns a flex break document based on the given string
.
A flex break still causes a group to break, like break/1
,
but it is re-evaluated when the documented is rendered.
For example, take a group document represented as [1, 2, 3]
where the space after every comma is a break. When the document
above does not fit a single line, all breaks are enabled,
causing the document to be rendered as:
[1,
2,
3]
However, if flex breaks are used, then each break is re-evaluated when rendered, so the document could be possible rendered as:
[1, 2,
3]
Hence the name "flex". they are more flexible when it comes to the document fitting. On the other hand, they are more expensive since each break needs to be re-evaluated.
This function is used by container_doc/6
and friends to the
maximum number of entries on the same line.