packages feed

filters-basic 0.1.0.0 → 0.1.1.0

raw patch · 3 files changed

+10/−5 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.Filters.Basic: intervalNRealFrac :: RealFrac b => b -> b -> Int -> b -> Int
+ Data.Filters.Basic: intervalNRealFrac :: (RealFrac b, Integral c) => b -> b -> c -> b -> c
- Data.Filters.Basic: zero2One :: Int -> Int
+ Data.Filters.Basic: zero2One :: Integral a => a -> a

Files

CHANGELOG.md view
@@ -3,3 +3,8 @@ ## 0.1.0.0 -- 2020-12-31  * First version. Released on an unsuspecting world.++## 0.1.1.0 -- 2020-12-31++* First version revised A. Changed the Int arguments to the more general Integral c => c.+
Data/Filters/Basic.hs view
@@ -22,17 +22,17 @@ -- | Given the minimum and maximum elements, a quantity of equal intervals, and an element in between the first two arguments (or equal to one of them), finds out the -- index of the interval, to which the element belongs (starting from 1). The minimum element belongs to the interval with the index 1. intervalNRealFrac-  :: RealFrac b => b+  :: (RealFrac b, Integral c) => b   -> b-  -> Int+  -> c   -> b-  -> Int+  -> c intervalNRealFrac minE maxE n x  | maxE == minE = ceiling (0.5 * fromIntegral n)  | otherwise = zero2One . ceiling $ fromIntegral n * (x - minE) / (maxE - minE) {-# INLINE intervalNRealFrac #-} -zero2One :: Int -> Int+zero2One :: Integral a => a -> a zero2One x = if x == 0 then 1 else x {-# INLINE zero2One #-} 
filters-basic.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                filters-basic-version:             0.1.0.0+version:             0.1.1.0 synopsis:            Allows to change the structure of the function output. description:         Allows to change the structure of the function output for the functions of arguments whose data types have RealFrac instances. Has basic functions for the filters. Is taken from the uniqueness-periods-vector-filters package that is intended to be rewritten. These functions are basic for it and for its successor, phonetic-languages-filters-array package. homepage:            https://hackage.haskell.org/package/filters-basic