intervals 0.9.2 → 0.9.3
raw patch · 7 files changed
+43/−88 lines, 7 filesdep −semigroupsdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: semigroups
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +4/−0
- intervals.cabal +15/−19
- src/Numeric/Interval/Exception.hs +2/−2
- src/Numeric/Interval/Internal.hs +5/−19
- src/Numeric/Interval/Kaucher.hs +8/−24
- src/Numeric/Interval/NonEmpty.hs +0/−3
- src/Numeric/Interval/NonEmpty/Internal.hs +9/−21
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.9.3 [2024.12.04]+------------------+* Drop support for pre-8.0 versions of GHC.+ 0.9.2 [2021.02.17] ------------------ * Export `(/=!)` and `(/=?)` operators.
intervals.cabal view
@@ -1,5 +1,5 @@ name: intervals-version: 0.9.2+version: 0.9.3 synopsis: Interval Arithmetic description: A 'Numeric.Interval.Interval' is a closed, convex set of floating point values.@@ -17,18 +17,18 @@ category: Math build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.0.4- , GHC == 7.2.2- , GHC == 7.4.2- , GHC == 7.6.3- , GHC == 7.8.4- , GHC == 7.10.3- , GHC == 8.0.2+tested-with: GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5- , GHC == 8.8.3- , GHC == 8.10.1+ , GHC == 8.8.4+ , GHC == 8.10.7+ , GHC == 9.0.2+ , GHC == 9.2.8+ , GHC == 9.4.8+ , GHC == 9.6.6+ , GHC == 9.8.4+ , GHC == 9.10.1 extra-source-files: .hlint.yaml CHANGELOG.markdown@@ -55,14 +55,9 @@ build-depends: array >= 0.3 && < 0.6,- base >= 4 && < 5,- distributive >= 0.2 && < 1-- if impl(ghc >=7.4)- build-depends: ghc-prim-- if !impl(ghc >=8.0)- build-depends: semigroups >=0.11 && <1+ base >= 4.9 && < 5,+ distributive >= 0.2 && < 1,+ ghc-prim ghc-options: -Wall -O2 @@ -80,5 +75,6 @@ main-is: doctests.hs ghc-options: -Wall -threaded hs-source-dirs: tests- build-depends: base, QuickCheck >=2.14.2+ build-depends: base >= 4.9 && < 5+ , QuickCheck >=2.14.2 default-language: Haskell2010
src/Numeric/Interval/Exception.hs view
@@ -8,7 +8,7 @@ import Data.Data data EmptyInterval = EmptyInterval- deriving (Eq,Ord,Typeable,Data)+ deriving (Eq,Ord,Data) instance Show EmptyInterval where show EmptyInterval = "empty interval"@@ -16,7 +16,7 @@ instance Exception EmptyInterval data AmbiguousComparison = AmbiguousComparison- deriving (Eq,Ord,Typeable,Data)+ deriving (Eq,Ord,Data) instance Show AmbiguousComparison where show AmbiguousComparison = "ambiguous comparison"
src/Numeric/Interval/Internal.hs view
@@ -1,9 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveDataTypeable #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE DeriveGeneric #-}-#endif {-# OPTIONS_HADDOCK not-home #-} ----------------------------------------------------------------------------- -- |@@ -59,9 +57,7 @@ import Control.Exception as Exception import Data.Data import Data.Function (on)-#if __GLASGOW_HASKELL__ >= 704 import GHC.Generics-#endif import Numeric.Interval.Exception import Prelude hiding (null, elem, notElem) @@ -69,23 +65,13 @@ import qualified Data.Monoid -- $setup--- -- Eta expansion needed for GHC-7.6--- >>> :set -fno-warn-deprecations--- >>> let null xs = Numeric.Interval.Internal.null xs--- >>> let elem x xs = Numeric.Interval.Internal.elem x xs--- >>> let notElem x xs = Numeric.Interval.Internal.notElem x xs+-- >>> :set -Wno-deprecations+-- >>> let null = Numeric.Interval.Internal.null+-- >>> let elem = Numeric.Interval.Internal.elem+-- >>> let notElem = Numeric.Interval.Internal.notElem data Interval a = I !a !a | Empty deriving- ( Eq, Ord- , Data- , Typeable-#if __GLASGOW_HASKELL__ >= 704- , Generic-#if __GLASGOW_HASKELL__ >= 706- , Generic1-#endif-#endif- )+ (Eq, Ord, Data, Generic, Generic1) -- | 'Data.Semigroup.<>' is 'hull' instance Ord a => Data.Semigroup.Semigroup (Interval a) where
src/Numeric/Interval/Kaucher.hs view
@@ -1,9 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveDataTypeable #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE DeriveGeneric #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Numeric.Interval@@ -59,16 +57,10 @@ import Control.Exception as Exception import Data.Data import Data.Distributive-import Data.Foldable hiding (minimum, maximum, elem, notElem-#if __GLASGOW_HASKELL__ >= 710- , null-#endif- )+import Data.Foldable hiding (minimum, maximum, elem, notElem, null) import Data.Function (on) import Data.Traversable-#if __GLASGOW_HASKELL__ >= 704 import GHC.Generics-#endif import Numeric.Interval.Exception import Prelude hiding (null, elem, notElem) @@ -76,23 +68,13 @@ import qualified Data.Monoid -- $setup--- -- Eta expansion needed for GHC-7.6--- >>> :set -fno-warn-deprecations--- >>> let null xs = Numeric.Interval.Kaucher.null xs--- >>> let elem x xs = Numeric.Interval.Kaucher.elem x xs--- >>> let notElem x xs = Numeric.Interval.Kaucher.notElem x xs+-- >>> :set -Wno-deprecations+-- >>> let null = Numeric.Interval.Kaucher.null+-- >>> let elem = Numeric.Interval.Kaucher.elem+-- >>> let notElem = Numeric.Interval.Kaucher.notElem data Interval a = I !a !a deriving- ( Eq, Ord- , Data- , Typeable-#if __GLASGOW_HASKELL__ >= 704- , Generic-#if __GLASGOW_HASKELL__ >= 706- , Generic1-#endif-#endif- )+ (Eq, Ord, Data, Generic, Generic1) -- | 'Data.Semigroup.<>' is 'hull' instance Ord a => Data.Semigroup.Semigroup (Interval a) where@@ -117,8 +99,10 @@ {-# INLINE (<*>) #-} instance Monad Interval where+#if !(MIN_VERSION_base(4,11,0)) return a = I a a {-# INLINE return #-}+#endif I a b >>= f = I a' b' where I a' _ = f a I _ b' = f b
src/Numeric/Interval/NonEmpty.hs view
@@ -1,9 +1,6 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveDataTypeable #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE DeriveGeneric #-}-#endif ----------------------------------------------------------------------------- -- | -- Module : Numeric.Interval.NonEmpty
src/Numeric/Interval/NonEmpty/Internal.hs view
@@ -1,9 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE DeriveDataTypeable #-}-#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE DeriveGeneric #-}-#endif {-# OPTIONS_HADDOCK not-home #-} ----------------------------------------------------------------------------- -- |@@ -55,9 +53,7 @@ import Control.Exception as Exception import Data.Data-#if __GLASGOW_HASKELL__ >= 704 import GHC.Generics-#endif import Prelude hiding (null, elem, notElem) import qualified Data.Semigroup@@ -79,22 +75,12 @@ -- >>> let compose2 = fmap . fmap -- >>> let commutative op a b = (a `op` b) == (b `op` a) ----- -- Eta expansion needed for GHC-7.6--- >>> :set -fno-warn-deprecations--- >>> let elem x xs = Numeric.Interval.NonEmpty.Internal.elem x xs--- >>> let notElem x xs = Numeric.Interval.NonEmpty.Internal.notElem x xs+-- >>> :set -Wno-deprecations+-- >>> let elem = Numeric.Interval.NonEmpty.Internal.elem+-- >>> let notElem = Numeric.Interval.NonEmpty.Internal.notElem data Interval a = I !a !a deriving- ( Eq, Ord- , Data- , Typeable-#if __GLASGOW_HASKELL__ >= 704- , Generic-#if __GLASGOW_HASKELL__ >= 706- , Generic1-#endif-#endif- )+ (Eq, Ord, Data, Generic, Generic1) -- | 'Data.Semigroup.<>' is 'hull' instance Ord a => Data.Semigroup.Semigroup (Interval a) where@@ -437,8 +423,9 @@ -- | Fractional instance for intervals. ----- prop> ys /= singleton 0 ==> conservative2 ((/) :: Double -> Double -> Double) (/) xs ys--- prop> xs /= singleton 0 ==> conservative (recip :: Double -> Double) recip xs+-- -- The property tests below are currently disabled (#66).+-- -- prop> ys /= singleton 0 ==> conservative2 ((/) :: Double -> Double -> Double) (/) xs ys+-- -- prop> xs /= singleton 0 ==> conservative (recip :: Double -> Double) recip xs instance (Fractional a, Ord a) => Fractional (Interval a) where -- TODO: check isNegativeZero properly x / y@(I a b)@@ -806,7 +793,8 @@ -- >>> scale (-2.0) (-1.0 ... 1.0) -- -2.0 ... 2.0 ----- prop> abs x >= 1 ==> (scale (x :: Double) i) `contains` i+-- -- The property test below is currently disabled (#66).+-- -- prop> abs x >= 1 ==> (scale (x :: Double) i) `contains` i -- prop> forAll (choose (0,1)) $ \x -> abs x <= 1 ==> i `contains` (scale (x :: Double) i) scale :: (Fractional a, Ord a) => a -> Interval a -> Interval a scale x i = a ... b where