Skip to content

Refactor getContextDiffNumbered with separate Nothing equation#27

Open
ninioArtillero wants to merge 1 commit into
seereason:masterfrom
tweag:nothing-equation
Open

Refactor getContextDiffNumbered with separate Nothing equation#27
ninioArtillero wants to merge 1 commit into
seereason:masterfrom
tweag:nothing-equation

Conversation

@ninioArtillero
Copy link
Copy Markdown
Contributor

@ninioArtillero ninioArtillero commented May 25, 2026

Adding an extra equation for the Nothing case lifts the burden of handling it at doPreffix and doSuffix, resulting in clearer code and avoiding unnecessary traversals of getGroupedDiff a0 b0 output. This is possible because the Nothing case resulted in all elements being preserved, particularly no Both being split, and thus producing a single hunk with the output of getGroupedDiff.

It is also of note that calls to max were already no-ops as drop truncates negatives to 0.

Comment thread src/Data/Algorithm/DiffContext.hs Outdated
@ninioArtillero ninioArtillero marked this pull request as ready for review May 26, 2026 01:25
@ninioArtillero ninioArtillero changed the title Rebase getContextDiffNumbered with separate Nothing equation Refactor getContextDiffNumbered with separate Nothing equation May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants