Skip to content

Commit

Permalink
Require lattices >= 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Dec 21, 2023
1 parent 22ed485 commit 7b406da
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 71 deletions.
2 changes: 1 addition & 1 deletion data-interval.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 0 additions & 22 deletions src/Data/IntegerInterval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 0 additions & 22 deletions src/Data/Interval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 0 additions & 22 deletions src/Data/IntervalSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions test/TestIntervalMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b406da

Please sign in to comment.