packages feed

phonetic-languages-simplified-base 0.4.0.0 → 0.4.1.0

raw patch · 3 files changed

+30/−25 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base: diverse2GGL :: (Foldable t, Ord a) => a -> [a] -> t a -> Int16
+ Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base: uniquenessPeriodsGG :: (Foldable t, Ord a) => a -> [a] -> t a -> [Int16]

Files

CHANGELOG.md view
@@ -16,3 +16,9 @@  * Fourth version. Alongside with the Char representation added also the Int8 to the  Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base module.++## 0.4.1.0 -- 2021-11-05++* Fourth version revised A. Added generalized functions versions to the +Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base module.+
Phonetic/Languages/Simplified/Lists/UniquenessPeriodsG/Base.hs view
@@ -15,8 +15,10 @@  module Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base (   -- * List functions-  uniquenessPeriodsG+  uniquenessPeriodsGG+  , uniquenessPeriodsG   , uniquenessPeriodsGI8+  , diverse2GGL   , diverse2GL   , diverse2GLInt8 )where@@ -25,17 +27,16 @@ import Data.List import Data.Maybe (mapMaybe) --- | A lists variant of the diverse2 metrics from the @phonetic-languages-properties@ package.-diverse2GL :: Foldable t => String -> t Char -> Int16-diverse2GL whspss = sum . uniquenessPeriodsG whspss-{-# INLINE diverse2GL #-}+diverse2GGL :: (Foldable t, Ord a) => a -> [a] -> t a -> Int16+diverse2GGL delim whspss = sum . uniquenessPeriodsGG delim whspss+{-# INLINE diverse2GGL #-}  -- | A generalization of the uniquenessPeriods function of the @uniqueness-periods@ package.-uniquenessPeriodsG :: Foldable t => String -> t Char -> [Int16]-uniquenessPeriodsG whspss ws+uniquenessPeriodsGG :: (Foldable t, Ord a) => a -> [a] -> t a -> [Int16]+uniquenessPeriodsGG delim whspss ws  | null ws = []  | otherwise = mapMaybe (helpG sum whspss) . unfoldr f $ ks-     where !ks = indexedL '\00' ws+     where !ks = indexedL delim ws            !vs = mapMaybe g ks            g x             | (`elem` whspss) . snd $ x = Just (fst x)@@ -45,28 +46,26 @@              | 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 uniquenessPeriodsGG #-}++-- | A variant of the 'diverse2GGL' function for 'Char'.+diverse2GL :: Foldable t => String -> t Char -> Int16+diverse2GL = diverse2GGL '\00'+{-# INLINE diverse2GL #-}++-- | A variant for the 'uniquenessPeriodsGG' function for 'Char'.+uniquenessPeriodsG :: Foldable t => String -> t Char -> [Int16]+uniquenessPeriodsG = uniquenessPeriodsGG '\00' {-# INLINE uniquenessPeriodsG #-} --- | A lists variant of the diverse2 metrics from the @phonetic-languages-properties@ package.+-- | A variant of the 'diverse2GGL' function for 'Int8'. diverse2GLInt8 :: Foldable t => [Int8] -> t Int8 -> Int16-diverse2GLInt8 whspss = sum . uniquenessPeriodsGI8 whspss+diverse2GLInt8 = diverse2GGL (-1::Int8) {-# INLINE diverse2GLInt8 #-} --- | A generalization of the uniquenessPeriods function of the @uniqueness-periods@ package.+-- | A variant for the 'uniquenessPeriodsGG' function for 'Int8'. 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+uniquenessPeriodsGI8 = uniquenessPeriodsGG (-1::Int8) {-# INLINE uniquenessPeriodsGI8 #-}  -- | The first and the third list arguments of numbers (if not empty) must be sorted in the ascending order.
phonetic-languages-simplified-base.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-simplified-base-version:             0.4.0.0+version:             0.4.1.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