Please log in to watch this conference skillscast.
But not everything is rosy. Case classes come with restrictions, some of which are essential, some not. And they have some characteristics, again some essential, some not, which are not always entirely appropriate or desirable. This has led to the often expressed desire to be able to pick and choose or otherwise customize case class features: case classes a la carte.
Unfortunately this has seemed to require changes to the Scala compiler which for various reasons have been perceived to be too difficult or too risky to attempt. The arrival of macros, macro annotations in particular, briefly raised the prospect that case classes a la carte might again be on the table. But macro annotations are not yet available in a production ready Scala compiler and might never be.
But all is not lost. Generating the scaffolding for case classes is a generic programming problem, and the fact that one solution to that problem is hard coded into scalac doesn't preclude other approaches from being applied. To that end I will demonstrate one way of tackling this problem using the generic programming library shapeless, and show some of the exciting new possibilities this opens up ... crucially in the context of current (ie. 2.10.x and 2.11.x) Scala compilers.
YOU MAY ALSO LIKE:
- Grackle – GraphQL Server (SkillsCast recorded in October 2022)
- London Java Community Unconference (in London on 5th December 2022)
- LJC Live with Andrey Breslav - Shoulders of Giants: Languages Kotlin learned from (in London on 12th December 2022)
- Taming the Context Beast (SkillsCast recorded in October 2022)
- The Middle Way for Static Typing in Spark DataFrames (SkillsCast recorded in October 2022)