exact-pi 0.1.2.0 → 0.2.0.0
raw patch · 3 files changed
+8/−11 lines, 3 filesdep −groupsPVP ok
version bump matches the API change (PVP)
Dependencies removed: groups
API changes (from Hackage documentation)
- Data.ExactPi: instance Abelian ExactPi
- Data.ExactPi: instance Group ExactPi
Files
- README.md +3/−0
- exact-pi.cabal +3/−3
- src/Data/ExactPi.hs +2/−8
README.md view
@@ -1,2 +1,5 @@ # exact-pi Exact rational multiples of pi (and integer powers of pi) in Haskell + +[](https://travis-ci.org/dmcclean/exact-pi) +[](http://hackage.haskell.org/package/exact-pi)
exact-pi.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: exact-pi -version: 0.1.2.0 +version: 0.2.0.0 synopsis: Exact rational multiples of pi (and integer powers of pi) description: Provides an exact representation for rational multiples of pi alongside an approximate representation of all reals. Useful for storing and computing with conversion factors between physical units. @@ -21,8 +21,8 @@ exposed-modules: Data.ExactPi -- other-modules: -- other-extensions: - build-depends: base >=4.7 && <4.9, - groups >= 0.4 && < 0.5 + build-depends: base >=4.7 && <4.9 + ghc-options: -Wall hs-source-dirs: src default-language: Haskell2010
src/Data/ExactPi.hs view
@@ -25,7 +25,6 @@ where import Data.Monoid -import Data.Group import Prelude -- | Represents an exact or approximate real value. @@ -73,6 +72,7 @@ instance Fractional ExactPi where fromRational = Exact 0 recip (Exact z q) = Exact z (recip q) + recip (Approximate x) = Approximate (recip x) instance Floating ExactPi where pi = Exact 1 1 @@ -97,13 +97,7 @@ approx1 :: (forall a.Floating a => a -> a) -> ExactPi -> ExactPi approx1 f x = Approximate (f (approximateValue x)) --- | The multiplicative monoid over augmented rationals. +-- | The multiplicative monoid over 'Rational's augmented with multiples of 'pi'. instance Monoid ExactPi where mempty = 1 mappend = (*) - --- | The multiplicative group over augmented rationals. -instance Group ExactPi where - invert = recip - -instance Abelian ExactPi