@@ -7,11 +7,8 @@ import Data.List (nub,sort)
77import qualified Data.List as List
88import Data.Maybe (listToMaybe )
99import Data.Monoid (mempty )
10- #if MIN_VERSION_base(4,18,0)
1110import Data.List.NonEmpty (NonEmpty (.. ))
1211import qualified Data.List.NonEmpty as NE
13- import qualified Data.Foldable1 as Foldable1
14- #endif
1512import qualified Data.Set as Set
1613import IntSetValidity (valid )
1714import Prelude hiding (lookup , null , map , filter , foldr , foldl , foldl' )
@@ -87,10 +84,8 @@ main = defaultMain $ testGroup "intset-properties"
8784 , testProperty " prop_bitcount" prop_bitcount
8885 , testProperty " prop_alterF_list" prop_alterF_list
8986 , testProperty " prop_alterF_const" prop_alterF_const
90- #if MIN_VERSION_base(4,18,0)
9187 , testProperty " intersections" prop_intersections
9288 , testProperty " intersections_lazy" prop_intersections_lazy
93- #endif
9489 ]
9590
9691----------------------------------------------------------------
@@ -510,10 +505,9 @@ prop_alterF_const f k s =
510505 getConst (alterF (Const . applyFun f) k s )
511506 === getConst (Set. alterF (Const . applyFun f) k (toSet s))
512507
513- #if MIN_VERSION_base(4,18,0)
514508prop_intersections :: (IntSet , [IntSet ]) -> Property
515509prop_intersections (s, ss) =
516- intersections ss' === Foldable1. foldl1 ' intersection ss'
510+ intersections ss' === List. foldl ' intersection s ss
517511 where
518512 ss' = s :| ss -- Work around missing Arbitrary NonEmpty instance
519513
@@ -523,4 +517,3 @@ prop_intersections_lazy ss = intersections ss' === empty
523517 ss' = NE. fromList $ ss ++ [empty] ++ undefined
524518 -- ^ result will certainly be empty at this point,
525519 -- so the rest of the list should not be demanded.
526- #endif
0 commit comments