Repository navigation
A dash of API sugar to simplify summoning of implicit codec. - #2030
Conversation
Allows `AvroRecordCodec[Tile]` instead of `implicitly[AvroRecordCodec[Tile]]`, a pattern used a lot in the avro2spark PoC.
|
I like that idea, but mb to have a better name for it? like // circe styled example
import AvroRecordCodec._
val codec: AvroRecordCodec[Tile] = deriveCodec |
|
I see it more like a type-level factory method. Like the |
|
In an interesting play on words, it feels like That being said, it does do the work of an object apply; it creates the thing that is the type of the companion object. If it's an established pattern that wouldn't throw people off, I'd say this change is cool. Should it be applied more broadly? |
|
It's consistent with object apply for sure. 👍 to making this code-base standard. Won't be able to apply to things outside our control like |
|
Apologies, pressed the wrong button trying to cancel my comment. In general, if this pattern means an increase in boilerplate and an increase in the number of entries for "machinery classes" that get rendered into Scaladocs, then I'm against it. |
|
FWIW, it's also the pattern/convention used by avro4s. Just to be clear, I'm primarily interested in it just for this class; no stake in whether it's used more broadly. |
Allows
AvroRecordCodec[Tile]instead ofimplicitly[AvroRecordCodec[Tile]], a pattern used a lot in the avro2spark PoC.