Skip to content

Commit 5e1d23a

Browse files
authored
Merge pull request #791 from phadej/remove-dead-cpp
Add remove some dead CPP
2 parents f2cfd4c + 3ce5d46 commit 5e1d23a

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

Data/Aeson/Types/FromJSON.hs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,7 @@ import qualified GHC.Exts as Exts
148148
import qualified Data.Primitive.Array as PM
149149
import qualified Data.Primitive.SmallArray as PM
150150
import qualified Data.Primitive.Types as PM
151-
152-
#if MIN_VERSION_primitive(0,6,4)
153-
#if !MIN_VERSION_primitive(0,7,0)
154-
import qualified Data.Primitive.UnliftedArray as PM
155-
#endif
156151
import qualified Data.Primitive.PrimArray as PM
157-
#endif
158-
159152

160153
import Data.Coerce (Coercible, coerce)
161154

@@ -2002,16 +1995,9 @@ instance FromJSON a => FromJSON (PM.Array a) where
20021995
instance FromJSON a => FromJSON (PM.SmallArray a) where
20031996
parseJSON = fmap Exts.fromList . parseJSON
20041997

2005-
#if MIN_VERSION_primitive(0,6,4)
20061998
instance (PM.Prim a,FromJSON a) => FromJSON (PM.PrimArray a) where
20071999
parseJSON = fmap Exts.fromList . parseJSON
20082000

2009-
#if !MIN_VERSION_primitive(0,7,0)
2010-
instance (PM.PrimUnlifted a,FromJSON a) => FromJSON (PM.UnliftedArray a) where
2011-
parseJSON = fmap Exts.fromList . parseJSON
2012-
#endif
2013-
#endif
2014-
20152001
-------------------------------------------------------------------------------
20162002
-- time
20172003
-------------------------------------------------------------------------------

Data/Aeson/Types/Internal.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ import qualified Data.Scientific as S
110110
import qualified Data.Vector as V
111111
import qualified Language.Haskell.TH.Syntax as TH
112112

113-
#if !MIN_VERSION_unordered_containers(0,2,6)
114-
import Data.List (sort)
115-
#endif
116-
117113
-- | Elements of a JSON path used to describe the location of an
118114
-- error.
119115
data JSONPathElement = Key Text
@@ -405,14 +401,7 @@ instance IsString Value where
405401
{-# INLINE fromString #-}
406402

407403
hashValue :: Int -> Value -> Int
408-
#if MIN_VERSION_unordered_containers(0,2,6)
409404
hashValue s (Object o) = s `hashWithSalt` (0::Int) `hashWithSalt` o
410-
#else
411-
hashValue s (Object o) = foldl' hashWithSalt
412-
(s `hashWithSalt` (0::Int)) assocHashesSorted
413-
where
414-
assocHashesSorted = sort [hash k `hashWithSalt` v | (k, v) <- H.toList o]
415-
#endif
416405
hashValue s (Array a) = foldl' hashWithSalt
417406
(s `hashWithSalt` (1::Int)) a
418407
hashValue s (String str) = s `hashWithSalt` (2::Int) `hashWithSalt` str

Data/Aeson/Types/ToJSON.hs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,7 @@ import qualified GHC.Exts as Exts
133133
import qualified Data.Primitive.Array as PM
134134
import qualified Data.Primitive.SmallArray as PM
135135
import qualified Data.Primitive.Types as PM
136-
137-
#if MIN_VERSION_primitive(0,6,4)
138-
#if !MIN_VERSION_primitive(0,7,0)
139-
import qualified Data.Primitive.UnliftedArray as PM
140-
#endif
141136
import qualified Data.Primitive.PrimArray as PM
142-
#endif
143137

144138
toJSONPair :: (a -> Value) -> (b -> Value) -> (a, b) -> Value
145139
toJSONPair a b = liftToJSON2 a (listValue a) b (listValue b)
@@ -1981,18 +1975,10 @@ instance ToJSON a => ToJSON (PM.SmallArray a) where
19811975
toJSON = toJSON . Exts.toList
19821976
toEncoding = toEncoding . Exts.toList
19831977

1984-
#if (MIN_VERSION_primitive(0,6,4))
19851978
instance (PM.Prim a,ToJSON a) => ToJSON (PM.PrimArray a) where
19861979
toJSON = toJSON . Exts.toList
19871980
toEncoding = toEncoding . Exts.toList
19881981

1989-
#if !MIN_VERSION_primitive(0,7,0)
1990-
instance (PM.PrimUnlifted a,ToJSON a) => ToJSON (PM.UnliftedArray a) where
1991-
toJSON = toJSON . Exts.toList
1992-
toEncoding = toEncoding . Exts.toList
1993-
#endif
1994-
#endif
1995-
19961982
-------------------------------------------------------------------------------
19971983
-- time
19981984
-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)