Skip to content

Commit 6f9b768

Browse files
authored
Depend on OneTuple conditionally (#1198)
We need it for older GHCs only.
1 parent 9d6501f commit 6f9b768

5 files changed

Lines changed: 33 additions & 6 deletions

File tree

containers-tests/benchmarks/IntMap.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE BangPatterns #-}
23
module Main where
34

@@ -9,7 +10,12 @@ import qualified Data.IntMap as M
910
import qualified Data.IntMap.Strict as MS
1011
import qualified Data.IntSet as S
1112
import Data.Maybe (fromMaybe)
12-
import Data.Tuple.Solo (Solo (MkSolo), getSolo)
13+
#if __GLASGOW_HASKELL__ < 908
14+
import Data.Tuple.Solo
15+
#else
16+
import Data.Tuple
17+
#endif
18+
(Solo(MkSolo), getSolo)
1319
import Data.Word (Word8)
1420
import System.Random (StdGen, mkStdGen, random, randoms)
1521
import Prelude hiding (lookup)

containers-tests/benchmarks/Map.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ import Data.Map (alterF)
1515
import Data.Maybe (fromMaybe)
1616
import Data.Functor ((<$))
1717
import Data.Coerce
18-
import Data.Tuple.Solo (Solo (MkSolo), getSolo)
18+
#if __GLASGOW_HASKELL__ < 908
19+
import Data.Tuple.Solo
20+
#else
21+
import Data.Tuple
22+
#endif
23+
(Solo(MkSolo), getSolo)
1924
import System.Random (StdGen, mkStdGen, random, randoms)
2025
import Prelude hiding (lookup)
2126

containers-tests/containers-tests.cabal

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,27 @@ common test-deps
5454
import: deps
5555
build-depends:
5656
containers-tests
57-
, OneTuple
5857
, QuickCheck >=2.7.1
5958
, quickcheck-classes-base >= 0.6.2.0 && < 0.7
6059
, tasty >= 1.5.4 && < 1.6
6160
, tasty-hunit
6261
, tasty-quickcheck >= 0.11.1 && < 0.12
6362
, transformers
6463

64+
if impl(ghc < 9.8)
65+
build-depends:
66+
OneTuple >= 0.4.1 && < 0.5
67+
6568
common benchmark-deps
6669
import: deps
6770
build-depends:
6871
containers-tests
69-
, OneTuple
7072
, tasty-bench >=0.3.1 && <0.5
7173

74+
if impl(ghc < 9.8)
75+
build-depends:
76+
OneTuple >= 0.4.1 && < 0.5
77+
7278
-- Flags recommended by tasty-bench
7379
if impl(ghc >= 8.6)
7480
ghc-options: -fproc-alignment=64

containers-tests/tests/intmap-strictness.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import Data.Ord (Down(..), comparing)
1818
import Test.ChasingBottoms.IsBottom
1919
import Test.Tasty (TestTree, defaultMain, testGroup)
2020
import Test.Tasty.QuickCheck (testProperty)
21-
import Data.Tuple.Solo (Solo (MkSolo), getSolo)
21+
#if __GLASGOW_HASKELL__ < 908
22+
import Data.Tuple.Solo
23+
#else
24+
import Data.Tuple
25+
#endif
26+
(Solo(MkSolo), getSolo)
2227
import Test.QuickCheck
2328
import Test.QuickCheck.Poly (A, B, C)
2429
import Test.QuickCheck.Function (apply)

containers-tests/tests/map-strictness.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ import qualified Data.List.NonEmpty as NE
1616
import Data.Ord (Down(..), comparing)
1717
import Data.Maybe (catMaybes, mapMaybe)
1818
import Data.Semigroup (Arg(..))
19-
import Data.Tuple.Solo (Solo (MkSolo), getSolo)
19+
#if __GLASGOW_HASKELL__ < 908
20+
import Data.Tuple.Solo
21+
#else
22+
import Data.Tuple
23+
#endif
24+
(Solo(MkSolo), getSolo)
2025
import Test.ChasingBottoms.IsBottom (bottom, isBottom)
2126
import Test.Tasty (TestTree, defaultMain, testGroup)
2227
import Test.Tasty.QuickCheck (testProperty)

0 commit comments

Comments
 (0)