From 7b406dad8ac4aa0743401ca8d65d1c526920ac55 Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Thu, 21 Dec 2023 00:21:43 +0000 Subject: [PATCH] Require lattices >= 2 --- data-interval.cabal | 2 +- src/Data/IntegerInterval.hs | 22 ---------------------- src/Data/Interval.hs | 22 ---------------------- src/Data/IntervalSet.hs | 22 ---------------------- test/TestIntervalMap.hs | 4 ---- 5 files changed, 1 insertion(+), 71 deletions(-) diff --git a/data-interval.cabal b/data-interval.cabal index e4d6d0b..a31996f 100644 --- a/data-interval.cabal +++ b/data-interval.cabal @@ -48,7 +48,7 @@ Library , extended-reals >=0.2 && <1.0 if flag(lattices) build-depends: - lattices >=1.2.1.1 && <2.3 + lattices >=2 && <2.3 Default-Language: Haskell2010 Other-Extensions: ScopedTypeVariables diff --git a/src/Data/IntegerInterval.hs b/src/Data/IntegerInterval.hs index 9ab87de..df9eb3c 100644 --- a/src/Data/IntegerInterval.hs +++ b/src/Data/IntegerInterval.hs @@ -137,8 +137,6 @@ upperBound' x = ub@_ -> (ub, Open) #ifdef MIN_VERSION_lattices -#if MIN_VERSION_lattices(2,0,0) - instance Lattice IntegerInterval where (\/) = hull (/\) = intersection @@ -148,26 +146,6 @@ instance BoundedJoinSemiLattice IntegerInterval where instance BoundedMeetSemiLattice IntegerInterval where top = whole - -#else - -instance JoinSemiLattice IntegerInterval where - join = hull - -instance MeetSemiLattice IntegerInterval where - meet = intersection - -instance Lattice IntegerInterval - -instance BoundedJoinSemiLattice IntegerInterval where - bottom = empty - -instance BoundedMeetSemiLattice IntegerInterval where - top = whole - -instance BoundedLattice IntegerInterval - -#endif #endif instance Show IntegerInterval where diff --git a/src/Data/Interval.hs b/src/Data/Interval.hs index 11bc0ef..cb8f9cf 100644 --- a/src/Data/Interval.hs +++ b/src/Data/Interval.hs @@ -119,8 +119,6 @@ infix 4 >?? infix 4 /=?? #ifdef MIN_VERSION_lattices -#if MIN_VERSION_lattices(2,0,0) - instance (Ord r) => Lattice (Interval r) where (\/) = hull (/\) = intersection @@ -130,26 +128,6 @@ instance (Ord r) => BoundedJoinSemiLattice (Interval r) where instance (Ord r) => BoundedMeetSemiLattice (Interval r) where top = whole - -#else - -instance (Ord r) => JoinSemiLattice (Interval r) where - join = hull - -instance (Ord r) => MeetSemiLattice (Interval r) where - meet = intersection - -instance (Ord r) => Lattice (Interval r) - -instance (Ord r) => BoundedJoinSemiLattice (Interval r) where - bottom = empty - -instance (Ord r) => BoundedMeetSemiLattice (Interval r) where - top = whole - -instance (Ord r) => BoundedLattice (Interval r) - -#endif #endif instance (Ord r, Show r) => Show (Interval r) where diff --git a/src/Data/IntervalSet.hs b/src/Data/IntervalSet.hs index 118bff4..69f2e29 100644 --- a/src/Data/IntervalSet.hs +++ b/src/Data/IntervalSet.hs @@ -135,8 +135,6 @@ instance Hashable r => Hashable (IntervalSet r) where hashWithSalt s (IntervalSet m) = hashWithSalt s (Map.toList m) #ifdef MIN_VERSION_lattices -#if MIN_VERSION_lattices(2,0,0) - instance (Ord r) => Lattice (IntervalSet r) where (\/) = union (/\) = intersection @@ -146,26 +144,6 @@ instance (Ord r) => BoundedJoinSemiLattice (IntervalSet r) where instance (Ord r) => BoundedMeetSemiLattice (IntervalSet r) where top = whole - -#else - -instance (Ord r) => JoinSemiLattice (IntervalSet r) where - join = union - -instance (Ord r) => MeetSemiLattice (IntervalSet r) where - meet = intersection - -instance (Ord r) => Lattice (IntervalSet r) - -instance (Ord r) => BoundedJoinSemiLattice (IntervalSet r) where - bottom = empty - -instance (Ord r) => BoundedMeetSemiLattice (IntervalSet r) where - top = whole - -instance (Ord r) => BoundedLattice (IntervalSet r) - -#endif #endif instance Ord r => Monoid (IntervalSet r) where diff --git a/test/TestIntervalMap.hs b/test/TestIntervalMap.hs index f4004e0..627e760 100644 --- a/test/TestIntervalMap.hs +++ b/test/TestIntervalMap.hs @@ -10,10 +10,6 @@ import qualified Data.Foldable as F import Data.Generics.Schemes import Data.Hashable import Data.Maybe -#if __GLASGOW_HASKELL__ < 710 -import Control.Applicative ((<$>)) -import Data.Traversable (Traversable(..)) -#endif #if __GLASGOW_HASKELL__ < 804 import Data.Semigroup ((<>)) #endif