Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
dhall diff
slightly misbehaves when diffing the following expression withitself:
... producing the following diff:
This is because there are two places in the
Dhall.Diff
module responsiblefor comparing lists:
diffApplicationExpression
, which compares two lists with at leastone type annotation between them
diffPrimitiveExpression
, which compares two lists if neither one hasa type annotation
Those cases exhaustively cover all possible pairs of lists, but there was a
third (incorrect) fallback case that prematurely gave up and displayed them as
different. This fallback would trigger when applying a function to an empty
list, since the diffing algorithm wouldn't have a chance to return back to the
top-level
diffExpression
and try to compare the lists correctly indiffApplicationExpression
.After this change, the diff now doesn't include a spurious difference: