From e37d60e44730f397bbf53aa1425836b7b8ced3f1 Mon Sep 17 00:00:00 2001 From: autonym8 Date: Thu, 6 Jun 2024 14:48:41 +0200 Subject: [PATCH] Using coerce instead of getters --- src/Data/Aeson/Types/ToJSON.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Data/Aeson/Types/ToJSON.hs b/src/Data/Aeson/Types/ToJSON.hs index 30056337..3fea324c 100644 --- a/src/Data/Aeson/Types/ToJSON.hs +++ b/src/Data/Aeson/Types/ToJSON.hs @@ -2122,14 +2122,14 @@ instance ToJSON a => ToJSON (Monoid.Product a) where omitField = omitField1 instance ToJSON Monoid.All where - toJSON = toJSON . Monoid.getAll - toEncoding = toEncoding . Monoid.getAll - omitField = omitField . Monoid.getAll + toJSON = (toJSON :: Bool -> Value) . coerce + toEncoding = (toEncoding :: Bool -> Encoding) . coerce + omitField = (omitField :: Bool -> Bool) . coerce instance ToJSON Monoid.Any where - toJSON = toJSON . Monoid.getAny - toEncoding = toEncoding . Monoid.getAny - omitField = omitField . Monoid.getAny + toJSON = (toJSON :: Bool -> Value) . coerce + toEncoding = (toEncoding :: Bool -> Encoding) . coerce + omitField = (omitField :: Bool -> Bool) . coerce instance ToJSON1 Monoid.First where liftToJSON o t to' = liftToJSON o t to' . Monoid.getFirst