packages feed

phonetic-languages-constraints-array 0.1.0.0 → 0.1.1.0

raw patch · 3 files changed

+26/−7 lines, 3 filesdep ~basedep ~subGPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, subG

API changes (from Hackage documentation)

+ Languages.UniquenessPeriods.Array.Constraints: fixedPointsG :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int (Int, Int) -> t (Array Int Int) -> t (Array Int Int)
+ Languages.UniquenessPeriods.Array.Constraints: fixedPointsS :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int Int -> t (Array Int Int) -> t (Array Int Int)

Files

CHANGELOG.md view
@@ -3,3 +3,8 @@ ## 0.1.0.0 -- 2020-12-31  * First version. Released to the world.++## 0.1.1.0 -- 2022-03-24++* First version revised A. Updated the dependency boundaries to support the latest GHC and Cabal versions. Added some experimental functions that +are not further used.
Languages/UniquenessPeriods/Array/Constraints.hs view
@@ -2,7 +2,7 @@  -- | -- Module      :  Languages.UniquenessPeriods.Array.Constraints--- Copyright   :  (c) OleksandrZhabenko 2020+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -26,6 +26,9 @@   -- ** With multiple elements specified   , unsafeSeveralA   , unsafeSeveralB+  -- ** With fixed points+  , fixedPointsG+  , fixedPointsS ) where  import Data.Maybe (fromJust)@@ -70,18 +73,29 @@ -- the permutations each one being represented as 'Array' 'Int' 'Int' where the elements are all the numbers in the range [0..n] without duplication. -- The first argument -- is the index of the the element (a word or their concatenated combination in the @phonetic-languages@ series of packages), the second argument--- is 'Array' 'Int' of indices that are in the range [0..n]. Filters (and reduces further complex computtions) the permutations so that only the+-- is 'Array' 'Int' of indices that are in the range [0..n]. Filters (and reduces further complex computations) the permutations so that only the -- variants with the indices in the second argument all stand AFTER the element with the index equal to the first argument. unsafeSeveralA :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int) unsafeSeveralA !i0 arr x = filterG (g i0 arr) x-   where g !i0 !arr1 arr2 = all id . amap (\k -> unsafeOrderIJ i0 k arr2) $ arr1+   where g !i0 !arr1 arr2 = all (\k -> unsafeOrderIJ i0 k arr2) arr1  -- | Being given the data satisfying the constraints in the module header reduces the number of further computations in the foldable structure of -- the permutations each one being represented as 'Array' 'Int' 'Int' where the elements are all the numbers in the range [0..n] without duplication. -- The first argument -- is the index of the the element (a word or their concatenated combination in the @phonetic-languages@ series of packages), the second argument--- is 'Array' of indices that are in the range [0..n]. Filters (and reduces further complex computtions) the permutations so that only the+-- is 'Array' of indices that are in the range [0..n]. Filters (and reduces further complex computations) the permutations so that only the -- variants with the indices in the second argument all stand BEFORE the element with the index equal to the first argument. unsafeSeveralB :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int) unsafeSeveralB !i0 arr x = filterG (g i0 arr) x-   where g !i0 !arr1 arr2 = all id . amap (\k -> unsafeOrderIJ k i0 arr2) $ arr1+   where g !i0 !arr1 arr2 = all (\k -> unsafeOrderIJ k i0 arr2) arr1++--------------------------------------------------------------------------------++fixedPointsG :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int (Int,Int) -> t (Array Int Int) -> t (Array Int Int)+fixedPointsG arr xs = filterG (f arr) xs+   where f arr1 arr2 = all (\(k,j) -> unsafeAt arr2 k == j) arr1++fixedPointsS :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int Int -> t (Array Int Int) -> t (Array Int Int)+fixedPointsS arr xs = filterG (f arr) xs+   where f arr1 arr2 = all (\k -> unsafeAt arr2 k == k) arr1+
phonetic-languages-constraints-array.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/  name:                phonetic-languages-constraints-array-version:             0.1.0.0+version:             0.1.1.0 synopsis:            Constraints to filter the needed permutations description:         Provides several the most important variants of constraints. Can be used with the phonetic-languages-common series of package. Instead of vectors, uses arrays. homepage:            https://hackage.haskell.org/package/phonetic-languages-constraints-array@@ -20,6 +20,6 @@   exposed-modules:     Languages.UniquenessPeriods.Array.Constraints, Languages.UniquenessPeriods.Array.Constraints.Encoded   -- other-modules:   other-extensions:    BangPatterns, FlexibleInstances, FlexibleContexts-  build-depends:       base >=4.8 && <4.15, subG >= 0.4.2 && <1+  build-depends:       base >=4.8 && <5, subG >= 0.5.3 && <1   -- hs-source-dirs:   default-language:    Haskell2010