Create an Arbitrary instance for a case class that holds a `Numeric` in ScalaCheck?
问题 I'm specifically trying to define Semigroup and a Sum type which 'is a' Semigroup and check the Associative property of Semigroup generically using ScalaCheck. I first wrote this out in Haskell because I find it easier to think of these things first in Haskell syntax and then translate them to Scala. So in Haskell, I wrote the following which works in GHCi: newtype Sum a = Sum a deriving (Show, Eq) instance Num a => Num (Sum a) where (+) (Sum x) (Sum y) = Sum (x + y) class Semigroup a where (