mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Distribute ToJSONFields through Maybe.
This commit is contained in:
parent
5beff62cbc
commit
5afd5b8fa6
@ -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 ->
|
||||
|
Loading…
Reference in New Issue
Block a user