on develop help sign in
Replacing use of Object mempty to avoid ambiguous Object export
47fe2cdBrendan Hay
core/src/Network/Google/Data/JSON.hs+4−1
@@ -16,8 +16,8 @@ module Network.Google.Data.JSON
16 , FromJSON (..)
16 , FromJSON (..)
17 , ToJSON (..)
17 , ToJSON (..)
18
18
19− , Value (Object)
20 , withObject
19 , withObject
20+ , emptyObject
21 , object
21 , object
22
22
23 , (.=)
23 , (.=)
@@ -33,6 +33,9 @@ import Servant.API
33
33
34type JSONValue = Value
34type JSONValue = Value
35
35
36+emptyObject :: Value
37+emptyObject = Object mempty
38+
36parseJSONText :: FromText a => String -> Value -> Parser a
39parseJSONText :: FromText a => String -> Value -> Parser a
37parseJSONText n = withText n (maybe (fail n) pure . fromText)
40parseJSONText n = withText n (maybe (fail n) pure . fromText)
38
41
gen/src/Gen/Syntax.hs+1−1
@@ -273,7 +273,7 @@ jsonDecls g p (Map.toList -> rs) = [from, to]
273 . app (var "catMaybes")
273 . app (var "catMaybes")
274 . listE
274 . listE
275
275
276− none = paren $ app (var "Object") (var "mempty")
276+ none = var "emptyObject"
277
277
278 encode (l, s)
278 encode (l, s)
279 | TMaybe {} <- _type s = infixApp (paren (app n o)) "<$>" a
279 | TMaybe {} <- _type s = infixApp (paren (app n o)) "<$>" a