phonetic-languages-simplified-base 0.3.0.0 → 0.4.0.0
raw patch · 3 files changed
+30/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base: diverse2GLInt8 :: Foldable t => [Int8] -> t Int8 -> Int16
+ Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base: uniquenessPeriodsGI8 :: Foldable t => [Int8] -> t Int8 -> [Int16]
Files
- CHANGELOG.md +5/−0
- Phonetic/Languages/Simplified/Lists/UniquenessPeriodsG/Base.hs +24/−0
- phonetic-languages-simplified-base.cabal +1/−1
CHANGELOG.md view
@@ -11,3 +11,8 @@ ## 0.3.0.0 -- 2021-10-04 * Third version. Some code improvements. Some minor documentation improvements. Updated the dependencies boundaries.++## 0.4.0.0 -- 2021-11-04++* Fourth version. Alongside with the Char representation added also the Int8 to the +Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base module.
Phonetic/Languages/Simplified/Lists/UniquenessPeriodsG/Base.hs view
@@ -16,7 +16,9 @@ module Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base ( -- * List functions uniquenessPeriodsG+ , uniquenessPeriodsGI8 , diverse2GL+ , diverse2GLInt8 )where import GHC.Int@@ -44,6 +46,28 @@ | otherwise = let !idX0 = snd . head $ x in Just . (\vws (v2,v3) -> ((helpUPV3 vws [] . map fst $ v2,snd . head $ v2),v3)) vs . partition (\(_,xs) -> xs == idX0) $ x {-# INLINE uniquenessPeriodsG #-}++-- | A lists variant of the diverse2 metrics from the @phonetic-languages-properties@ package.+diverse2GLInt8 :: Foldable t => [Int8] -> t Int8 -> Int16+diverse2GLInt8 whspss = sum . uniquenessPeriodsGI8 whspss+{-# INLINE diverse2GLInt8 #-}++-- | A generalization of the uniquenessPeriods function of the @uniqueness-periods@ package.+uniquenessPeriodsGI8 :: Foldable t => [Int8] -> t Int8 -> [Int16]+uniquenessPeriodsGI8 whspss ws+ | null ws = []+ | otherwise = mapMaybe (helpG sum whspss) . unfoldr f $ ks+ where !ks = indexedL (-1) ws+ !vs = mapMaybe g ks+ g x+ | (`elem` whspss) . snd $ x = Just (fst x)+ | otherwise = Nothing+ {-# INLINE g #-}+ f !x+ | null x = Nothing+ | otherwise = let !idX0 = snd . head $ x in Just . (\vws (v2,v3) -> ((helpUPV3 vws [] .+ map fst $ v2,snd . head $ v2),v3)) vs . partition (\(_,xs) -> xs == idX0) $ x+{-# INLINE uniquenessPeriodsGI8 #-} -- | The first and the third list arguments of numbers (if not empty) must be sorted in the ascending order. helpUPV3 :: [Int16] -> [Int16] -> [Int16] -> [Int16]
phonetic-languages-simplified-base.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-base-version: 0.3.0.0+version: 0.4.0.0 synopsis: A basics of the phonetic-languages functionality. description: The common for different realizations functionality. Just the necessary one. homepage: https://hackage.haskell.org/package/phonetic-languages-simlified-base