Skip to content

Extensible diff types #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 9, 2025
Merged

Extensible diff types #9

merged 14 commits into from
Apr 9, 2025

Conversation

fpringle
Copy link
Owner

@fpringle fpringle commented Apr 8, 2025

In this PR we let the user extend the built-in diff types with custom diffs via the SpecialDiff class.

This also subsumes the previous special list diff constructors DiffList and DiffNonEmpty.


  • [Refactor] move Doc and RenderOpts to Type module
  • Export listDiffErrorDoc
  • Remove renderListDiffError{With}
  • Class for defining special cases for Diff, when a type doesnt quite fit the normal DiffError constructors
  • Now we can implement SpecialDiff for lists and NonEmpty lists
  • New modules for exporting Special stuff
  • Update test suite
  • Move NonEmpty instance to Special.List
  • [Minor] export diffErrorNestedDoc
  • specialDiffVia can be used to implement specialDiff
  • [Refactor] Better organisation in Type.hs
  • Replace specialDiffVia with gspecialDiffNested, which used functions from Generics.SOP.GGP
  • [Unrelated] Rename showR -> showB
  • Update docs

@fpringle fpringle self-assigned this Apr 8, 2025
@fpringle fpringle marked this pull request as ready for review April 8, 2025 20:41
@fpringle fpringle merged commit fb8d827 into main Apr 9, 2025
10 checks passed
@fpringle fpringle deleted the special-case branch April 9, 2025 08:48
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.

1 participant