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

Distribute ToJSONFields through Maybe.

This commit is contained in:
Rob Rix 2017-04-27 17:56:24 -04:00
parent 5beff62cbc
commit 5afd5b8fa6

View File

@ -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 ->