phonetic-languages-simplified-common 0.3.4.0 → 0.4.0.0
raw patch · 3 files changed
+24/−18 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Phonetic.Languages.Simplified.DataG: [metrices] :: Result t a b c -> !b
- Phonetic.Languages.Simplified.DataG: [transMetrices] :: Result t a b c -> !c
- Phonetic.Languages.Simplified.DataG: toMetrices' :: FuncRep2 (t a) b c -> t a -> b
- Phonetic.Languages.Simplified.DataG: toTransMetrices' :: FuncRep2 (t a) b c -> t a -> c
+ Phonetic.Languages.Simplified.DataG: [propertiesF] :: Result t a b c -> !b
+ Phonetic.Languages.Simplified.DataG: [transPropertiesF] :: Result t a b c -> !c
+ Phonetic.Languages.Simplified.DataG: toPropertiesF' :: FuncRep2 (t a) b c -> t a -> b
+ Phonetic.Languages.Simplified.DataG: toTransPropertiesF' :: FuncRep2 (t a) b c -> t a -> c
Files
- CHANGELOG.md +6/−0
- Phonetic/Languages/Simplified/DataG.hs +17/−17
- phonetic-languages-simplified-common.cabal +1/−1
CHANGELOG.md view
@@ -34,3 +34,9 @@ ## 0.3.4.0 -- 2020-11-28 * Third version revised D. Added new functions to the module Phonetic.Languages.Simplified.DataG. Fixed issues with group classification for empty data.++## 0.4.0.0 -- 2020-12-05++* Fourth version. Changed the names of the records' second and third fields to avoid misusage of the terminology.+Some minor code improvements.+
Phonetic/Languages/Simplified/DataG.hs view
@@ -17,15 +17,15 @@ import Data.SubG import Data.MinMax.Preconditions -data Result t a b c = R {line :: !(t a), metrices :: !b, transMetrices :: !c} deriving Eq+data Result t a b c = R {line :: !(t a), propertiesF :: !b, transPropertiesF :: !c} deriving Eq instance (Ord (t a), Ord b, Ord c) => Ord (Result t a b c) where compare x y- = case compare (transMetrices x) (transMetrices y) of- EQ -> case compare (metrices x) (metrices y) of- EQ -> compare (line x) (line y)- z -> z- z0 -> z0+ = case compare (transPropertiesF x) (transPropertiesF y) of+ !EQ -> case compare (propertiesF x) (propertiesF y) of+ !EQ -> compare (line x) (line y)+ !z -> z+ !z0 -> z0 data FuncRep2 a b c = D (a -> b) (b -> c) @@ -45,7 +45,7 @@ maximumEl !frep2 data0 = let !l = F.maximumBy (\x y -> compare (getAC frep2 x) (getAC frep2 y)) data0 !m = getAB frep2 l- !tm = getBC frep2 m in R {line = l, metrices = m, transMetrices = tm}+ !tm = getBC frep2 m in R {line = l, propertiesF = m, transPropertiesF = tm} minMaximumEls :: (InsertLeft t2 (t a), Monoid (t2 (t a)), Ord (t a), Ord c) => FuncRep2 (t a) b c@@ -56,17 +56,17 @@ !mn = getAB frep2 ln !mx = getAB frep2 lx !tmn = getBC frep2 mn- !tmx = getBC frep2 mx in (R {line = ln, metrices = mn, transMetrices = tmn}, R {line = lx, metrices = mx, transMetrices = tmx})+ !tmx = getBC frep2 mx in (R {line = ln, propertiesF = mn, transPropertiesF = tmn}, R {line = lx, propertiesF = mx, transPropertiesF = tmx}) maximumElR :: (Foldable t2, Ord c) => t2 (Result t a b c) -> Result t a b c-maximumElR = F.maximumBy (\x y -> compare (transMetrices x) (transMetrices y))+maximumElR = F.maximumBy (\x y -> compare (transPropertiesF x) (transPropertiesF y)) minMaximumElRs :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), Ord (t a), Ord b, Ord c) => t2 (Result t a b c) -> (Result t a b c,Result t a b c)-minMaximumElRs = minMax11ByC (\x y -> compare (transMetrices x) (transMetrices y))+minMaximumElRs = minMax11ByC (\x y -> compare (transPropertiesF x) (transPropertiesF y)) ----------------------------------------------------------------------------------- @@ -76,14 +76,14 @@ -> t2 (t a) -> (t2 (t a), t2 (t a)) innerPartitioning !frep2 data0 =- let !l = F.maximum . mapG (toTransMetrices' frep2) $ data0 in partitionG ((== l) . getAC frep2) data0+ let !l = F.maximum . mapG (toTransPropertiesF' frep2) $ data0 in partitionG ((== l) . getAC frep2) data0 -- | The second argument must be not empty for the function to work correctly. innerPartitioningR :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c) => t2 (Result t a b c) -> (t2 (Result t a b c), t2 (Result t a b c)) innerPartitioningR dataR =- let !l = F.maximum . mapG transMetrices $ dataR in partitionG ((== l) . transMetrices) dataR+ let !l = F.maximum . mapG transPropertiesF $ dataR in partitionG ((== l) . transPropertiesF) dataR maximumGroupsClassification :: (InsertLeft t2 (t a), Monoid (t2 (t a)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d@@ -129,18 +129,18 @@ :: FuncRep2 (t a) b c -> t a -> Result t a b c-toResultR !frep2 !ys = R { line = ys, metrices = m, transMetrices = tm}+toResultR !frep2 !ys = R { line = ys, propertiesF = m, transPropertiesF = tm} where !m = getAB frep2 ys !tm = getBC frep2 m -toMetrices'+toPropertiesF' :: FuncRep2 (t a) b c -> t a -> b-toMetrices' !frep2 !ys = getAB frep2 ys+toPropertiesF' !frep2 !ys = getAB frep2 ys -toTransMetrices'+toTransPropertiesF' :: FuncRep2 (t a) b c -> t a -> c-toTransMetrices' !frep2 !ys = getAC frep2 ys+toTransPropertiesF' !frep2 !ys = getAC frep2 ys
phonetic-languages-simplified-common.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-common-version: 0.3.4.0+version: 0.4.0.0 synopsis: A simplified version of the phonetic-languages-functionality description: A simplified version of the phonetic-languages-functionality. Tries to use only necessary functionality and reduce the other one. homepage: https://hackage.haskell.org/package/phonetic-languages-simlified-common