|
21 | 21 | {-# OPTIONS_GHC -Wno-deprecations #-} |
22 | 22 | #endif |
23 | 23 |
|
| 24 | +#define BYTEARRAY_IN_BASE (__GLASGOW_HASKELL__ >= 903) |
| 25 | +-- At the moment of writing GHC source tree has not yet bumped `base` version, |
| 26 | +-- so using __GLASGOW_HASKELL__ as a proxy instead of MIN_VERSION_base(4,17,0). |
| 27 | + |
24 | 28 | ----------------------------------------------------------------------------- |
25 | 29 | -- | |
26 | 30 | -- Module : Control.DeepSeq |
@@ -161,6 +165,10 @@ import GHC.Tuple (Solo (..)) |
161 | 165 | #endif |
162 | 166 | #endif |
163 | 167 |
|
| 168 | +#if BYTEARRAY_IN_BASE |
| 169 | +import Data.Array.Byte (ByteArray(..)) |
| 170 | +#endif |
| 171 | + |
164 | 172 | -- | Hidden internal type-class |
165 | 173 | class GNFData arity f where |
166 | 174 | grnf :: RnfArgs arity a -> f a -> () |
@@ -1046,3 +1054,12 @@ instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFDa |
1046 | 1054 | instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => |
1047 | 1055 | NFData2 ((,,,,,,,,) a1 a2 a3 a4 a5 a6 a7) where |
1048 | 1056 | liftRnf2 r r' (x1,x2,x3,x4,x5,x6,x7,x8,x9) = rnf x1 `seq` rnf x2 `seq` rnf x3 `seq` rnf x4 `seq` rnf x5 `seq` rnf x6 `seq` rnf x7 `seq` r x8 `seq` r' x9 |
| 1057 | + |
| 1058 | +---------------------------------------------------------------------------- |
| 1059 | +-- ByteArray |
| 1060 | + |
| 1061 | +#if BYTEARRAY_IN_BASE |
| 1062 | +-- |@since 1.4.6.0 |
| 1063 | +instance NFData ByteArray where |
| 1064 | + rnf (ByteArray _) = () |
| 1065 | +#endif |
0 commit comments