@@ -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' , foldMap )
@@ -88,10 +85,8 @@ main = defaultMain $ testGroup "intset-properties"
8885 , testProperty " prop_bitcount" prop_bitcount
8986 , testProperty " prop_alterF_list" prop_alterF_list
9087 , testProperty " prop_alterF_const" prop_alterF_const
91- #if MIN_VERSION_base(4,18,0)
9288 , testProperty " intersections" prop_intersections
9389 , testProperty " intersections_lazy" prop_intersections_lazy
94- #endif
9590 ]
9691
9792----------------------------------------------------------------
@@ -514,17 +509,15 @@ prop_alterF_const f k s =
514509 getConst (alterF (Const . applyFun f) k s )
515510 === getConst (Set. alterF (Const . applyFun f) k (toSet s))
516511
517- #if MIN_VERSION_base(4,18,0)
518512prop_intersections :: (IntSet , [IntSet ]) -> Property
519513prop_intersections (s, ss) =
520- intersections ss' === Foldable1. foldl1 ' intersection ss'
514+ intersections ss' === List. foldl ' intersection s ss
521515 where
522516 ss' = s :| ss -- Work around missing Arbitrary NonEmpty instance
523517
524518prop_intersections_lazy :: [IntSet ] -> Property
525519prop_intersections_lazy ss = intersections ss' === empty
526520 where
527- ss' = NE. fromList $ ss ++ [empty] ++ undefined
528- -- ^ result will certainly be empty at this point,
529- -- so the rest of the list should not be demanded.
530- #endif
521+ ss' = NE. fromList $ ss ++ [empty] ++ error " too strict"
522+ --- ^ result will certainly be empty at this point,
523+ -- so the rest of the list should not be demanded.
0 commit comments