difflicious icon indicating copy to clipboard operation
difflicious copied to clipboard

Generalized "disjoint union" differ (Decouple from Maganolia)

Open jatcwang opened this issue 11 months ago • 0 comments

Currently, sealed trait differ are really intertwined with magnolia.

This needs to change if we want to support Differs for:

  • "disjoint unions"-like types where we don't have access to the underlying subclasses (e.g. circe Json type)
  • Scala 3 union types

Idea:

In generalized disjoint union differ, we perform a test for each possible member of the union (this is akin to pattern matching on subclasses of a sealed trait), and if the test is successful, we will execute the diff function for that subclass.

jatcwang avatar Feb 04 '25 17:02 jatcwang