-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support for mapping multiple case classes #115
Comments
Having case class that combines containers ( |
Do you think this will be implemented sometime soon? Had a need for it a few times and used hacks but I have a feeling I’ll have a blocker in the next month or two and this could really come in handy |
@ittaiz many people ask for this feature recently - I think it should be next top priority. But it requires a lot of time to design it correctly, so I can't guarantee any fixed time frame. |
Sure thing, I complete understand.
I appreciate the intent and thank you for your work!
…On Fri, 3 Apr 2020 at 19:14 Piotr Krzemiński ***@***.***> wrote:
@ittaiz <https://github.com/ittaiz> many people ask for this feature
recently - I think it should be next top priority. But it requires a lot of
time to design it correctly, so I can't guarantee any fixed time frame.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQQF4ILFPXGK4BBOMBDG3RKYDPNANCNFSM4IA5QDOQ>
.
|
Ah, yeah, this is the feature I've been looking for. I imagine it's on the hard side to implement. Many thanks for your work on chimney @MateuszKubuszok |
I have some idea how to do it, but it will be a significant amount of work. I was thinking about prioritizing 1.0.0-RC first, to not delay it anymore, and then( later in 2024) starting to work on such merging transformation (it would allow us to internally reimplement
I have some an idea how to do it, but it would require refactoring a few sensitive pieces of code, writing a bit more pieces of a new code, and creating a tons of tests to avoid feature interaction bugs, because at this point it's really easy to write code which might look okayish, pass a simple test, compile (obviously) but provide an unexpected behavior when combined with some other feature. So I am planning to work on it somewhere in 2024, but I have no idea how much time I'll have so I am not committing to any ETA. |
Yeah, I had gotten stuck on this issue about 4 years ago IIRC, and returned to the same problem recently. Below is my best effort to make something like this work today (leveraging some tools I'm sure you'd rather not add to import io.scalaland.chimney.dsl._
import org.scalacheck.ScalacheckShapeless._
import org.scalacheck.Arbitrary
case class X(a: Int)
case class Y(b: Int)
case class Z(a: Int, b: Int)
val x = X(1)
val y = Y(2)
val z = Arbitrary.arbitrary[Z]
.sample
.get
.patchUsing(x)
.patchUsing(y) |
Would be great to have this feature, exactly what I'm looking for. Any updates on this? |
Not really. To implement it we'd have to:
All of that would have to be made in such a way that it would not break with special cases handling for:
which means that it would be probably 1-2 weeks of full-time development of PoC (and by full-time I mean 40h a week), next 2 for writing unit tests for every single case when things might get difficult, then another week or two for fixing errors. While it's perfectly doable (and not a rocket science, it requires mostly an attention to detail and patience), I don't see the capacity (nor feel the urge) anytime soon to sink in another 1-2 month of free full-time work. EDIT: Just to be clear, I would love Chimney to have this and other features, and I am very happy that people are interested in it, but I am simply too exhausted from the last several months and I would gladly let someone else drive the project. |
I was about to open a ticket for "just that". Thank you so much for doing Chimney! |
Presuming I had the following:
It would be nice to do something like either of the following:
Or perhaps:
The text was updated successfully, but these errors were encountered: