@@ -1,4 +1,4 @@
1−{-# LANGUAGE DefaultSignatures, EmptyDataDecls, FlexibleInstances,
1+{-# LANGUAGE CPP, DefaultSignatures, EmptyDataDecls, FlexibleInstances,
2 FunctionalDependencies, KindSignatures, OverlappingInstances,
2 FunctionalDependencies, KindSignatures, OverlappingInstances,
3 ScopedTypeVariables, TypeOperators, UndecidableInstances, ViewPatterns #-}
3 ScopedTypeVariables, TypeOperators, UndecidableInstances, ViewPatterns #-}
4{-# OPTIONS_GHC -fno-warn-orphans #-}
4{-# OPTIONS_GHC -fno-warn-orphans #-}
@@ -21,7 +21,7 @@ import Control.Applicative ((<*>), (<$>), (<|>), pure)
21import Control.Monad.ST (ST)
21import Control.Monad.ST (ST)
22import Data.Aeson.Types.Class
22import Data.Aeson.Types.Class
23import Data.Aeson.Types.Internal
23import Data.Aeson.Types.Internal
24−import Data.Bits (shiftR)
24+import Data.Bits
25import Data.DList (DList, toList)
25import Data.DList (DList, toList)
26import Data.Monoid (mappend)
26import Data.Monoid (mappend)
27import Data.Text (pack, unpack)
27import Data.Text (pack, unpack)
@@ -106,7 +106,11 @@ instance (GProductToValues a, GProductToValues b) => GProductToValues (a :*: b)
106 gProductToValues mv ix len (a :*: b) = do gProductToValues mv ix lenL a
106 gProductToValues mv ix len (a :*: b) = do gProductToValues mv ix lenL a
107 gProductToValues mv ixR lenR b
107 gProductToValues mv ixR lenR b
109+#if MIN_VERSION_base(4,5,0)
110+ lenL = len `unsafeShiftR` 1
109 lenL = len `shiftR` 1
112 lenL = len `shiftR` 1
110 ixR = ix + lenL
114 ixR = ix + lenL
111 lenR = len - lenL
115 lenR = len - lenL
112 {-# INLINE gProductToValues #-}
116 {-# INLINE gProductToValues #-}
@@ -235,7 +239,11 @@ instance (GFromProduct a, GFromProduct b) => GFromProduct (a :*: b) where
235 gParseProduct arr ix len = (:*:) <$> gParseProduct arr ix lenL
239 gParseProduct arr ix len = (:*:) <$> gParseProduct arr ix lenL
236 <*> gParseProduct arr ixR lenR
240 <*> gParseProduct arr ixR lenR
242+#if MIN_VERSION_base(4,5,0)
243+ lenL = len `unsafeShiftR` 1
238 lenL = len `shiftR` 1
245 lenL = len `shiftR` 1
239 ixR = ix + lenL
247 ixR = ix + lenL
240 lenR = len - lenL
248 lenR = len - lenL
241 {-# INLINE gParseProduct #-}
249 {-# INLINE gParseProduct #-}