@@ -1,4 +1,5 @@
11{-# LANGUAGE CPP #-}
2+{-# LANGUAGE DefaultSignatures #-}
23{-# LANGUAGE DeriveFunctor #-}
34{-# LANGUAGE DeriveGeneric #-}
45{-# LANGUAGE ExistentialQuantification #-}
@@ -367,8 +368,9 @@ instance Monoid PayloadSelection where
367368-- a ToJSON instance like:
368369--
369370-- > instance ToObject Foo
370−class ToJSON a => ToObject a where
371+class ToObject a where
371372 toObject :: a -> A.Object
373+ default toObject :: ToJSON a => a -> A.Object
372374 toObject v = case toJSON v of
373375 A.Object o -> o
374376 _ -> mempty