aeson-modern-tojson

Provide a handy way for derving ToJSON proprely.

https://github.com/blackheaven/aeson-modern-tojson#readme

Latest on Hackage:0.2.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

ISC licensed by Gautier DI FOLCO

Provide a newtype to be used with DerivingVia to correctly derive ToJSON.

As simple as:

data W = W Int Int
deriving stock (Generic)
deriving (ToJSON) via (GenericallyToJSONToEncoding W)