1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Define a ToJSON instance for TermF.

This commit is contained in:
Rob Rix 2017-09-10 22:21:47 -04:00
parent 6186ef3ae7
commit 48a4a5f6ce

View File

@ -140,3 +140,7 @@ instance (ToJSONFields a, ToJSONFields1 f) => ToJSONFields (Term f a) where
instance (ToJSON b, ToJSONFields a, ToJSONFields1 f) => ToJSONFields (TermF f a b) where instance (ToJSON b, ToJSONFields a, ToJSONFields1 f) => ToJSONFields (TermF f a b) where
toJSONFields (a :< f) = toJSONFields a <> toJSONFields1 f toJSONFields (a :< f) = toJSONFields a <> toJSONFields1 f
instance (ToJSON b, ToJSONFields a, ToJSONFields1 f) => ToJSON (TermF f a b) where
toJSON = object . toJSONFields
toEncoding = pairs . mconcat . toJSONFields