phonetic-languages-permutations-array 0.3.1.0 → 0.3.2.0
raw patch · 4 files changed
+41/−29 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutations1 :: Int -> Array Int [Int]
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsArr1 :: Array Int (Array Int [Int])
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsArrL1 :: Array Int [Array Int Int]
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsArrLN1 :: Int -> Array Int [Array Int Int]
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsArrN1 :: Int -> Array Int (Array Int [Int])
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsL1 :: [Array Int Int]
- Phonetic.Languages.Permutations.ArrMini1: genPairwisePermutationsLN1 :: Int -> [Array Int Int]
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutations1 :: Int -> Array Int [Int]
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsArr1 :: Array Int (Array Int [Int])
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsArrL1 :: Array Int [Array Int Int]
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsArrLN1 :: Int -> Array Int [Array Int Int]
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsArrN1 :: Int -> Array Int (Array Int [Int])
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsL1 :: [Array Int Int]
+ Phonetic.Languages.Permutations.ArrMini1: genElementaryPermutationsLN1 :: Int -> [Array Int Int]
Files
- CHANGELOG.md +6/−0
- Phonetic/Languages/Permutations/ArrMini1.hs +28/−28
- Phonetic/Languages/Permutations/Represent.hs +6/−0
- phonetic-languages-permutations-array.cabal +1/−1
CHANGELOG.md view
@@ -22,3 +22,9 @@ * Third version revised B. Added a new module Phonetic.Languages.Permutations.Represent with a data type to mark type of permutations from the other modules where permutations from the other modules are possibly used together.++## 0.3.2.0 -- 2022-01-16++* Third version revised C. Renamed functions in the Phonetic.Languages.Permutations.ArrMini1 module. Added a new function to +the Phonetic.Languages.Permutations.Represent module.+
Phonetic/Languages/Permutations/ArrMini1.hs view
@@ -11,23 +11,23 @@ -- module uses no vectors, but instead uses arrays. module Phonetic.Languages.Permutations.ArrMini1 (- genPairwisePermutations1+ genElementaryPermutations1 , pairsSwapP1- , genPairwisePermutationsArrN1- , genPairwisePermutationsArr1- , genPairwisePermutationsLN1- , genPairwisePermutationsL1- , genPairwisePermutationsArrLN1- , genPairwisePermutationsArrL1+ , genElementaryPermutationsArrN1+ , genElementaryPermutationsArr1+ , genElementaryPermutationsLN1+ , genElementaryPermutationsL1+ , genElementaryPermutationsArrLN1+ , genElementaryPermutationsArrL1 ) where import GHC.Arr -genPairwisePermutations1 :: Int -> Array Int [Int]-genPairwisePermutations1 n = listArray (0,l-1) xs+genElementaryPermutations1 :: Int -> Array Int [Int]+genElementaryPermutations1 n = listArray (0,l-1) xs where xs = pairsSwapP1 . take n $ [0..] l = length xs-{-# INLINE genPairwisePermutations1 #-}+{-# INLINE genElementaryPermutations1 #-} pairsSwapP1 :: [Int] -> [[Int]] pairsSwapP1 xs = xs:[swap2Ls1 k m xs | k <- xs, m <- xs , abs (k - m) > 1] `mappend` [swap2Ls1 k (k - 1) xs | k <- drop 1 xs ]@@ -54,26 +54,26 @@ swap2Ls1 k m = map (swap2ns1 k m) {-# INLINE swap2Ls1 #-} -genPairwisePermutationsArrN1 :: Int -> Array Int (Array Int [Int])-genPairwisePermutationsArrN1 n = amap genPairwisePermutations1 . listArray (0,n - 2) $ [2..n]-{-# INLINE genPairwisePermutationsArrN1 #-}+genElementaryPermutationsArrN1 :: Int -> Array Int (Array Int [Int])+genElementaryPermutationsArrN1 n = amap genElementaryPermutations1 . listArray (0,n - 2) $ [2..n]+{-# INLINE genElementaryPermutationsArrN1 #-} -genPairwisePermutationsArr1 :: Array Int (Array Int [Int])-genPairwisePermutationsArr1 = genPairwisePermutationsArrN1 10-{-# INLINE genPairwisePermutationsArr1 #-}+genElementaryPermutationsArr1 :: Array Int (Array Int [Int])+genElementaryPermutationsArr1 = genElementaryPermutationsArrN1 10+{-# INLINE genElementaryPermutationsArr1 #-} -genPairwisePermutationsLN1 :: Int -> [Array Int Int]-genPairwisePermutationsLN1 n = map (\xs -> listArray (0,n - 1) xs) . pairsSwapP1 . take n $ [0..]-{-# INLINE genPairwisePermutationsLN1 #-}+genElementaryPermutationsLN1 :: Int -> [Array Int Int]+genElementaryPermutationsLN1 n = map (\xs -> listArray (0,n - 1) xs) . pairsSwapP1 . take n $ [0..]+{-# INLINE genElementaryPermutationsLN1 #-} -genPairwisePermutationsL1 :: [Array Int Int]-genPairwisePermutationsL1 = genPairwisePermutationsLN1 10-{-# INLINE genPairwisePermutationsL1 #-}+genElementaryPermutationsL1 :: [Array Int Int]+genElementaryPermutationsL1 = genElementaryPermutationsLN1 10+{-# INLINE genElementaryPermutationsL1 #-} -genPairwisePermutationsArrLN1 :: Int -> Array Int [Array Int Int]-genPairwisePermutationsArrLN1 n = amap genPairwisePermutationsLN1 . listArray (0,n - 2) $ [2..n]-{-# INLINE genPairwisePermutationsArrLN1 #-}+genElementaryPermutationsArrLN1 :: Int -> Array Int [Array Int Int]+genElementaryPermutationsArrLN1 n = amap genElementaryPermutationsLN1 . listArray (0,n - 2) $ [2..n]+{-# INLINE genElementaryPermutationsArrLN1 #-} -genPairwisePermutationsArrL1 :: Array Int [Array Int Int]-genPairwisePermutationsArrL1 = genPairwisePermutationsArrLN1 10-{-# INLINE genPairwisePermutationsArrL1 #-}+genElementaryPermutationsArrL1 :: Array Int [Array Int Int]+genElementaryPermutationsArrL1 = genElementaryPermutationsArrLN1 10+{-# INLINE genElementaryPermutationsArrL1 #-}
Phonetic/Languages/Permutations/Represent.hs view
@@ -17,3 +17,9 @@ instance Show PermutationsType where show (P x) = "+p " `mappend` show x++bTransform2Perms :: [String] -> PermutationsType+bTransform2Perms ys+ | ys == ["1"] = P 1+ | ys == ["2"] = P 2+ | otherwise = P 0
phonetic-languages-permutations-array.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/ name: phonetic-languages-permutations-array-version: 0.3.1.0+version: 0.3.2.0 synopsis: Permutations and universal set related functions for the phonetic-languages series description: Permutations-related to produce universal set of the task. Uses arrays instead of vectors. homepage: https://hackage.haskell.org/package/phonetic-languages-permutations-array