-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework
Update
JSON encoders and decoders
This is an attempt to clarify the various `Encoder` and `Decoder` instances that make up `Encoder[Update]` and `Decoder[Update]` that are used by the `PullRequestRepository` for writing/reading updates to/from disk. I had a hard time understanding what was going on because * nearly all of the instances are implicit (for derivation) but only the instances for `Update` are used by other parts of the program * semi-derivation was mixed with manual modifications * decoders for compatibility with old caches depend on derivation and are defined ad-hoc In this change I tried to bring more clarity to these instances by * giving compatibility decoders their own name * forgoing semi-derivation and define all instances manually. IMHO this makes it easier to evolve them if there are compatibility constraints because of old caches * making every instance except `Encoder[Update]` and `Decoder[Update]` private and non-implicit * only testing them via the public `Encoder[Update]` and `Decoder[Update]` instances This might be a controversial change and I ackknowledge that one gains more understanding by doing this rework. I'm therefore biased that these changes actually clarify anything. I'm fine with letting this age for a while before merging to see if I still feel this is an improvement then.
- Loading branch information
Showing
3 changed files
with
354 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.