packages feed

vector-space 0.12 → 0.13

raw patch · 2 files changed

+13/−3 lines, 2 filesdep +semigroupsdep ~base

Dependencies added: semigroups

Dependency ranges changed: base

Files

src/Data/AdditiveGroup.hs view
@@ -31,6 +31,9 @@ import Data.Foldable (foldr) import Data.Complex hiding (magnitude) import Data.Ratio+#if !(MIN_VERSION_base(4,11,0))+import Data.Semigroup (Semigroup(..))+#endif import Foreign.C.Types (CSChar, CInt, CShort, CLong, CLLong, CIntMax, CFloat, CDouble)  import Data.MemoTrie@@ -187,10 +190,14 @@   pure  = Sum   (<*>) = inSum2 ($) +instance AdditiveGroup a => Semigroup (Sum a) where+  (<>) = liftA2 (^+^)+ instance AdditiveGroup a => Monoid (Sum a) where   mempty  = Sum zeroV-  mappend = liftA2 (^+^)-+#if !(MIN_VERSION_base(4,11,0))+  mappend = (<>)+#endif  -- | Application a unary function inside a 'Sum' inSum :: (a -> b) -> (Sum a -> Sum b)
vector-space.cabal view
@@ -1,5 +1,5 @@ Name:                vector-space-Version:             0.12+Version:             0.13 Cabal-Version:       >= 1.6 Synopsis:            Vector & affine spaces, linear maps, and derivatives Category:            math@@ -54,6 +54,9 @@   }   if !impl(ghc >= 7.9) {     Build-Depends: void >= 0.4+  }+  if !impl(ghc >= 8.0) {+    Build-Depends: semigroups >= 0.16   }   ghc-options:         -Wall -O2 --  ghc-prof-options:    -prof -auto-all