haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

instances for Down from Data.Ord? #983

Closed imuli closed 1 year ago

imuli commented 1 year ago

I occasionally run into an instance where I want to use Down in a data type, use genericToJSON, and end up needing to write the orphan instances (or make my own type for it):

deriving instance ToJSON a => ToJSON (Down a)
deriving instance FromJSON a => FromJSON (Down a)

It's not that big of a deal, but it would be nice if these were included, like most other types in base.