You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so let's imagine that we want to transform Person into something else but the fields in the Address case class don't quite align. In ducktape 0.1.x to configure fields of the Address field we'd have to do a lot of gymnastics (a separate and explicit Transformer for Address -> DestTyle, an ugly transformation in Field.computed(_.address, _.address.into[DestType]...), generally it is not a good experience.
So currently
ducktape
is only able to configure fields/cases of the top-level entity it operates on eg.so let's imagine that we want to transform Person into something else but the fields in the Address case class don't quite align. In
ducktape 0.1.x
to configure fields of the Address field we'd have to do a lot of gymnastics (a separate and explicit Transformer for Address -> DestTyle, an ugly transformation in Field.computed(_.address, _.address.into[DestType]...), generally it is not a good experience.In
ducktape 0.2.x
we should be able to just doField.computed(_.address.city, _.doWhateverYouNeedToDoHere)
What's more we should also be able to configure fields inside coproduct cases with something like:
Field.computed(_.someCoproduct.at[SomeCoproduct.Case1].field1, _.doSomethingHere)
or even configure cases themselves with
Case.const(_.someCoproduct.at[SomeCoproduct.Case1], SomeCoproduct.Case1(12345))
that'd also mean 0.2.x should deprecate the old way of configuring Cases (but still keep them for sourcecompat until at least 0.3.x)
The text was updated successfully, but these errors were encountered: