packages feed

filters-basic 0.1.1.0 → 0.2.0.0

raw patch · 4 files changed

+23/−9 lines, 4 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -8,3 +8,7 @@  * First version revised A. Changed the Int arguments to the more general Integral c => c. +## 0.2.0.0 -- 2023-01-31++* Second version. Switched to NoImplicitPrelude and Strict extensions. Some code improvements. Updated the dependency boundaries.+
Data/Filters/Basic.hs view
@@ -1,9 +1,11 @@+{-# OPTIONS_HADDOCK -show-extensions #-}+ -- | -- Module      :  Data.Filters.Basic--- Copyright   :  (c) OleksandrZhabenko 2020+-- Copyright   :  (c) OleksandrZhabenko 2020-2023 -- License     :  MIT -- Stability   :  Experimental--- Maintainer  :  olexandr543@yahoo.com+-- Maintainer  :  oleksandr.zhabenko@yahoo.com -- -- A module allows to change the structure of the function output for the functions of -- elements from 'RealFrac' class. At the moment only the equal intervals are supported.@@ -11,6 +13,9 @@ -- that is intended to be rewritten. These functions are basic for it and for its successor, -- @phonetic-languages-filters-array@ package. +{-# LANGUAGE NoImplicitPrelude, Strict #-}++ module Data.Filters.Basic (   -- * One interval used   intervalNRealFrac@@ -19,6 +24,11 @@   , transfer1IEq3 ) where +import GHC.Base+import GHC.Num ((+), (-), (*), abs)+import GHC.Real+import GHC.Int+ -- | 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@@ -28,7 +38,7 @@   -> b   -> c intervalNRealFrac minE maxE n x- | maxE == minE = ceiling (0.5 * fromIntegral n)+ | abs (maxE - minE) < 0.000000001 = ceiling (0.5 * fromIntegral n)  | otherwise = zero2One . ceiling $ fromIntegral n * (x - minE) / (maxE - minE) {-# INLINE intervalNRealFrac #-} @@ -48,7 +58,7 @@   -> b   -> b unsafeTransfer1I5 minE0 maxE0 minE1 maxE1 x- | minE0 == maxE0 = x+ | abs (maxE0 - minE0) < 0.000000001 = x  | otherwise = minE1 + (x - minE0) * (maxE1 - minE1) / (maxE0 - minE0) {-# INLINE unsafeTransfer1I5 #-} 
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020 OleksandrZhabenko+Copyright (c) 2020-2023 Oleksandr Zhabenko  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
filters-basic.cabal view
@@ -2,14 +2,14 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                filters-basic-version:             0.1.1.0+version:             0.2.0.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 license:             MIT license-file:        LICENSE author:              OleksandrZhabenko-maintainer:          olexandr543@yahoo.com+maintainer:          oleksandr.zhabenko@yahoo.com -- copyright: category:            Data build-type:          Simple@@ -19,7 +19,7 @@ library   exposed-modules:     Data.Filters.Basic   -- other-modules:-  -- other-extensions:-  build-depends:       base >=4.7 && <5+  other-extensions:    NoImplicitPrelude, Strict+  build-depends:       base >=4.13 && <5   -- hs-source-dirs:   default-language:    Haskell2010