packages feed

phonetic-languages-simplified-base 0.5.0.0 → 0.6.0.0

raw patch · 4 files changed

+146/−2 lines, 4 filesdep ~phonetic-languages-basisPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: phonetic-languages-basis

API changes (from Hackage documentation)

+ Phonetic.Languages.Simplified.DataG.Base: innerPartitioning2 :: (InsertLeft t2 a, Monoid (t2 a), InsertLeft t2 c, Monoid (t2 c), Ord c) => FuncRep2 a b c -> t2 a -> (t2 a, t2 a)
+ Phonetic.Languages.Simplified.DataG.Base: innerPartitioningR2 :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c) => t2 (Result2 a b c) -> (t2 (Result2 a b c), t2 (Result2 a b c))
+ Phonetic.Languages.Simplified.DataG.Base: maximumEl2 :: (Foldable t2, Ord c) => FuncRep2 a b c -> t2 a -> Result2 a b c
+ Phonetic.Languages.Simplified.DataG.Base: maximumElR2 :: (Foldable t2, Ord c) => t2 (Result2 a b c) -> Result2 a b c
+ Phonetic.Languages.Simplified.DataG.Base: maximumGroupsClassification12 :: (InsertLeft t2 a, Monoid (t2 a), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d -> FuncRep2 a b c -> t2 a -> (t2 a, t2 a)
+ Phonetic.Languages.Simplified.DataG.Base: maximumGroupsClassification2 :: (InsertLeft t2 a, Monoid (t2 a), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d -> FuncRep2 a b c -> (t2 a, t2 a) -> (t2 a, t2 a)
+ Phonetic.Languages.Simplified.DataG.Base: maximumGroupsClassificationR2_2 :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d -> (t2 (Result2 a b c), t2 (Result2 a b c)) -> (t2 (Result2 a b c), t2 (Result2 a b c))
+ Phonetic.Languages.Simplified.DataG.Base: maximumGroupsClassificationR_2 :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c, Integral d) => d -> t2 (Result2 a b c) -> (t2 (Result2 a b c), t2 (Result2 a b c))
+ Phonetic.Languages.Simplified.DataG.Base: minMaximumElRs2 :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), Ord a, Ord b, Ord c) => t2 (Result2 a b c) -> (Result2 a b c, Result2 a b c)
+ Phonetic.Languages.Simplified.DataG.Base: minMaximumEls2 :: (InsertLeft t2 a, Monoid (t2 a), Ord a, Ord c) => FuncRep2 a b c -> t2 a -> (Result2 a b c, Result2 a b c)
+ Phonetic.Languages.Simplified.DataG.Base: partiR2 :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c) => (c -> Bool) -> t2 (Result2 a b c) -> (t2 (Result2 a b c), t2 (Result2 a b c))
+ Phonetic.Languages.Simplified.DataG.Base: toPropertiesF'2 :: FuncRep2 a b c -> a -> b
+ Phonetic.Languages.Simplified.DataG.Base: toResultR2 :: FuncRep2 a b c -> a -> Result2 a b c
+ Phonetic.Languages.Simplified.DataG.Base: toTransPropertiesF'2 :: FuncRep2 a b c -> a -> c
+ Phonetic.Languages.Simplified.DataG.Partir: partitioningR2 :: (InsertLeft t2 (Result2 a b Double), Monoid (t2 (Result2 a b Double)), InsertLeft t2 Double, Monoid (t2 Double)) => String -> t2 (Result2 a b Double) -> (t2 (Result2 a b Double), t2 (Result2 a b Double))

Files

