To reduce compile times of my project, I\'m caching certain type classes that are resolved by implicit lookups. This appears somewhat cumbersome though, because the straight for
Just for the sake of completeness: the shapeless macro in the accepted answer shadows its own definition in a way I didn't come up with. My particular problem could therefore be solved this way:
implicit val x: String = {
def x = ???
implicitly[String]
}