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:
parent
6186ef3ae7
commit
48a4a5f6ce
@ -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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user