@@ -1,4 +1,4 @@
1−{-# LANGUAGE DefaultSignatures, EmptyDataDecls, FlexibleInstances,
1+{-# LANGUAGE CPP, DefaultSignatures, EmptyDataDecls, FlexibleInstances,
22 FunctionalDependencies, KindSignatures, OverlappingInstances,
33 ScopedTypeVariables, TypeOperators, UndecidableInstances,
44 ViewPatterns, NamedFieldPuns, FlexibleContexts, PatternGuards,
@@ -24,7 +24,7 @@ import Control.Monad ((<=<))
2424import Control.Monad.ST (ST)
2525import Data.Aeson.Types.Class
2626import Data.Aeson.Types.Internal
27−import Data.Bits (shiftR)
27+import Data.Bits
2828import Data.DList (DList, toList, empty)
2929import Data.Maybe (fromMaybe)
3030import Data.Monoid (mappend)
@@ -249,7 +249,11 @@ instance ( WriteProduct a
249249 writeProduct opts mv ix lenL a
250250 writeProduct opts mv ixR lenR b
251251 where
252+#if MIN_VERSION_base(4,5,0)
253+ lenL = len `unsafeShiftR` 1
254+#else
252255 lenL = len `shiftR` 1
256+#endif
253257 lenR = len - lenL
254258 ixR = ix + lenL
255259 {-# INLINE writeProduct #-}
@@ -523,7 +527,11 @@ instance (FromProduct a, FromProduct b) => FromProduct (a :*: b) where
523527 (:*:) <$> parseProduct opts arr ix lenL
524528 <*> parseProduct opts arr ixR lenR
525529 where
530+#if MIN_VERSION_base(4,5,0)
531+ lenL = len `unsafeShiftR` 1
532+#else
526533 lenL = len `shiftR` 1
534+#endif
527535 ixR = ix + lenL
528536 lenR = len - lenL
529537 {-# INLINE parseProduct #-}