-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Milestone
Description
When deriving shapeless implicits for very wide case classes, sometimes the compiler fails with a stack overflow error. One technique to avoid this is to nest the case classes, which is isomorphic to the flattened structure.
Something like this:
case class Sub(
@CsvName("first-name") firstName: String,
@CsvName("the-age") age: Int
)
case class Whole(
@CsvName("last-name") lastName: String,
@CsvEmbed sub: Sub
)
// last-name, first-name, the-age
// flintstone, fred, 42Context: https://gitter.im/fs2-data/general?at=5f159b91a28d973192e7d07a
Doobie supports a similar structure