@@ -1616,39 +1616,75 @@ instance (FromJSON a, FromJSON b, FromJSON c, FromJSON d, FromJSON e,
16161616 <*> parseJSONElemAtIndex 14 ary
16171617 {-# INLINE parseJSON #-}
16181618
1619+instance ToJSON1 Dual where
1620+ liftToJSON to = to . getDual
1621+ {-# INLINE liftToJSON #-}
1622+
1623+ liftToEncoding to = to . getDual
1624+ {-# INLINE liftToEncoding #-}
1625+
16191626instance ToJSON a => ToJSON (Dual a) where
1620− toJSON = toJSON . getDual
1627+ toJSON = toJSON1
16211628 {-# INLINE toJSON #-}
16221629
1623− toEncoding = toEncoding . getDual
1630+ toEncoding = toEncoding1
16241631 {-# INLINE toEncoding #-}
16251632
1633+instance FromJSON1 Dual where
1634+ liftParseJSON p = fmap Dual . p
1635+ {-# INLINE liftParseJSON #-}
1636+
16261637instance FromJSON a => FromJSON (Dual a) where
1627− parseJSON = fmap Dual . parseJSON
1638+ parseJSON = parseJSON1
16281639 {-# INLINE parseJSON #-}
16291640
1641+
1642+instance ToJSON1 First where
1643+ liftToJSON to = liftToJSON to . getFirst
1644+ {-# INLINE liftToJSON #-}
1645+
1646+ liftToEncoding to = liftToEncoding to . getFirst
1647+ {-# INLINE liftToEncoding #-}
1648+
16301649instance ToJSON a => ToJSON (First a) where
1631− toJSON = toJSON . getFirst
1650+ toJSON = toJSON1
16321651 {-# INLINE toJSON #-}
16331652
1634− toEncoding = toEncoding . getFirst
1653+ toEncoding = toEncoding1
16351654 {-# INLINE toEncoding #-}
16361655
1656+instance FromJSON1 First where
1657+ liftParseJSON p = fmap First . liftParseJSON p
1658+ {-# INLINE liftParseJSON #-}
1659+
16371660instance FromJSON a => FromJSON (First a) where
1638− parseJSON = fmap First . parseJSON
1661+ parseJSON = parseJSON1
16391662 {-# INLINE parseJSON #-}
16401663
1664+
1665+instance ToJSON1 Last where
1666+ liftToJSON to = liftToJSON to . getLast
1667+ {-# INLINE liftToJSON #-}
1668+
1669+ liftToEncoding to = liftToEncoding to . getLast
1670+ {-# INLINE liftToEncoding #-}
1671+
16411672instance ToJSON a => ToJSON (Last a) where
1642− toJSON = toJSON . getLast
1673+ toJSON = toJSON1
16431674 {-# INLINE toJSON #-}
16441675
1645− toEncoding = toEncoding . getLast
1676+ toEncoding = toEncoding1
16461677 {-# INLINE toEncoding #-}
16471678
1679+instance FromJSON1 Last where
1680+ liftParseJSON p = fmap Last . liftParseJSON p
1681+ {-# INLINE liftParseJSON #-}
1682+
16481683instance FromJSON a => FromJSON (Last a) where
1649− parseJSON = fmap Last . parseJSON
1684+ parseJSON = parseJSON1
16501685 {-# INLINE parseJSON #-}
16511686
1687+
16521688instance ToJSON Version where
16531689 toJSON = toJSON . showVersion
16541690 {-# INLINE toJSON #-}