This is the default layout algorithm, and it is used by
show,
putDoc and
hPutDoc.
layoutPretty commits to rendering something in a
certain way if the next element fits the layout constraints; in other
words, it has one
SimpleDocStream element lookahead when
rendering. Consider using the smarter, but a bit less performant,
layoutSmart algorithm if the results seem to run off
to the right before having lots of line breaks.