dimitri-xyz / haskell-coinbase-pro

A Haskell client for the Coinbase Pro API
MIT License
11 stars 6 forks source link

Re-write Aeson instances #23

Open ericpashman opened 4 years ago

ericpashman commented 4 years ago

As I've noted previously, our Aeson instances should really implement the newer toEncoding(http://hackage.haskell.org/package/aeson-1.4.7.1/docs/Data-Aeson.html#v:toEncoding) interface, which is much faster than encoding via toJSON. We should be able to derive these generically with genericToEncoding in much the same way we've been using genericToJSON.

I also noticed as I was tracking down the test failures on the REST side of the library that there seem to be some hand-coded Aeson instances there that can be replaced with generically derived instances, much as we just did with the hand-coded instances I originally wrote for the WebSocket types.

These changes should be fairly straightforward. I'll try to get to them soon.