summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandrZhabenko <>2020-11-20 15:47:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-11-20 15:47:00 (GMT)
commit0ef613c7802f9a7135c62e87ab2b0958967fa108 (patch)
treec305ffbb29a14dec2425d66f59149419bde8f385
parentc48f223026db851adf9b1d3273233bfaab6e0682 (diff)
version 0.2.0.00.2.0.0
-rw-r--r--CHANGELOG.md5
-rw-r--r--Phonetic/Languages/Simplified/StrictVG.hs36
-rw-r--r--phonetic-languages-simplified-common.cabal4
3 files changed, 39 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b3dac54..297e63f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,3 +3,8 @@
## 0.1.0.0 -- 2020-11-19
* First version. Released on an unsuspecting world.
+
+## 0.2.0.0 -- 2020-11-20
+
+* Second version. Added new functions to the Phonetic.Languages.Simplified.StrictVG module accordingly to the updated dependency of
+phonetic-languages-permutations.
diff --git a/Phonetic/Languages/Simplified/StrictVG.hs b/Phonetic/Languages/Simplified/StrictVG.hs
index f0d80f8..78e6ad4 100644
--- a/Phonetic/Languages/Simplified/StrictVG.hs
+++ b/Phonetic/Languages/Simplified/StrictVG.hs
@@ -27,7 +27,7 @@ uniquenessVariants2GNB ::
-> (t a -> VB.Vector a) -- ^ The function that is used internally to convert to the boxed 'VB.Vector' of @a@ so that the function can process further the permutations
-> ((t (t a)) -> VB.Vector (VB.Vector a)) -- ^ The function that is used internally to convert to the boxed 'VB.Vector' of 'VB.Vector' of @a@ so that the function can process further
-> (VB.Vector a -> t a) -- ^ The function that is used internally to convert from the boxed 'VB.Vector' of @a@ so that the function can process further
- -> VB.Vector (VB.Vector Int) -- ^ The list of permutations of 'Int' indices starting from 0 and up to n (n is probably less than 8).
+ -> VB.Vector (VB.Vector Int) -- ^ The permutations of 'Int' indices starting from 0 and up to n (n is probably less than 8).
-> t (t a) -- ^ Must be obtained as 'subG' @whspss xs@
-> VB.Vector (t a)
uniquenessVariants2GNB !hd f1 f2 f3 perms !subs = uniquenessVariants2GNPB mempty mempty hd f1 f2 f3 perms subs
@@ -40,13 +40,41 @@ uniquenessVariants2GNPB ::
-> (t a -> VB.Vector a) -- ^ The function that is used internally to convert to the boxed 'VB.Vector' of @a@ so that the function can process further the permutations
-> ((t (t a)) -> VB.Vector (VB.Vector a)) -- ^ The function that is used internally to convert to the boxed 'VB.Vector' of 'VB.Vector' of @a@ so that the function can process further
-> (VB.Vector a -> t a) -- ^ The function that is used internally to convert from the boxed 'VB.Vector' of @a@ so that the function can process further
- -> VB.Vector (VB.Vector Int) -- ^ The list of permutations of 'Int' indices starting from 0 and up to n (n is probably less than 7).
+ -> VB.Vector (VB.Vector Int) -- ^ The permutations of 'Int' indices starting from 0 and up to n (n is probably less than 7).
-> t (t a) -- ^ Must be obtained as @subG whspss xs@
-> VB.Vector (t a)
uniquenessVariants2GNPB !ts !us !hd f1 f2 f3 perms !subs
- | F.null subs = VB.empty
+ | F.null subs = mempty
| otherwise =
let !uss = (hd %@ us) %^ mempty
- !baseV = VB.map (hd `VB.cons`) . f2 $ subs
+ !baseV = VB.map (hd %@) . f2 $ subs
!ns = universalSetG ts uss f1 f2 perms baseV in VB.map f3 ns
+uniquenessVariants2GNBL ::
+ (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a))) => a -- ^ The first most common element in the \"whitespace symbols\" structure
+ -> (t a -> [a]) -- ^ The function that is used internally to convert to the @[a]@ so that the function can process further the permutations
+ -> ((t (t a)) -> [[a]]) -- ^ The function that is used internally to convert to the @[[a]]@ so that the function can process further
+ -> ([a] -> t a) -- ^ The function that is used internally to convert to the needed representation so that the function can process further
+ -> [VB.Vector Int] -- ^ The permutations of 'Int' indices starting from 0 and up to n (n is probably less than 8).
+ -> t (t a) -- ^ Must be obtained as 'subG' @whspss xs@
+ -> [t a]
+uniquenessVariants2GNBL !hd f1 f2 f3 perms !subs = uniquenessVariants2GNPBL mempty mempty hd f1 f2 f3 perms subs
+{-# INLINE uniquenessVariants2GNBL #-}
+
+uniquenessVariants2GNPBL ::
+ (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a))) => t a
+ -> t a
+ -> a -- ^ The first most common element in the whitespace symbols structure
+ -> (t a -> [a]) -- ^ The function that is used internally to convert to the @[a]@ so that the function can process further the permutations
+ -> ((t (t a)) -> [[a]]) -- ^ The function that is used internally to convert to the @[[a]]@ so that the function can process further
+ -> ([a] -> t a) -- ^ The function that is used internally to convert to the needed representation that the function can process further
+ -> [VB.Vector Int] -- ^ The permutations of 'Int' indices starting from 0 and up to n (n is probably less than 7).
+ -> t (t a) -- ^ Must be obtained as @subG whspss xs@
+ -> [t a]
+uniquenessVariants2GNPBL !ts !us !hd f1 f2 f3 perms !subs
+ | F.null subs = mempty
+ | otherwise =
+ let !uss = (hd %@ us) %^ mempty
+ !baseV = VB.fromList . map (hd %@) . f2 $ subs
+ !ns = universalSetGL ts uss f1 f2 perms baseV in map f3 ns
+
diff --git a/phonetic-languages-simplified-common.cabal b/phonetic-languages-simplified-common.cabal
index e980aa2..6d883bc 100644
--- a/phonetic-languages-simplified-common.cabal
+++ b/phonetic-languages-simplified-common.cabal
@@ -3,7 +3,7 @@
-- http://haskell.org/cabal/users-guide/
name: phonetic-languages-simplified-common
-version: 0.1.0.0
+version: 0.2.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
@@ -21,6 +21,6 @@ library
exposed-modules: Phonetic.Languages.Simplified.DataG, Phonetic.Languages.Simplified.StrictVG
-- other-modules:
other-extensions: BangPatterns, FlexibleContexts
- build-depends: base >=4.8 && <4.15, subG >=0.4.2 && <1, subG-instances >=0.1 && <1, vector >=0.11 && <0.14, phonetic-languages-permutations >=0.1.1 && <1
+ build-depends: base >=4.8 && <4.15, subG >=0.4.2 && <1, subG-instances >=0.1 && <1, vector >=0.11 && <0.14, phonetic-languages-permutations >=0.2 && <1
-- hs-source-dirs:
default-language: Haskell2010