Skip to content

Diffx 0.4.0

Compare
Choose a tag to compare
@ghostbuster91 ghostbuster91 released this 30 Dec 08:46
· 441 commits to master since this release

Finally diffx has semi-auto derivation which will prevent you from accidentally using auto derivation which can be quite heavy for the compiler.

With the derivation refactor comes a slight improvement to Derived mechanism. Diff is again a top level derived typeclass, which means that there is no need in wrapping an instance of it with Derived when overriding already existed instance. However, the Derived part isn't gone, as it is still useful when modifying summoned typeclass.

Migration guide

If you want to keep using auto derivation, you will have to add either import com.softwaremill.diffx.generic.auto._ or extend DiffDerivation .
Semi-auto derivation is now enabled by default, so there are no additional steps necessary, apart from providing the missing instances ;)

Known issues

Due to the changes in derivation mechanism one issue come up and remains unresolved. Currently, it will be impossible to modify an instance of diffx for given base trait and return it to the implicit scope. See softwaremill/magnolia#277 for details.

Limitations

It is not possible to summon Derived[Diff[Set[T]]] (or any other instance which comes from library) as now the generic derivation of derived type classes calls magnolia directly. However it should be possible to replace all such calls with direct calls for given instances e.g. diffForSet[T,Set]