@@ -1,4 +1,4 @@
1−{-# LANGUAGE DefaultSignatures, EmptyDataDecls, FlexibleInstances,
1+{-# LANGUAGE CPP, DefaultSignatures, EmptyDataDecls, FlexibleInstances,
22 FunctionalDependencies, KindSignatures, OverlappingInstances,
33 ScopedTypeVariables, TypeOperators, UndecidableInstances, ViewPatterns #-}
44{-# OPTIONS_GHC -fno-warn-orphans #-}
@@ -21,7 +21,7 @@ import Control.Applicative ((<*>), (<$>), (<|>), pure)
2121import Control.Monad.ST (ST)
2222import Data.Aeson.Types.Class
2323import Data.Aeson.Types.Internal
24−import Data.Bits (shiftR)
24+import Data.Bits
2525import Data.DList (DList, toList)
2626import Data.Monoid (mappend)
2727import Data.Text (pack, unpack)
@@ -106,7 +106,11 @@ instance (GProductToValues a, GProductToValues b) => GProductToValues (a :*: b)
106106 gProductToValues mv ix len (a :*: b) = do gProductToValues mv ix lenL a
107107 gProductToValues mv ixR lenR b
108108 where
109+#if MIN_VERSION_base(4,5,0)
110+ lenL = len `unsafeShiftR` 1
111+#else
109112 lenL = len `shiftR` 1
113+#endif
110114 ixR = ix + lenL
111115 lenR = len - lenL
112116 {-# INLINE gProductToValues #-}
@@ -235,7 +239,11 @@ instance (GFromProduct a, GFromProduct b) => GFromProduct (a :*: b) where
235239 gParseProduct arr ix len = (:*:) <$> gParseProduct arr ix lenL
236240 <*> gParseProduct arr ixR lenR
237241 where
242+#if MIN_VERSION_base(4,5,0)
243+ lenL = len `unsafeShiftR` 1
244+#else
238245 lenL = len `shiftR` 1
246+#endif
239247 ixR = ix + lenL
240248 lenR = len - lenL
241249 {-# INLINE gParseProduct #-}