Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prettyprinter/src/Data/Text/Prettyprint/Doc/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ changesUponFlattening :: Doc ann -> Maybe (Doc ann)
changesUponFlattening = \doc -> case doc of
FlatAlt _ y -> Just (flatten y)
Line -> Just Fail
Union x _ -> changesUponFlattening x <|> Just x
Union x _ -> Just x
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea:

Suggested change
Union x _ -> Just x
Union x _ -> Nothing

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no. This causes the fusion tests to fail with the classic

»SFail« must not appear in a rendered »SimpleDocStream«.

I'm not quite sure why though. Proper shrinking and diagnostic output would help… :/

Nest i x -> fmap (Nest i) (changesUponFlattening x)
Annotated ann x -> fmap (Annotated ann) (changesUponFlattening x)

Expand Down