Don't fail when rendering an Unbounded layout of a grouped Line#92
Don't fail when rendering an Unbounded layout of a grouped Line#92sjakobi wants to merge 1 commit intohaskell-prettyprinter:masterfrom
Unbounded layout of a grouped Line#92Conversation
| -> SimpleDocStream ann -- ^ Choice B. | ||
| -> SimpleDocStream ann -- ^ Choice A if it fits, otherwise B. | ||
| selectNicer (FittingPredicate fits) lineIndent currentColumn x y | ||
| | isFail x = y |
There was a problem hiding this comment.
I was wondering whether we need to worry about SFail appearing elsewhere than the beginning of a left Union branch. At least fuse doesn't seem to "hide" the Fail in a (Union Fail x) though:
There was a problem hiding this comment.
isFail is False if the document fails, but that’s the same thing the two fitting predicates (for layoutPretty and layoutSmart) yield. What does the explicit isFail clause change?
There was a problem hiding this comment.
I've explained this in #91 (comment).
The short version is that both fitting predicates shortcut to True when the maxWidth is Nothing – which is the case with Unbounded layout options.
|
This doesn't seem to fix the issue completely: If I change
|
|
Maybe we should instead remove the shortcuts from the fitting predicates… |
|
For reference, these are some of of the test failures: |
|
Actually I wonder whether the current design with IMHO it would be better to have a separate function |
|
Superseded by #97. |
FixesDoesn't fix #91.TODO: