a little gem lurking in the magnolia docs: "however, there is the flexibility to provide additional type parameters or additional implicit parameters to the definition". Adding additional implicits lets you use other typeclasses in the derivation. @propensive
If you want, you can even have a different Magnolia generic derivation provide the implementation for the second typeclass.
-
-
In my use case I would have to have def combine[T](caseClass: CaseClass[InputTC, T]): OutputTC[T] so CaseClass captures instances of one TC and produces an instance of other TC. Maybe this works right now, will have to check.
-
That's a bit more complicated, but it might work, with some effort. Derivation can take place in a type-dependent context. It's not exactly the same, but have a look at this example: https://github.com/propensive/magnolia/blob/master/examples/shared/src/main/scala/show.scala …
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.