packages feed

aern2-mp 0.2.15.1 → 0.2.16.0

raw patch · 6 files changed

+29/−11 lines, 6 filesdep ~mixed-types-numPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: mixed-types-num

API changes (from Hackage documentation)

- AERN2.MP.Ball.Conversions: instance (Numeric.MixedTypes.Literals.ConvertibleExactly c AERN2.MP.Dyadic.Dyadic, Numeric.MixedTypes.Literals.ConvertibleExactly e AERN2.MP.Dyadic.Dyadic, GHC.Show.Show c, GHC.Show.Show e, Data.Typeable.Internal.Typeable c, Data.Typeable.Internal.Typeable e) => Numeric.MixedTypes.Literals.ConvertibleExactly (c, e) AERN2.MP.Ball.Type.MPBall
- AERN2.MP.Ball.Conversions: instance AERN2.MP.Precision.ConvertibleWithPrecision (GHC.Real.Rational, GHC.Real.Rational) AERN2.MP.Ball.Type.MPBall
- AERN2.MP.Ball.Conversions: integerBounds :: HasIntegerBounds t => t -> (Integer, Integer)
+ AERN2.MP.Ball: CentreRadius :: c -> e -> CentreRadius c e
+ AERN2.MP.Ball: data CentreRadius c e
+ AERN2.MP.Ball.Conversions: CentreRadius :: c -> e -> CentreRadius c e
+ AERN2.MP.Ball.Conversions: data CentreRadius c e
+ AERN2.MP.Ball.Conversions: instance (Numeric.MixedTypes.Literals.ConvertibleExactly c AERN2.MP.Dyadic.Dyadic, Numeric.MixedTypes.Literals.ConvertibleExactly e AERN2.MP.Dyadic.Dyadic, GHC.Show.Show c, GHC.Show.Show e, Data.Typeable.Internal.Typeable c, Data.Typeable.Internal.Typeable e) => Numeric.MixedTypes.Literals.ConvertibleExactly (AERN2.MP.Ball.Conversions.CentreRadius c e) AERN2.MP.Ball.Type.MPBall
+ AERN2.MP.Ball.Conversions: instance AERN2.MP.Precision.ConvertibleWithPrecision (AERN2.MP.Ball.Conversions.CentreRadius GHC.Real.Rational GHC.Real.Rational) AERN2.MP.Ball.Type.MPBall
+ AERN2.MP.Ball.Conversions: instance Numeric.MixedTypes.Literals.ConvertibleExactly (Numeric.MixedTypes.Literals.WithSample AERN2.MP.Ball.Type.MPBall GHC.Num.Integer.Integer) AERN2.MP.Ball.Type.MPBall
+ AERN2.MP.Ball.Conversions: instance Numeric.MixedTypes.Literals.ConvertibleExactly (Numeric.MixedTypes.Literals.WithSample AERN2.MP.Ball.Type.MPBall GHC.Real.Rational) AERN2.MP.Ball.Type.MPBall
+ AERN2.MP.Dyadic: instance Numeric.MixedTypes.Literals.ConvertibleExactly (Numeric.MixedTypes.Literals.WithSample AERN2.MP.Dyadic.Dyadic GHC.Num.Integer.Integer) AERN2.MP.Dyadic.Dyadic
+ AERN2.MP.WithCurrentPrec.Type: instance (AERN2.MP.Precision.ConvertibleWithPrecision t1 t2, GHC.TypeNats.KnownNat p) => AERN2.MP.Precision.ConvertibleWithPrecision (Numeric.MixedTypes.Literals.WithSample (AERN2.MP.WithCurrentPrec.Type.WithCurrentPrec p t2) t1) t2

Files

