diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index 101029b4c..742ef032c 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -99,8 +99,11 @@ instance ToJSONFields Category where instance ToJSONFields a => ToJSONFields (Maybe a) where toJSONFields = maybe [] toJSONFields -instance (ToJSONFields a, ToJSONFields (f (Term f a))) => ToJSONFields (Term f a) where - toJSONFields term = let a :< f = runCofree term in toJSONFields a <> toJSONFields f +instance (ToJSONFields a, ToJSONFields (f (Cofree f a))) => ToJSONFields (Cofree f a) where + toJSONFields = toJSONFields . runCofree + +instance (ToJSONFields a, ToJSONFields (f b)) => ToJSONFields (CofreeF f a b) where + toJSONFields (a :< f) = toJSONFields a <> toJSONFields f instance ToJSON a => ToJSONFields (SplitPatch a) where toJSONFields (SplitInsert a) = [ "insert" .= a ]