Closed ProofOfKeags closed 2 years ago
Ok, the test suite actually should depend on aeson
since there are a bunch of test vectors we parse out of json documents.
ah yep. I need to add that to my workflow.
OK So this now checks out. Lotta work to maintain the json stuff. Does it actually buy us anything or can we move to make the test vectors into in-haskell values?
This PR should be squashed on merge.
Is there some way to simplify the process of parsing test vectors out of JSON encoded sources? Ideally the JSON code would be totally minimal and purpose built to deal with the test vectors. So we would not need e.g. NetBox and JsonBox.
Probably. However, this change was primarily concerned with removing aeson and mtl from the main library code. I didn't really audit whether the code itself was "optimal". Personally I don't like the fact that we are giving typeclass instances to ToJSON
and FromJSON
to these types solely for the test vectors, as there is no guarantee that there is a canonical representation type here. I'd be fine with handrolling a Parser a
for these types and using parseWith
on the actual reading.
Keep in mind that a future PR will be moving from QuickCheck
to hedgehog
though so I'd rather not spend too much effort on this code in this particular patch. Happy to revamp the test code once the hedgehog
patch is finished.
All right. I don't mind going back for a cleanup pass. The instances don't bother me much since they are confined to the test suite.
Actually I can revamp this code during the hedgehog patch.
Closes #17 and #19