1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 14:11:33 +03:00

Move the ToJSONFields instance for Maybe into Data.JSON.Fields.

This commit is contained in:
Rob Rix 2017-09-09 17:23:14 +01:00
parent d7a5ea152d
commit c1b521ab9b
2 changed files with 3 additions and 3 deletions

View File

@ -9,3 +9,6 @@ class ToJSONFields a where
instance ToJSONFields a => ToJSONFields (Join (,) a) where
toJSONFields (Join (a, b)) = [ "before" .= object (toJSONFields a), "after" .= object (toJSONFields b) ]
instance ToJSONFields a => ToJSONFields (Maybe a) where
toJSONFields = maybe [] toJSONFields

View File

@ -59,9 +59,6 @@ instance (ToJSONFields a, ToJSONFields (f (Term f a))) => ToJSON (Term f a) wher
instance ToJSONFields Category where
toJSONFields c = ["category" .= case c of { Other s -> s ; _ -> pack (show c) }]
instance ToJSONFields a => ToJSONFields (Maybe a) where
toJSONFields = maybe [] toJSONFields
instance (ToJSONFields a, ToJSONFields (f (Term f a))) => ToJSONFields (Term f a) where
toJSONFields = toJSONFields . unTerm