reducers 3.12 → 3.12.1
raw patch · 2 files changed
+10/−2 lines, 2 filesdep ~fingertreedep ~semigroupsdep ~transformers
Dependency ranges changed: fingertree, semigroups, transformers
Files
- reducers.cabal +2/−2
- src/Data/Semigroup/Reducer.hs +8/−0
reducers.cabal view
@@ -1,6 +1,6 @@ name: reducers category: Data, Math, Numerical, Semigroups-version: 3.12+version: 3.12.1 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -32,7 +32,7 @@ hashable >= 1.1.2.1 && < 1.3, text >= 0.11.1.5 && < 1.3, unordered-containers >= 0.1.4 && < 0.3,- semigroups >= 0.17 && < 1,+ semigroups >= 0.9 && < 1, semigroupoids >= 4 && < 6 exposed-modules:
src/Data/Semigroup/Reducer.hs view
@@ -3,6 +3,10 @@ {-# LANGUAGE Trustworthy #-} #endif +#ifndef MIN_VERSION_semigroups+#define MIN_VERSION_semigroups(x,y,z) 1+#endif+ ----------------------------------------------------------------------------- -- | -- Module : Data.Semigroup.Reducer@@ -118,7 +122,11 @@ instance Semigroup Count where Count a <> Count b = Count (a + b)+#if MIN_VERSION_semigroups(0,17,0) stimes n (Count a) = Count $ fromIntegral n * a+#else+ times1p n (Count a) = Count $ (fromIntegral n + 1) * a+#endif instance Monoid Count where mempty = Count 0