@@ -109,6 +109,8 @@ import Data.Semigroup as Semi
109
109
#if MIN_VERSION_base(4,9,0)
110
110
import GHC.Stack.Types ( CallStack (.. ), SrcLoc (.. ) )
111
111
import Data.Functor.Compose
112
+ import qualified Data.Functor.Sum as Functor
113
+ import qualified Data.Functor.Product as Functor
112
114
#elif MIN_VERSION_base(4,8,1)
113
115
import GHC.Stack ( CallStack (.. ) )
114
116
import GHC.SrcLoc ( SrcLoc (.. ) )
@@ -433,6 +435,21 @@ instance (NFData1 f, NFData1 g) => NFData1(Compose f g) where liftRnf r = liftRn
433
435
-- | @since 1.4.3.0
434
436
instance (NFData1 f , NFData1 g , NFData a ) => NFData (Compose f g a ) where rnf = rnf1
435
437
438
+ -- | @since 1.4.3.0
439
+ instance (NFData1 f , NFData1 g ) => NFData1 (Functor. Sum f g ) where
440
+ liftRnf rnf0 (Functor. InL l) = liftRnf rnf0 l
441
+ liftRnf rnf0 (Functor. InR r) = liftRnf rnf0 r
442
+
443
+ -- | @since 1.4.3.0
444
+ instance (NFData1 f , NFData1 g , NFData a ) => NFData (Functor. Sum f g a ) where rnf = rnf1
445
+
446
+ -- | @since 1.4.3.0
447
+ instance (NFData1 f , NFData1 g ) => NFData1 (Functor. Product f g ) where
448
+ liftRnf rnf0 (Functor. Pair f g) = liftRnf rnf0 f `seq` liftRnf rnf0 g
449
+
450
+ -- | @since 1.4.3.0
451
+ instance (NFData1 f , NFData1 g , NFData a ) => NFData (Functor. Product f g a ) where rnf = rnf1
452
+
436
453
instance NFData a => NFData (Ratio a ) where
437
454
438
455
#else
0 commit comments