uniqueness-periods-vector-general 0.3.0.0 → 0.4.0.0
raw patch · 3 files changed
+84/−118 lines, 3 filesdep ~uniqueness-periods-vector-commonPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: uniqueness-periods-vector-common
API changes (from Hackage documentation)
- Languages.UniquenessPeriods.Vector.General.Debug: inner1 :: (Eq a, Ord b, Show a, Show b) => Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO ([b], UniqG a b)
- Languages.UniquenessPeriods.Vector.General.Debug: printHelp :: (Show a, Show b) => Info2 -> UniquenessG1 a b -> IO ()
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNProperties2VGN :: (Eq a, Ord b, Show a, Show b) => [a] -> Preapp a -> Int -> Int -> Info2 -> Vector ([b] -> b) -> ([a] -> Vector c) -> (Vector c -> [b]) -> UniqG a b -> [a] -> IO (UniqG a b)
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesVN :: (Eq a, Ord b, Show a, Show b) => Int -> Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO (UniqG a b)
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesVNAll :: (Eq a, Ord b, Show a, Show b) => Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO (UniqG a b)
+ Languages.UniquenessPeriods.Vector.General.Debug: printUniquenessG1 :: (Show a, Show b) => Info2 -> UniquenessG1 a b -> IO ()
+ Languages.UniquenessPeriods.Vector.General.Debug: printUniquenessG1List :: (Show a, Show b) => Info2 -> [UniquenessG1 a b] -> IO ()
- Languages.UniquenessPeriods.Vector.General.Debug: maximumElBy :: (Eq a, Ord b) => Int -> Vector ([b] -> b) -> UniqG a b -> UniquenessG1 a b
+ Languages.UniquenessPeriods.Vector.General.Debug: maximumElBy :: (Eq a, Ord b) => Int -> Vector ([b] -> b) -> UniqG2 a b -> UniquenessG1 a b
- Languages.UniquenessPeriods.Vector.General.Debug: maximumElByAll :: (Eq a, Ord b, Show a, Show b) => Vector ([b] -> b) -> UniqG a b -> UniquenessG1 a b
+ Languages.UniquenessPeriods.Vector.General.Debug: maximumElByAll :: (Eq a, Ord b, Show a, Show b) => Vector ([b] -> b) -> UniqG2 a b -> UniquenessG1 a b
- Languages.UniquenessPeriods.Vector.General.Debug: maximumElByVec :: (Eq a, Ord b, Show a, Show b) => Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO (UniqG a b)
+ Languages.UniquenessPeriods.Vector.General.Debug: maximumElByVec :: (Eq a, Ord b, Show a, Show b) => Int -> Vector ([b] -> b) -> UniqG2 a b -> UniqG2 a b
- Languages.UniquenessPeriods.Vector.General.Debug: maximumElByVecAll :: (Eq a, Ord b, Show a, Show b) => Info2 -> Vector ([b] -> b) -> UniqG a b -> IO (UniqG a b)
+ Languages.UniquenessPeriods.Vector.General.Debug: maximumElByVecAll :: (Eq a, Ord b, Show a, Show b) => Vector ([b] -> b) -> UniqG2 a b -> UniqG2 a b
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNProperties2GN :: (Eq a, Ord b, Show a, Show b) => [a] -> Preapp a -> Int -> Int -> Info2 -> Vector ([b] -> b) -> ([a] -> Vector c) -> (Vector c -> [b]) -> [a] -> IO ()
+ Languages.UniquenessPeriods.Vector.General.Debug: uniqNProperties2GN :: (Eq a, Ord b, Show a, Show b) => [a] -> Preapp a -> Int -> Int -> Vector ([b] -> b) -> ([a] -> Vector c) -> (Vector c -> [b]) -> [a] -> UniqG2 a b
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesN :: (Eq a, Ord b, Show a, Show b) => Int -> Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO ()
+ Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesN :: (Eq a, Ord b, Show a, Show b) => Int -> Int -> Vector ([b] -> b) -> UniqG2 a b -> UniqG2 a b
- Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesNAll :: (Eq a, Ord b, Show a, Show b) => Int -> Info2 -> Vector ([b] -> b) -> UniqG a b -> IO ()
+ Languages.UniquenessPeriods.Vector.General.Debug: uniqNPropertiesNAll :: (Eq a, Ord b, Show a, Show b) => Int -> Vector ([b] -> b) -> UniqG2 a b -> UniqG2 a b
Files
- ChangeLog.md +5/−0
- Languages/UniquenessPeriods/Vector/General/Debug.hs +77/−116
- uniqueness-periods-vector-general.cabal +2/−2
ChangeLog.md view
@@ -34,3 +34,8 @@ * Third version. Fixed issues with being not ordered printed information. Changed the names of the functions. Conversion tables of the changed names is now given in the ConversionTable.txt file. Some documentation improvements. ++## 0.4.0.0 -- 2020-09-12++* Fourth version. Changed dependency boundaries. Library is rewritten to avoid the redundant complexity of the algorithm realization, to make +the functions basically pure, to fix the issue with printing subsystem in case of the file output. Changes break the previous behaviour, so please, check the code.
Languages/UniquenessPeriods/Vector/General/Debug.hs view
@@ -13,31 +13,24 @@ module Languages.UniquenessPeriods.Vector.General.Debug ( -- * Pure functions- -- ** Self-recursive pure function+ -- ** Self-recursive pure functions and connected with them ones maximumElBy+ , uniqNPropertiesN+ , uniqNPropertiesNAll+ , uniqNProperties2GN -- ** Pure functions , maximumElByAll , maximumElGBy , uniquenessVariantsGN+ , maximumElByVec+ , maximumElByVecAll -- * IO functions -- ** Printing subsystem , toFile- , printHelp- -- ** Processment functions- , maximumElByVec- , maximumElByVecAll- -- *** Calls pure self-recursive function- , inner1- -- *** Self-recursive IO functions and connected with them ones- , uniqNPropertiesN- , uniqNPropertiesNAll- , uniqNPropertiesVN- , uniqNPropertiesVNAll- , uniqNProperties2GN- , uniqNProperties2VGN+ , printUniquenessG1+ , printUniquenessG1List ) where -import Data.Maybe (fromJust) import Data.Print.Info import System.IO import qualified Data.Vector as V@@ -53,16 +46,15 @@ maximumElBy :: (Eq a, Ord b) => Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left. -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.+ -> UniqG2 a b -- ^ The data to be analyzed. -> UniquenessG1 a b -- ^ The maximum element in respect with the given parameters. maximumElBy k vN y | compare k (V.length vN) == GT = error "Languages.UniquenessPeriods.Vector.General.Debug.maximumElBy: undefined for that amount of norms. " | compare k 0 == GT =- let maxK = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 (k - 1)) (V.unsafeIndex vN1 (k - 1))) . snd . get2 $ y- vK = V.filter (\(_,vN2,_) -> V.unsafeIndex vN2 (k - 1) == V.unsafeIndex (secondFrom3 maxK) (k - 1)) . snd . get2 $ y in- if isU y then maximumElBy (k - 1) (V.unsafeSlice 0 (k - 1) vN) (U vK)- else maximumElBy (k - 1) (V.unsafeSlice 0 (k - 1) vN) (UL (fromJust . fst . get2 $ y,vK))- | otherwise = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 0) (V.unsafeIndex vN1 0)) . snd . get2 $ y+ let maxK = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 (k - 1)) (V.unsafeIndex vN1 (k - 1))) . snd . get22 $ y+ vK = V.filter (\(_,vN2,_) -> V.unsafeIndex vN2 (k - 1) == V.unsafeIndex (secondFrom3 maxK) (k - 1)) . snd . get22 $ y in+ maximumElBy (k - 1) (V.unsafeSlice 0 (k - 1) vN) (UL2 (fst . get22 $ y,vK))+ | otherwise = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 0) (V.unsafeIndex vN1 0)) . snd . get22 $ y {-# INLINE maximumElBy #-} -- | Inspired by appendS16LEFile function from Melodics.Ukrainian module from @mmsyn6ukr@ package.@@ -79,11 +71,11 @@ hClose hdl) -- | Is used to print output specified to the 'stdout' or to the 'FilePath' specified as the inner argument in the 'Info2' parameter.-printHelp +printUniquenessG1 :: (Show a, Show b) => Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file. -> UniquenessG1 a b -- ^ The element, for which the information is printed. -> IO ()-printHelp info uni +printUniquenessG1 info uni | isI1 info = case (\(I1 x) -> x) info of A -> putStr "" -- nothing is printed@@ -105,25 +97,45 @@ Gf xs -> toFile xs [show . firstFrom3 $ uni, show . secondFrom3 $ uni] ~(Hf xs) -> toFile xs [show . lastFrom3 $ uni, show . firstFrom3 $ uni, show. secondFrom3 $ uni] -- the most verbose output --- | Auxiliary function that is used inside the 'maximumElByVec'. Finds the maximum element, prints needed information and returns the result. -inner1 :: - (Eq a, Ord b, Show a, Show b) => Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.- -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO ([b],UniqG a b)-inner1 k info vN x = do - let uniq = maximumElBy k vN x- let fsT = firstFrom3 uniq- printHelp info uniq- return (fsT,x)-{-# INLINE inner1 #-}+-- | Is used to print output specified to the 'stdout' or to the 'FilePath' specified as the inner argument in the 'Info2' parameter.+printUniquenessG1List + :: (Show a, Show b) => Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.+ -> [UniquenessG1 a b] -- ^ The list of elements, for which the information is printed.+ -> IO ()+printUniquenessG1List info (y:ys)+ | isI1 info = + case (\(I1 x) -> x) info of + A -> putStr "" -- nothing is printed+ B -> mapM_ putStrLn . map (show . lastFrom3) $ ys+ C -> mapM_ putStrLn . map (show . firstFrom3) $ ys+ D -> mapM_ putStrLn . map (show . secondFrom3) $ ys+ E -> (putStrLn . show . lastFrom3 $ y) >> (putStrLn . show . firstFrom3 $ y) >> printUniquenessG1List info ys+ F -> (putStrLn . show . lastFrom3 $ y) >> (putStrLn . show . secondFrom3 $ y) >> printUniquenessG1List info ys+ G -> (putStrLn . show . firstFrom3 $ y) >> (putStrLn . show . secondFrom3 $ y) >> printUniquenessG1List info ys+ _ -> (putStrLn . show . lastFrom3 $ y) >> (putStrLn . show . firstFrom3 $ y) >> (putStrLn . show. secondFrom3 $ y) >> printUniquenessG1List info ys -- the most verbose output+ | otherwise =+ case (\(I2 x) -> x) info of + Af xs -> putStr "" -- nothing is printed+ Bf xs -> toFile xs . map (show . lastFrom3) $ ys+ Cf xs -> toFile xs . map (show . firstFrom3) $ ys+ Df xs -> toFile xs . map (show . secondFrom3) $ ys+ Ef xs -> toFile xs . map (\t -> (show (lastFrom3 t) ++ newLineEnding ++ show (firstFrom3 t))) $ ys+ Ff xs -> toFile xs . map (\t -> (show (lastFrom3 t) ++ newLineEnding ++ show (secondFrom3 t))) $ ys+ Gf xs -> toFile xs . map (\t -> (show (firstFrom3 t) ++ newLineEnding ++ show (secondFrom3 t))) $ ys+ ~(Hf xs) -> toFile xs . map (\t -> (show (lastFrom3 t) ++ newLineEnding ++ show (firstFrom3 t) ++ newLineEnding ++ show (secondFrom3 t))) $ ys -- the most verbose output +printUniquenessG1List info [] = return () +-- | Auxiliary printing function to define the line ending needed to be printed by 'printUniquenessG1List' function in some cases. +newLineEnding :: String+newLineEnding + | nativeNewline == LF = "\n"+ | otherwise = "\r\n"+ -- | Variant of the 'maximumElBy' function where all the given \"properties\" are used. -- The predefined library \"properties\" or related to them functions can be found in the package @uniqueness-periods-vector-properties@. maximumElByAll :: (Eq a, Ord b, Show a, Show b) => V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.+ -> UniqG2 a b -- ^ The data to be analyzed. -> UniquenessG1 a b -- ^ The maximum element according to the given \"properties\". maximumElByAll vN = maximumElBy (V.length vN) vN {-# INLINE maximumElByAll #-}@@ -147,7 +159,7 @@ let vM = uniquenessVariants2GNP (get1m rr) (get2m rr) whspss vN g1 g2 xs maxK = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 (k - 1)) (V.unsafeIndex vN1 (k - 1))) vM vK = V.filter (\(_,vN2,_) -> V.unsafeIndex vN2 (k - 1) == V.unsafeIndex (secondFrom3 maxK) (k - 1)) vM in- maximumElBy (k - 1) (V.unsafeSlice 0 (k - 1) vN) (U vK)+ maximumElBy (k - 1) (V.unsafeSlice 0 (k - 1) vN) (UL2 ([],vK)) | otherwise = V.maximumBy (\(_,vN0,_) (_,vN1,_) -> compare (V.unsafeIndex vN0 0) (V.unsafeIndex vN1 0)) . uniquenessVariantsGN whspss rr vN g1 g2 $ xs -- | A variant for 'uniquenessVariants2GN' and 'uniquenessVariants2GNP' with the second argument defining, which one is used.@@ -163,77 +175,50 @@ uniquenessVariantsGN whspss K vN g1 g2 = uniquenessVariants2GN whspss vN g1 g2 {-# INLINE uniquenessVariantsGN #-} --- | Prints the maximum element with respect of the @k@ \"properties\" (the most significant of which is the rightest one, then to the left less significant etc.), --- which is given as the first argument. The last \"property\" is the first element in the 'V.Vector' of \"properties\" (@[b] -> b@). +-- | Finds out the maximum element with respect of the @k@ \"properties\" (the most significant of which is the rightest one, then to the left less significant etc.), +-- which is given as the first argument, and then rearranges the input moving the elements equal by the first element in the triple to the maximum element +-- to the first element in the tuple. +-- +-- The last \"property\" is the first element in the 'V.Vector' of \"properties\" (@[b] -> b@). maximumElByVec :: (Eq a, Ord b, Show a, Show b) => Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file. -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO (UniqG a b)-maximumElByVec k info vN x = do- inner1 k info vN x >>= \(fsT,x) -> - if isU x then return (U (V.filter ((/= fsT) . firstFrom3) . snd . get2 $ x))- else return (UL ((\(v1,v2) -> ((V.toList . V.map lastFrom3 $ v1) ++ (fromJust . fst . get2 $ x),v2)) . - V.unstablePartition ((== fsT) . firstFrom3) . snd . get2 $ x))+ -> UniqG2 a b -- ^ The data to be analyzed.+ -> UniqG2 a b+maximumElByVec k vN x = let uniq = maximumElBy k vN x in let fsT = firstFrom3 uniq in UL2 ((\(v1,v2) -> ((V.toList v1) ++ (fst . get22 $ x),v2)) . + V.unstablePartition ((== fsT) . firstFrom3) . snd . get22 $ x) {-# INLINE maximumElByVec #-} -- | A variant of the 'maximumElByVec' where all the given \"properties\" are used. maximumElByVecAll :: - (Eq a, Ord b, Show a, Show b) => Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.- -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO (UniqG a b)-maximumElByVecAll info vN = maximumElByVec (V.length vN) info vN+ (Eq a, Ord b, Show a, Show b) => V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.+ -> UniqG2 a b -- ^ The data to be analyzed.+ -> UniqG2 a b+maximumElByVecAll vN = maximumElByVec (V.length vN) vN {-# INLINE maximumElByVecAll #-} --- | Is a pair function for monadic recursive calls with 'maximumElByVec'. Prints the @n@ (the first 'Int' argument) consequential maximum elements. +-- | Finds out the @n@ (the first 'Int' argument) consequential maximum elements, and then rearranges the input moving the elements equal by the first element +-- in the triple to the maximum element to the first element in the tuple. uniqNPropertiesN :: (Eq a, Ord b, Show a, Show b) => Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed. -> Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file. -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO ()-uniqNPropertiesN n k info vN y - | n <= 0 = return ()- | otherwise = (maximumElByVec k info vN y >>= uniqNPropertiesN (n - 1) k info vN)+ -> UniqG2 a b -- ^ The data to be analyzed.+ -> UniqG2 a b+uniqNPropertiesN n k vN y + | n <= 0 = y+ | otherwise = uniqNPropertiesN (n - 1) k vN . maximumElByVec k vN $ y {-# INLINE uniqNPropertiesN #-} -- | A variant of the 'uniqNPropertiesN' where all the given \"properties\" are used. uniqNPropertiesNAll :: (Eq a, Ord b, Show a, Show b) => Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file. -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO ()-uniqNPropertiesNAll n info vN = uniqNPropertiesN n (V.length vN) info vN+ -> UniqG2 a b -- ^ The data to be analyzed.+ -> UniqG2 a b+uniqNPropertiesNAll n vN = uniqNPropertiesN n (V.length vN) vN {-# INLINE uniqNPropertiesNAll #-} --- | Is a pair function for monadic recursive calls with 'maximumElByVec'. Prints the @n@ (the first 'Int' argument) consequential maximum elements. --- Is similar to 'uniqNPropertiesN' in actions but has another return data type.-uniqNPropertiesVN :: - (Eq a, Ord b, Show a, Show b) => Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed.- -> Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.- -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO (UniqG a b)-uniqNPropertiesVN n k info vN y- | n <= 0 || compare (V.length . snd . get2 $ y) n == LT = return y- | otherwise = (maximumElByVec k info vN y >>= uniqNPropertiesVN (n - 1) k info vN)-{-# INLINE uniqNPropertiesVN #-}---- | A variant of the 'uniqNPropertiesVN' where all the given \"properties\" are used.-uniqNPropertiesVNAll :: - (Eq a, Ord b, Show a, Show b) => Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.- -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> UniqG a b -- ^ The data to be analyzed.- -> IO (UniqG a b)-uniqNPropertiesVNAll n info vN = uniqNPropertiesVN n (V.length vN) info vN-{-# INLINE uniqNPropertiesVNAll #-}- -------------------------------------------------------------------------------------------- -- | The full analyzing and processment function. A pair with 'uniqNProperties2VGN', returns another data type as its result.@@ -242,35 +227,11 @@ -> Preapp a -- ^ A parameter to specify the lists to be prepended and postpended to the given data to be processed before actual processment. -> Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed. -> Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file. -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently. -> ([a] -> V.Vector c) -- ^ The first function that transforms the processed list into the form suitable for analyzing by the functions in the module. Usually it is one of the functions 'uniquenessPeriodsVector1', 'uniquenessPeriodsVector2', or 'uniquenessPeriodsVector3' from the @uniqueness-periods-vector@ package. -> (V.Vector c -> [b]) -- ^ The second function that transforms the suitable form data representation obtained by the previous argument application into the data that can be evaluated to get the result. The predefined functions can be found in the package @uniqueness-periods-vector-properties@. -> [a] -- ^ The data to be processed. Often it can be a 'String' of the text. - -> IO ()-uniqNProperties2GN whspss rr n k info vN g1 g2 xs- | n <= 0 = return ()- | otherwise = do- let v = uniquenessVariants2GNP (get1m rr) (get2m rr) whspss vN g1 g2 xs- maximumElByVec k info vN (U v) >>= uniqNPropertiesN (n - 1) k info vN---- | The full analyzing and processment function. A pair with 'uniqNProperties2GN', returns another data type as its result.-uniqNProperties2VGN :: - (Eq a, Ord b, Show a, Show b) => [a] -- ^ A list of \"whitespace symbols\" that delimits the sublists in the list to be processed.- -> Preapp a -- ^ A parameter to specify the lists to be prepended and postpended to the given data to be processed before actual processment. - -> Int -- ^ A quantity of the recursive calls that returns each one a new result from the rest of the data processed.- -> Int -- ^ The quantity of the represented as functions \"properties\" to be applied from the second argument. The order is from the right to the left.- -> Info2 -- ^ A parameter to control the predefined behaviour of the printing. The 'I1' branch prints to the 'stdout' and the 'I2' - to the file.- -> V.Vector ([b] -> b) -- ^ 'V.Vector' of the represented as functions \"properties\" to be applied consequently.- -> ([a] -> V.Vector c) -- ^ The first function that transforms the processed list into the form suitable for analyzing by the functions in the module. Usually it is one of the functions 'uniquenessPeriodsVector1', 'uniquenessPeriodsVector2', or 'uniquenessPeriodsVector3' from the @uniqueness-periods-vector@ package.- -> (V.Vector c -> [b]) -- ^ The second function that transforms the suitable form data representation obtained by the previous argument application into the data that can be evaluated to get the result. The predefined functions can be found in the package @uniqueness-periods-vector-properties@.- -> UniqG a b -- ^ A parameter to control the behaviour of the function. The data constructor (either 'U' or 'UL') is preserved.- -> [a] -- ^ The data to be processed. Often it can be a 'String' of the text. - -> IO (UniqG a b)-uniqNProperties2VGN whspss rr n k info vN g1 g2 y xs- | n <= 0 = if isU y then return (U V.empty) else return (UL ([],V.empty))- | otherwise = do- let v = uniquenessVariants2GNP (get1m rr) (get2m rr) whspss vN g1 g2 xs- if compare (V.length v) n == LT - then if isU y then return (U v) else return (UL ([],v)) - else if isU y then uniqNPropertiesVN n k info vN (U v) else uniqNPropertiesVN n k info vN (UL ([],v))+ -> UniqG2 a b+uniqNProperties2GN whspss rr n k vN g1 g2 xs+ | n <= 0 = UL2 ([],V.empty)+ | otherwise = let v = uniquenessVariants2GNP (get1m rr) (get2m rr) whspss vN g1 g2 xs in uniqNPropertiesN (n - 1) k vN . maximumElByVec k vN $ (UL2 ([],v))
uniqueness-periods-vector-general.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/ name: uniqueness-periods-vector-general-version: 0.3.0.0+version: 0.4.0.0 synopsis: Generalization of the functionality of the dobutokO-poetry-general-languages package description: Generalization of the functionality of the dobutokO-poetry-general-languages package homepage: https://hackage.haskell.org/package/uniqueness-periods-vector-general@@ -20,6 +20,6 @@ exposed-modules: Languages.UniquenessPeriods.Vector.General.Debug -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <4.15, vector >=0.11 && <0.14, uniqueness-periods-vector-common >=0.2 && <1, print-info >=0.1.3 && <1+ build-depends: base >=4.7 && <4.15, vector >=0.11 && <0.14, uniqueness-periods-vector-common >=0.3 && <1, print-info >=0.1.3 && <1 -- hs-source-dirs: default-language: Haskell2010