mirror of
https://github.com/github/semantic.git
synced 2025-01-05 14:11:33 +03:00
Define ToJSONList instances over records.
This commit is contained in:
parent
a044e862b2
commit
3124447ad6
@ -72,6 +72,12 @@ instance ToJSON (Record '[]) where
|
||||
class ToJSONList t where
|
||||
toJSONValues :: t -> [Value]
|
||||
|
||||
instance (ToJSON h, ToJSONList (Record t)) => ToJSONList (Record (h ': t)) where
|
||||
toJSONValues (RCons h t) = toJSON h : toJSONValues t
|
||||
|
||||
instance ToJSONList (Record '[]) where
|
||||
toJSONValues _ = []
|
||||
|
||||
|
||||
instance (Eq h, Eq (Record t)) => Eq (Record (h ': t)) where
|
||||
RCons h1 t1 == RCons h2 t2 = h1 == h2 && t1 == t2
|
||||
|
Loading…
Reference in New Issue
Block a user