1{-# LANGUAGE DeriveAnyClass #-} 2{-# LANGUAGE DerivingStrategies #-} 3{-# LANGUAGE GeneralizedNewtypeDeriving #-} 4{-# LANGUAGE StandaloneDeriving #-} 5module DerivingStrategies where 6 7class C a 8 9class D a 10 11newtype Foo a = MkFoo a 12 deriving () 13 deriving stock (Eq, Ord) 14 deriving newtype Show 15 deriving anyclass C 16 17deriving stock instance Read a => Read (Foo a) 18 19deriving newtype instance Num a => Num (Foo a) 20 21deriving anyclass instance D (Foo a) 22