@hackage / aeson-modern-tojson

Provide a handy way for derving ToJSON proprely.

Latest0.2.0.0

About

Metadata

  • Last updated , by gdifolco
  • License ISC
  • Categories JSON, Web Development, Text Processing
  • Maintained by: gautier.difolco@gmail.com

  • Lottery factor: 0

Links

Installation

Readme

aeson-modern-tojson

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)
data X = X Int Int
    deriving stock (Generic)
    deriving (ToJSON) via (GenericallyToEncoding X)