File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11{-# LANGUAGE CPP #-}
22{-# LANGUAGE GADTs #-}
3+ {-# LANGUAGE TypeOperators #-}
34#if __GLASGOW_HASKELL__ >= 706
45{-# LANGUAGE PolyKinds #-}
56#endif
@@ -19,6 +20,10 @@ import Data.Functor.Product (Product (..))
1920import Data.Functor.Sum (Sum (.. ))
2021import Data.Type.Equality ((:~:) (.. ))
2122
23+ #if MIN_VERSION_base(4,6,0)
24+ import GHC.Generics ((:+:) (.. ), (:*:) (.. ))
25+ #endif
26+
2227#if MIN_VERSION_base(4,9,0)
2328#if MIN_VERSION_base(4,10,0)
2429import Data.Type.Equality ((:~~:) (.. ))
@@ -49,6 +54,15 @@ instance (GNFData a, GNFData b) => GNFData (Sum a b) where
4954 grnf (InL x) = grnf x
5055 grnf (InR y) = grnf y
5156
57+ #if MIN_VERSION_base(4,6,0)
58+ instance (GNFData a , GNFData b ) => GNFData (a :*: b ) where
59+ grnf (a :*: b) = grnf a `seq` grnf b
60+
61+ instance (GNFData a , GNFData b ) => GNFData (a :+: b ) where
62+ grnf (L1 x) = grnf x
63+ grnf (R1 y) = grnf y
64+ #endif
65+
5266-- | @since 1.0.3
5367instance GNFData ((:~: ) a ) where
5468 grnf Refl = ()
You can’t perform that action at this time.
0 commit comments