Commits

Bryan O'Sullivan committed 588f1e6

Simplify Maybe fix for SYB generics

  • Participants
  • Parent commits cc5ad41

Comments (0)

Files changed (1)

File Data/Aeson/Generic.hs

 
 toJSON :: (Data a) => a -> Value
 toJSON = toJSON_generic
-         `ext1Q` maybe
+         `ext1Q` maybe Null toJSON
          `ext1Q` list
          `ext1Q` vector
          `ext1Q` set
          `extQ` (T.toJSON :: T ())
          --`extQ` (T.toJSON :: T Ordering)
   where
-    maybe (Just a) = toJSON a
-    maybe Nothing = Null
     list xs = Array . V.fromList . map toJSON $ xs
     vector v = Array . V.map toJSON $ v
     set s = Array . V.fromList . map toJSON . Set.toList $ s