- Notifications
You must be signed in to change notification settings - Fork27
Open
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:
caseclassSub(@CsvName("first-name")firstName:String,@CsvName("the-age")age:Int)caseclassWhole(@CsvName("last-name")lastName:String,@CsvEmbedsub:Sub)// last-name, first-name, the-age// flintstone, fred, 42
Context:https://gitter.im/fs2-data/general?at=5f159b91a28d973192e7d07a
Doobie supports a similar structure