File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2362,6 +2362,20 @@ instance (FromJSON a) => FromJSON (Monoid.Product a) where
2362
2362
2363
2363
omittedField = omittedField1
2364
2364
2365
+ instance FromJSON Monoid. All where
2366
+ parseJSON = coerce . (parseJSON :: Value -> Parser Bool )
2367
+
2368
+ parseJSONList = coerce . (parseJSONList :: Value -> Parser [Bool ])
2369
+
2370
+ omittedField = coerce (omittedField :: Maybe Bool )
2371
+
2372
+ instance FromJSON Monoid. Any where
2373
+ parseJSON v = coerce (parseJSON v :: Parser Bool )
2374
+
2375
+ parseJSONList v = coerce (parseJSONList v :: Parser [Bool ])
2376
+
2377
+ omittedField = coerce (omittedField :: Maybe Bool )
2378
+
2365
2379
2366
2380
instance FromJSON1 Monoid. First where
2367
2381
liftParseJSON o = coerce (liftParseJSON @ Maybe o)
Original file line number Diff line number Diff line change @@ -2120,6 +2120,16 @@ instance ToJSON a => ToJSON (Monoid.Product a) where
2120
2120
toEncoding = toEncoding1
2121
2121
omitField = omitField1
2122
2122
2123
+ instance ToJSON Monoid. All where
2124
+ toJSON = toJSON . Monoid. getAll
2125
+ toEncoding = toEncoding . Monoid. getAll
2126
+ omitField = omitField . Monoid. getAll
2127
+
2128
+ instance ToJSON Monoid. Any where
2129
+ toJSON = toJSON . Monoid. getAny
2130
+ toEncoding = toEncoding . Monoid. getAny
2131
+ omitField = omitField . Monoid. getAny
2132
+
2123
2133
instance ToJSON1 Monoid. First where
2124
2134
liftToJSON o t to' = liftToJSON o t to' . Monoid. getFirst
2125
2135
liftToEncoding o t to' = liftToEncoding o t to' . Monoid. getFirst
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ roundTripTests =
89
89
, testProperty " Monoid.First" $ roundTripEq @ (Monoid. First Int )
90
90
, testProperty " Monoid.Sum" $ roundTripEq @ (Monoid. Sum Int )
91
91
, testProperty " Monoid.Product" $ roundTripEq @ (Monoid. Product Int )
92
+ , testProperty " Monoid.All" $ roundTripEq @ Monoid. All
93
+ , testProperty " Monoid.Any" $ roundTripEq @ Monoid. Any
92
94
, testProperty " Strict Pair" $ roundTripEq @ (S. Pair Int Char )
93
95
, testProperty " Strict Either" $ roundTripEq @ (S. Either Int Char )
94
96
, testProperty " Strict These" $ roundTripEq @ (S. These Int Char )
You can’t perform that action at this time.
0 commit comments