(Data.Monoid) - Sum and Product deriving Bounded and Num at the same time?

Nic*_*nin 2 haskell typeclass monoids deriving

in Data.Monoid :

newtype Sum a = Sum { getSum :: a }
    deriving ( Eq       -- ^ @since 2.01
             , Ord      -- ^ @since 2.01
             , Read     -- ^ @since 2.01
             , Show     -- ^ @since 2.01
             , Bounded  -- ^ @since 2.01
             , Generic  -- ^ @since 4.7.0.0
             , Generic1 -- ^ @since 4.7.0.0
             , Num      -- ^ @since 4.7.0.0
             )
Run Code Online (Sandbox Code Playgroud)

I don't understand how you could derive Num and Bounded on Sum with Integer, Float etc... which are naturally not Bounded (it's the same story for the Product wrapper).

Thanks!

Mat*_*hid 7

我很确定Sum aEq只要a是的实例,它就成为(说)的实例Eq

instance (Eq a) => Eq (Sum a) where ...
Run Code Online (Sandbox Code Playgroud)

对于其他所有类也是如此。