Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add instances for Records using RowToList #37
I don't really have any strong feelings about how any of this library should work anymore, as I/we at SlamData use the slightly confusingly named
I think it's probably a reasonable thing to have though, yeah, since there's a sensible expected encoding and decoding from JSON.
It needs some explanation / docs really.
But mainly it has a bit of a different philosophy, codecs are values, and everything has to be defined explicitly.
One advantage is the codecs defined with the provided combinators are guaranteed to roundtrip, so you only need one definition.
The other thing is we want everything to be explicit, as we have a serialization format that we need to avoid breaking between versions - with the "automatic" instance-based approach sometimes changes to the types don't require changes to the codec instances, which led to inadvertent backwards-incompatible changes occasionally. (Plus there's some utils included for making "migration codecs" to upgrade from an old format to make it compatible with a new one).