diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index 1ad0b9ddc..86343e12b 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -96,6 +96,9 @@ instance ToJSONFields Range where instance ToJSONFields Category where toJSONFields c = ["category" .= case c of { Other s -> s ; _ -> toS c }] +instance ToJSONFields a => ToJSONFields (Maybe a) where + toJSONFields = maybe [] toJSONFields + lineFields :: (ToJSON leaf, ToJSON (Record fields), HasField fields Category, HasField fields Range, KeyValue kv) => Int ->