…lookahead to rank the documents beneath a `Union` by their line length to miminize the number of lines printed. This leads to prettier and more compact formatting. The ribbon width option has been removed from `renderSmart` because it is obviated by the lookahead and ranking mechanisms. * Tests comparing the behavior of `renderPretty` and `renderSmart`. * Tests for `columns` and `ribbon`.
…rmatted as: ``` [1, 2, 3] ``` and multiline lists are now formatted as ``` [ 1 , 2 , 3 ]
1) Addition of the @Fail@ primitive, representing a document that can not be rendered. @Fail@ is a left unit of @Union@ and does not `fit' into any page width. It allows the construction of documents that can not be flattened, for example comments that must be followed by a newline. It also alows the construction of hard lines, which are guaranteed to be rendered as a newline. 2) Addition of the @FlatAlt@ primitive, representing a document which changes under flattening. This unifies the linebreak combinators and allows for more flexible linebreak to be created, for example linebreaks in a do-block that should become semicolons when flattened. 3) Addition of a more intelligent rendering algorithm, which partially solves the lookahead problem caused by deeply nested structures where a single-line lookahead will not always allow a document to be formatted within the pagewidth.