on master help sign in
Simplify Maybe fix for SYB generics
commita16355517f109de6a3a48e4641353bd4c89f66ff authorBryan O'Sullivan <bos@serpentine.com> dateMon 14 Jan 2013, 21:37 (14 years ago) parent04a43d8
1 file changed+1−3
Data/Aeson/Generic.hs+1−3
Data/Aeson/Generic.hs+1−3
@@ -84,7 +84,7 @@ type T a = a -> Value
8484
8585toJSON :: (Data a) => a -> Value
8686toJSON = toJSON_generic
87− `ext1Q` maybe
87+ `ext1Q` maybe Null toJSON
8888 `ext1Q` list
8989 `ext1Q` vector
9090 `ext1Q` set
@@ -120,8 +120,6 @@ toJSON = toJSON_generic
120120 `extQ` (T.toJSON :: T ())
121121 --`extQ` (T.toJSON :: T Ordering)
122122 where
123− maybe (Just a) = toJSON a
124− maybe Nothing = Null
125123 list xs = Array . V.fromList . map toJSON $ xs
126124 vector v = Array . V.map toJSON $ v
127125 set s = Array . V.fromList . map toJSON . Set.toList $ s