mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Define a ToJSONFields instance for JSONFields.
This commit is contained in:
parent
fb26ef6b34
commit
475e12d038
@ -40,7 +40,10 @@ instance (ToJSONFields1 f, ToJSONFields1 g) => ToJSONFields1 (f :*: g) where
|
||||
|
||||
newtype JSONFields a = JSONFields { unJSONFields :: a }
|
||||
|
||||
instance (ToJSONFields a) => ToJSON (JSONFields a) where
|
||||
instance ToJSONFields a => ToJSONFields (JSONFields a) where
|
||||
toJSONFields = toJSONFields . unJSONFields
|
||||
|
||||
instance ToJSONFields a => ToJSON (JSONFields a) where
|
||||
toJSON = object . toJSONFields . unJSONFields
|
||||
toEncoding = pairs . mconcat . toJSONFields . unJSONFields
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user