numhask 0.13.1.0 → 0.13.2.0
raw patch · 6 files changed
+36/−92 lines, 6 files
Files
- ChangeLog.md +7/−0
- numhask.cabal +6/−85
- src/NumHask/Algebra/Additive.hs +15/−0
- src/NumHask/Algebra/Field.hs +2/−2
- src/NumHask/Algebra/Metric.hs +5/−4
- src/NumHask/Data/Rational.hs +1/−1
ChangeLog.md view
@@ -1,3 +1,10 @@+0.13.2+===++- GHC 9.14.1 support+- simplified Cabal stanzas to best practice template+- fixed asinh bug in Field module+ 0.13.1 ===
numhask.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: numhask-version: 0.13.1.0+version: 0.13.2.0 license: BSD-3-Clause license-file: LICENSE copyright: Tony Day (c) 2016@@ -27,11 +27,9 @@ build-type: Simple tested-with:- ghc ==8.10.7- ghc ==9.6.7- ghc ==9.8.4- ghc ==9.10.2+ ghc ==9.10.3 ghc ==9.12.2+ ghc ==9.14.1 extra-doc-files: ChangeLog.md@@ -46,91 +44,13 @@ ghc-options: -Wall -Wcompat- -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns- -Wpartial-fields -Wredundant-constraints -common ghc2021-additions- default-extensions:- BangPatterns- BinaryLiterals- ConstrainedClassMethods- ConstraintKinds- DeriveDataTypeable- DeriveFoldable- DeriveFunctor- DeriveGeneric- DeriveLift- DeriveTraversable- DoAndIfThenElse- EmptyCase- EmptyDataDecls- EmptyDataDeriving- ExistentialQuantification- ExplicitForAll- FlexibleContexts- FlexibleInstances- ForeignFunctionInterface- GADTSyntax- GeneralisedNewtypeDeriving- HexFloatLiterals- ImplicitPrelude- InstanceSigs- KindSignatures- MonomorphismRestriction- MultiParamTypeClasses- NamedFieldPuns- NamedWildCards- NumericUnderscores- PatternGuards- PolyKinds- PostfixOperators- RankNTypes- RelaxedPolyRec- ScopedTypeVariables- StandaloneDeriving- StarIsType- TraditionalRecordSyntax- TupleSections- TypeApplications- TypeOperators- TypeSynonymInstances-- if impl(ghc <9.2) && impl(ghc >=8.10)- default-extensions:- ImportQualifiedPost- StandaloneKindSignatures--common ghc2024-additions- default-extensions:- DataKinds- DerivingStrategies- DisambiguateRecordFields- ExplicitNamespaces- GADTs- LambdaCase- MonoLocalBinds- RoleAnnotations--common ghc2024-stanza- if impl(ghc >=9.10)- default-language:- GHC2024- elif impl(ghc >=9.2)- import: ghc2024-additions- default-language:- GHC2021- else- import: ghc2021-additions- import: ghc2024-additions- default-language:- Haskell2010- library import: ghc-options-stanza- import: ghc2024-stanza+ default-language: GHC2024 hs-source-dirs: src build-depends: base >=4.14 && <5 exposed-modules:@@ -154,7 +74,8 @@ default-extensions: RebindableSyntax test-suite doctests- import: ghc2024-stanza+ import: ghc-options-stanza+ default-language: GHC2024 main-is: doctests.hs hs-source-dirs: test build-depends:
src/NumHask/Algebra/Additive.hs view
@@ -102,6 +102,7 @@ zero = 0 instance Subtractive Double where+ (-) = (P.-) negate = P.negate instance Additive Float where@@ -109,6 +110,7 @@ zero = 0 instance Subtractive Float where+ (-) = (P.-) negate = P.negate instance Additive Int where@@ -116,6 +118,7 @@ zero = 0 instance Subtractive Int where+ (-) = (P.-) negate = P.negate instance Additive Integer where@@ -123,6 +126,7 @@ zero = 0 instance Subtractive Integer where+ (-) = (P.-) negate = P.negate instance Additive Bool where@@ -134,6 +138,7 @@ zero = 0 instance Subtractive Natural where+ (-) = (P.-) negate = P.negate instance Additive Int8 where@@ -141,6 +146,7 @@ zero = 0 instance Subtractive Int8 where+ (-) = (P.-) negate = P.negate instance Additive Int16 where@@ -148,6 +154,7 @@ zero = 0 instance Subtractive Int16 where+ (-) = (P.-) negate = P.negate instance Additive Int32 where@@ -155,6 +162,7 @@ zero = 0 instance Subtractive Int32 where+ (-) = (P.-) negate = P.negate instance Additive Int64 where@@ -162,6 +170,7 @@ zero = 0 instance Subtractive Int64 where+ (-) = (P.-) negate = P.negate instance Additive Word where@@ -169,6 +178,7 @@ zero = 0 instance Subtractive Word where+ (-) = (P.-) negate = P.negate instance Additive Word8 where@@ -176,6 +186,7 @@ zero = 0 instance Subtractive Word8 where+ (-) = (P.-) negate = P.negate instance Additive Word16 where@@ -183,6 +194,7 @@ zero = 0 instance Subtractive Word16 where+ (-) = (P.-) negate = P.negate instance Additive Word32 where@@ -190,6 +202,7 @@ zero = 0 instance Subtractive Word32 where+ (-) = (P.-) negate = P.negate instance Additive Word64 where@@ -197,6 +210,7 @@ zero = 0 instance Subtractive Word64 where+ (-) = (P.-) negate = P.negate instance (Additive b) => Additive (a -> b) where@@ -204,4 +218,5 @@ zero _ = zero instance (Subtractive b) => Subtractive (a -> b) where+ f - f' = \a -> f a - f' a negate f = negate P.. f
src/NumHask/Algebra/Field.hs view
@@ -242,7 +242,7 @@ atan2 = P.atan2 sinh = P.sinh cosh = P.cosh- asinh = P.sinh+ asinh = P.asinh acosh = P.acosh atanh = P.atanh @@ -256,7 +256,7 @@ atan2 = P.atan2 sinh = P.sinh cosh = P.cosh- asinh = P.sinh+ asinh = P.asinh acosh = P.acosh atanh = P.atanh
src/NumHask/Algebra/Metric.hs view
@@ -38,7 +38,7 @@ import NumHask.Algebra.Lattice import NumHask.Algebra.Multiplicative import NumHask.Algebra.Ring-import Prelude (Double, Eq (..), Float, Functor (..), Int, Integer, Ord (..), Show, Word, fromRational)+import Prelude (Double, Eq (..), Float, Functor (..), Int, Integer, Show, Word, fromRational) import Prelude qualified as P -- $setup@@ -326,6 +326,7 @@ zero = pure zero instance (Subtractive a) => Subtractive (EuclideanPair a) where+ (-) = liftA2 (-) negate = fmap negate instance@@ -336,7 +337,7 @@ one = pure one instance- (Subtractive a, Divisive a) =>+ (Divisive a) => Divisive (EuclideanPair a) where recip = fmap recip@@ -381,11 +382,11 @@ instance (Divisive a) => DivisiveAction (EuclideanPair a) where (|/) e s = fmap (/ s) e -instance (Ord a, TrigField a, ExpField a) => ExpField (EuclideanPair a) where+instance (TrigField a, ExpField a) => ExpField (EuclideanPair a) where exp (EuclideanPair (x, y)) = EuclideanPair (exp x * cos y, exp x * sin y) log (EuclideanPair (x, y)) = EuclideanPair (log (sqrt (x * x + y * y)), atan2 y x) -instance (QuotientField a, Subtractive a) => QuotientField (EuclideanPair a) where+instance (QuotientField a) => QuotientField (EuclideanPair a) where type Whole (EuclideanPair a) = EuclideanPair (Whole a) properFraction (EuclideanPair (x, y)) =
src/NumHask/Data/Rational.hs view
@@ -105,7 +105,7 @@ instance (P.Ord a, Integral a, EndoBased a, Subtractive a) => MeetSemiLattice (Ratio a) where (/\) = P.max -instance (P.Ord a, EndoBased a, Integral a, Ring a, MeetSemiLattice a) => Epsilon (Ratio a)+instance (P.Ord a, EndoBased a, Integral a, Ring a) => Epsilon (Ratio a) instance (FromIntegral a b, Multiplicative a) => FromIntegral (Ratio a) b where fromIntegral x = fromIntegral x :% one