aern2-mp.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack  name:           aern2-mp-version:        0.2.15.1+version:        0.2.16.0 synopsis:       Multi-precision ball (interval) arithmetic description:    Please see the README on GitHub at <https://github.com/michalkonecny/aern2/#readme> category:       Math@@ -13,7 +13,7 @@ bug-reports:    https://github.com/michalkonecny/aern2/issues author:         Michal Konecny maintainer:     mikkonecny@gmail.com-copyright:      2015-2021 Michal Konecny+copyright:      2015-2024 Michal Konecny license:        BSD3 license-file:   LICENSE build-type:     Simple@@ -90,7 +90,7 @@     , deepseq     , hspec     , integer-logarithms-    , mixed-types-num >=0.5.11+    , mixed-types-num >=0.6.1     , reflection     , regex-tdfa     , template-haskell@@ -130,7 +130,7 @@     , deepseq     , hspec     , integer-logarithms-    , mixed-types-num >=0.5.11+    , mixed-types-num >=0.6.1     , reflection     , regex-tdfa     , template-haskell
changelog.md view
@@ -1,5 +1,7 @@ # Change log for aern2-mp +* v 0.2.16.0 2024-09-21+  * adapt to int / rat conversion with sample * v 0.2.15 2023-04-11   * add generic selectCountable, instance for Kleenean * v 0.2.14 2023-04-10
src/AERN2/MP/Ball.hs view
@@ -21,6 +21,7 @@   , module AERN2.MP.Enclosure   -- * The Ball type   , MPBall(..), CanBeMPBall, mpBall, cnMPBall, CanBeMPBallP, mpBallP, cnMPBallP+  , CentreRadius(..)   , reducePrecionIfInaccurate   , giveUpIfVeryInaccurate   {-@@ -48,7 +49,7 @@ import AERN2.MP.ErrorBound (ErrorBound, CanBeErrorBound, errorBound)  import AERN2.MP.Ball.Type-import AERN2.MP.Ball.Conversions ()+import AERN2.MP.Ball.Conversions (CentreRadius(..)) import AERN2.MP.Ball.Comparisons import AERN2.MP.Ball.Field () import AERN2.MP.Ball.Limit ()
src/AERN2/MP/Ball/Conversions.hs view
@@ -13,7 +13,7 @@ -} module AERN2.MP.Ball.Conversions (-  integerBounds+  CentreRadius(..) ) where @@ -61,13 +61,15 @@ instance ConvertibleExactly ErrorBound MPBall where   safeConvertExactly eb = Right $ MPBall (mpFloat eb) (errorBound 0) +data CentreRadius c e = CentreRadius c e+ instance   (ConvertibleExactly c Dyadic, ConvertibleExactly e Dyadic   , Show c, Show e, Typeable c, Typeable e)   =>-  ConvertibleExactly (c, e) MPBall+  ConvertibleExactly (CentreRadius c e) MPBall   where-  safeConvertExactly (c,e)+  safeConvertExactly (CentreRadius c e)     | isFinite b = Right b     | otherwise = convError "too large to convert to MPBall" (c,e)     where@@ -80,6 +82,9 @@     where       b = MPBall (mpFloat x) (errorBound 0) +instance ConvertibleExactly (WithSample MPBall Integer) MPBall where+  safeConvertExactly (WithSample _ value) = safeConvertExactly value+ instance ConvertibleExactly Int MPBall where   safeConvertExactly x = Right $ MPBall (mpFloat x) (errorBound 0) @@ -111,14 +116,17 @@     b = MPBall xC (errorBound xErr)     (xC, xErr) = MPFloat.ceduCentreErr $ MPFloat.fromRationalCEDU p x -instance ConvertibleWithPrecision (Rational, Rational) MPBall where-  safeConvertP p (x,e)+instance ConvertibleWithPrecision (CentreRadius Rational Rational) MPBall where+  safeConvertP p (CentreRadius x e)     | isFinite b = Right b     | otherwise = convError ("too large to convert to MPBall with precision " ++ show p) x     where     b = MPBall xFlt (xe + eUp) -- beware, precision may be too high relative to accuracy     (MPBall xFlt xe) = mpBallP p x     eUp = errorBound e++instance ConvertibleExactly (WithSample MPBall Rational) MPBall where+  safeConvertExactly (WithSample sample value) = safeConvertP (getPrecision sample) value  {--- constructing a fat ball ---} 
src/AERN2/MP/Dyadic.hs view
@@ -143,6 +143,9 @@ instance ConvertibleExactly Integer Dyadic where   safeConvertExactly = fmap Dyadic . safeConvertExactly +instance ConvertibleExactly (WithSample Dyadic Integer) Dyadic where+  safeConvertExactly (WithSample _ value) = safeConvertExactly value+ instance ConvertibleExactly Int Dyadic where   safeConvertExactly = fmap Dyadic . safeConvertExactly 
src/AERN2/MP/WithCurrentPrec/Type.hs view
@@ -71,6 +71,10 @@         where         r = WithCurrentPrec $ convertP (getCurrentPrecision r) v +instance (ConvertibleWithPrecision t1 t2, KnownNat p) => +    ConvertibleWithPrecision (WithSample (WithCurrentPrec p t2) t1) t2 where+    safeConvertP _ (WithSample withPrec v) = safeConvertP (getCurrentPrecision withPrec) v+ -- mpBallCP :: (CanBeMPBallP t, KnownNat p) => t -> WithCurrentPrec p MPBall -- mpBallCP = convertExactly