CHANGELOG.md view
@@ -50,3 +50,7 @@  * Fifth version. Added functionality to find more straightforward (and probably thus more efficient) partitioning schemes. Added for this also a new module Phonetic.Languages.Simplified.DataG.Partir. Changed the dependencies schemes to make the development process for phonetic languages simpler.++## 0.6.0.0 -- 2022-08-09++* Sixth version. Added the functionality related to the Result2 data type in parallel to the old Result data type related one.
Phonetic/Languages/Simplified/DataG/Base.hs view
@@ -148,4 +148,134 @@ partiR p dataR = partitionG (p . transPropertiesF) dataR {-# INLINE partiR #-} +-----------------------------------------------------------++maximumEl2+  :: (Foldable t2, Ord c) => FuncRep2 a b c+  -> t2 a+  -> Result2 a b c+maximumEl2 !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 R2 {line2 = l, propertiesF2 = m, transPropertiesF2 = tm}+{-# INLINE maximumEl2 #-}++minMaximumEls2+  :: (InsertLeft t2 a, Monoid (t2 a), Ord a, Ord c) => FuncRep2 a b c+  -> t2 a+  -> (Result2 a b c,Result2 a b c)+minMaximumEls2 !frep2 data0 =+  let (!ln,!lx) = minMax11ByC (\x y -> compare (getAC frep2 x) (getAC frep2 y)) data0+      !mn = getAB frep2 ln+      !mx = getAB frep2 lx+      !tmn = getBC frep2 mn+      !tmx = getBC frep2 mx in (R2 {line2 = ln, propertiesF2 = mn, transPropertiesF2 = tmn}, R2 {line2 = lx, propertiesF2 = mx, transPropertiesF2 = tmx})+{-# INLINE minMaximumEls2 #-}++maximumElR2+  :: (Foldable t2, Ord c) => t2 (Result2 a b c)+  -> Result2 a b c+maximumElR2 = F.maximumBy (\x y -> compare (transPropertiesF2 x) (transPropertiesF2 y))+{-# INLINE maximumElR2 #-}++minMaximumElRs2+  :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), Ord a, Ord b, Ord c) => t2 (Result2 a b c)+  -> (Result2 a b c,Result2 a b c)+minMaximumElRs2 = minMax11ByC (\x y -> compare (transPropertiesF2 x) (transPropertiesF2 y))+{-# INLINE minMaximumElRs2 #-}++-----------------------------------------------------------------------------------++-- | The second argument must be not empty for the function to work correctly.+innerPartitioning2+  :: (InsertLeft t2 a, Monoid (t2 a), InsertLeft t2 c, Monoid (t2 c), Ord c) => FuncRep2 a b c+  -> t2 a+  -> (t2 a, t2 a)+innerPartitioning2 !frep2 data0 =+  let !l = F.maximum . mapG (toTransPropertiesF'2 frep2) $ data0 in partitionG ((== l) . getAC frep2) data0+{-# INLINE innerPartitioning2 #-}++-- | The first argument must be not empty for the function to work correctly.+innerPartitioningR2+  :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c) => t2 (Result2 a b c)+  -> (t2 (Result2 a b c), t2 (Result2 a b c))+innerPartitioningR2 dataR =+  let !l = F.maximum . mapG transPropertiesF2 $ dataR in partitionG ((== l) . transPropertiesF2) dataR+{-# INLINE innerPartitioningR2 #-}++maximumGroupsClassification2+  :: (InsertLeft t2 a, Monoid (t2 a), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d+  -> FuncRep2 a b c+  -> (t2 a, t2 a)+  -> (t2 a, t2 a)+maximumGroupsClassification2 !nGroups !frep2 (dataT,dataF)+ | F.null dataF = (dataT,mempty)+ | nGroups <= 0 = (dataT,dataF)+ | otherwise = maximumGroupsClassification2 (nGroups - 1) frep2 (dataT `mappend` partT,partF)+     where (!partT,!partF) = innerPartitioning2 frep2 dataF+{-# NOINLINE maximumGroupsClassification2 #-}++maximumGroupsClassification12+  :: (InsertLeft t2 a, Monoid (t2 a), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d+  -> FuncRep2 a b c+  -> t2 a+  -> (t2 a, t2 a)+maximumGroupsClassification12 !nGroups !frep2 data0+ | F.null data0 = (mempty,mempty)+ | nGroups <= 0 = innerPartitioning2 frep2 data0+ | otherwise = maximumGroupsClassification2 (nGroups - 1) frep2 . innerPartitioning2 frep2 $ data0+{-# NOINLINE maximumGroupsClassification12 #-}++maximumGroupsClassificationR2_2+  :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d+  -> (t2 (Result2 a b c), t2 (Result2 a b c))+  -> (t2 (Result2 a b c), t2 (Result2 a b c))+maximumGroupsClassificationR2_2 !nGroups (dataT,dataF)+ | F.null dataF = (dataT,mempty)+ | nGroups <= 0 = (dataT,dataF)+ | otherwise = maximumGroupsClassificationR2_2 (nGroups - 1) (dataT `mappend` partT,partF)+     where (!partT,!partF) = innerPartitioningR2 dataF+{-# NOINLINE maximumGroupsClassificationR2_2 #-}++maximumGroupsClassificationR_2+  :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c, Integral d) => d+  -> t2 (Result2 a b c)+  -> (t2 (Result2 a b c), t2 (Result2 a b c))+maximumGroupsClassificationR_2 !nGroups dataR+ | F.null dataR = (mempty,mempty)+ | nGroups <= 0 = innerPartitioningR2 dataR+ | otherwise = maximumGroupsClassificationR2_2 (nGroups - 1) . innerPartitioningR2 $ dataR+{-# NOINLINE maximumGroupsClassificationR_2 #-}++toResultR2+  :: FuncRep2 a b c+  -> a+  -> Result2 a b c+toResultR2 !frep2 !y = R2 { line2 = y, propertiesF2 = m, transPropertiesF2 = tm}+  where !m = getAB frep2 y+        !tm = getBC frep2 m+{-# INLINE toResultR2 #-}++toPropertiesF'2+  :: FuncRep2 a b c+  -> a+  -> b+toPropertiesF'2 !frep2 !y = getAB frep2 y+{-# INLINE toPropertiesF'2 #-}++toTransPropertiesF'2+  :: FuncRep2 a b c+  -> a+  -> c+toTransPropertiesF'2 !frep2 !y = getAC frep2 y+{-# INLINE toTransPropertiesF'2 #-}++-- | The second argument must be not empty for the function to work correctly.+partiR2+  :: (InsertLeft t2 (Result2 a b c), Monoid (t2 (Result2 a b c)), InsertLeft t2 c) => (c -> Bool)+  -> t2 (Result2 a b c)+  -> (t2 (Result2 a b c), t2 (Result2 a b c))+partiR2 p dataR = partitionG (p . transPropertiesF2) dataR+{-# INLINE partiR2 #-}+ 
Phonetic/Languages/Simplified/DataG/Partir.hs view
@@ -62,3 +62,13 @@  | F.null dataR = (mempty,mempty)  | otherwise = partiR (decodeCDouble xs) dataR {-# INLINABLE partitioningR #-}++partitioningR2+  :: (InsertLeft t2 (Result2 a b Double), Monoid (t2 (Result2 a b Double)), InsertLeft t2 Double, Monoid (t2 Double)) => String+  -> t2 (Result2 a b Double)+  -> (t2 (Result2 a b Double), t2 (Result2 a b Double))+partitioningR2 !xs dataR+ | F.null dataR = (mempty,mempty)+ | otherwise = partiR2 (decodeCDouble xs) dataR+{-# INLINABLE partitioningR2 #-}+
phonetic-languages-simplified-base.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-simplified-base-version:             0.5.0.0+version:             0.6.0.0 synopsis:            A basics of the phonetic-languages functionality that can be groupped. description:         The  common for different realizations functionality. Just the necessary one. homepage:            https://hackage.haskell.org/package/phonetic-languages-simlified-base@@ -21,6 +21,6 @@   exposed-modules:     Phonetic.Languages.Simplified.DataG.Base, Phonetic.Languages.Simplified.StrictVG.Base, Phonetic.Languages.Simplified.DataG.Partir   -- other-modules:   other-extensions:    BangPatterns, FlexibleContexts, MultiParamTypeClasses-  build-depends:       base >=4.8 && <5, subG ==0.5.3.0, phonetic-languages-permutations-array ==0.3.4.0, phonetic-languages-basis ==0.1.0.0+  build-depends:       base >=4.8 && <5, subG ==0.5.3.0, phonetic-languages-permutations-array ==0.3.4.0, phonetic-languages-basis ==0.1.1.0   -- hs-source-dirs:   default-language:    Haskell2010