Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Generalization of the functionality of the DobutokO.Poetry.General.Debug
module from the dobutokO-poetry-general-languages
package.
Synopsis
- maximumElBy :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b) => Int -> Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniquenessG1T2 t t2 a b
- uniqNPropertiesN :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => Int -> Int -> Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniqG2T2 t t2 a b
- uniqNPropertiesNAll :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => Int -> Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniqG2T2 t t2 a b
- uniqNProperties2GN :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, UGG1 t (PreApp t a) a, Ord b, Show a, Show b) => a -> t a -> (t a -> Vector a) -> (t (t a) -> Vector (Vector a)) -> (Vector a -> t a) -> Vector (Vector Int) -> PreApp t a -> Int -> Int -> Vector (t2 b -> b) -> FuncRep (t a) (Vector c) (t2 b) -> t a -> UniqG2T2 t t2 a b
- maximumElByAll :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniquenessG1T2 t t2 a b
- maximumElGBy :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, UGG1 t (PreApp t a) a, Ord b, Show a, Show b) => t a -> a -> PreApp t a -> (t a -> Vector a) -> (t (t a) -> Vector (Vector a)) -> (Vector a -> t a) -> Vector (Vector Int) -> Int -> Vector (t2 b -> b) -> FuncRep (t a) (Vector c) (t2 b) -> t a -> UniquenessG1T2 t t2 a b
- uniquenessVariantsGN :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => a -> t a -> (t a -> Vector a) -> (t (t a) -> Vector (Vector a)) -> (Vector a -> t a) -> Vector (Vector Int) -> PreApp t a -> Vector (t2 b -> b) -> FuncRep (t a) (Vector c) (t2 b) -> t a -> Vector (UniquenessG1T2 t t2 a b)
- maximumElByVec :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => Int -> Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniqG2T2 t t2 a b
- maximumElByVecAll :: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) => Vector (t2 b -> b) -> UniqG2T2 t t2 a b -> UniqG2T2 t t2 a b
- toFile :: (Foldable t, Show (t a), Monoid (t a)) => FilePath -> t (t a) -> IO ()
- toFileStr :: FilePath -> [String] -> IO ()
- printUniquenessG1 :: (Show (t a), Show b, Show (t2 b)) => Info2 -> UniquenessG1T2 t t2 a b -> IO ()
- printUniquenessG1List :: (Show (t a), Show b, Show (t2 b)) => Info2 -> [UniquenessG1T2 t t2 a b] -> IO ()
- printUniquenessG1ListStr :: (Show b, Show (t2 b)) => Info2 -> Vector (UniquenessG1T2 [] t2 Char b) -> IO ()
- printUniquenessG1VChar :: (Show b, Show (t2 b)) => Info2 -> Vector (UniquenessG1T2 Vector t2 Char b) -> IO ()
- newLineEnding :: String
- equalSnDs :: Ord b => Vector b -> Vector b -> Bool
Pure functions
Self-recursive pure functions and connected with them ones
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, 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. |
-> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniquenessG1T2 t t2 a b | The maximum element in respect with the given parameters. |
The function evaluates the Vector
of UniquenessG1T2
t
t2
a
b
elements (related with the third argument) to retrieve the possibly maximum element
in it with respect to the order and significance (principality) of the "properties" (represented as the functions f :: [b] -> b
) being evaluated.
The most significant and principal is the "property", which index in the Vector
of them is the Int
argument (so it is the first one) of the
function minus 1, then less significant is the next to the left "property" and so on.
The predefined library "properties" or related to them functions can be found in the package phonetic-languages-properties
.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) | |
=> Int | A quantity of the recursive calls that returns each one a new resulting group 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. |
-> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniqG2T2 t t2 a b |
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.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) | |
=> Int | A quantity of the recursive calls that returns each one a new resulting group from the rest of the data processed. |
-> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniqG2T2 t t2 a b |
A variant of the uniqNPropertiesN
where all the given "properties" are used.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, UGG1 t (PreApp t a) a, Ord b, Show a, Show b) | |
=> a | The first most common element in the whitespace symbols structure |
-> t a | A list of "whitespace symbols" that delimits the sublists in the list to be processed. |
-> (t a -> Vector a) | The function that is used internally to convert to the boxed |
-> (t (t a) -> Vector (Vector a)) | The function that is used internally to convert to the boxed |
-> (Vector a -> t a) | The function that is used internally to convert from the boxed |
-> Vector (Vector Int) | The list of permutations of |
-> PreApp t 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 resulting group 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. |
-> Vector (t2 b -> b) |
|
-> FuncRep (t a) (Vector c) (t2 b) | It includes the defined earlier variant with data constructor |
-> t a | The data to be processed. |
-> UniqG2T2 t t2 a b |
The full analyzing and processment function.
Pure functions
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) | |
=> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniquenessG1T2 t t2 a b | The maximum element according to the given "properties". |
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
.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, UGG1 t (PreApp t a) a, Ord b, Show a, Show b) | |
=> t a | The "whitespace symbols" that delimit the subs in the |
-> a | The first "whitespace symbol" from the left. |
-> PreApp t a | A parameter to specify the lists to be prepended and postpended to the given data to be processed before actual processment. |
-> (t a -> Vector a) | The function that is used internally to convert to the boxed |
-> (t (t a) -> Vector (Vector a)) | The function that is used internally to convert to the boxed |
-> (Vector a -> t a) | The function that is used internally to convert from the boxed |
-> Vector (Vector Int) | The list of permutations of |
-> 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. |
-> Vector (t2 b -> b) |
|
-> FuncRep (t a) (Vector c) (t2 b) | It includes the defined earlier variant with data constructor |
-> t a | The data to be processed. |
-> UniquenessG1T2 t t2 a b |
The function evaluates
the generated Vector
of UniquenessG1T2
t
t2
a
b
elements to retrieve the possibly maximum element in it with respect to the order and significance (principality)
of the "properties" being evaluated. The most significant and principal is the "property", which index in the Vector
of them is the Int
argument of the function
minus 1, then less significant is the next to the left "property" and so on.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) | |
=> a | The first from the left element inthe "whitespace symbols" |
-> t a | A list of "whitespace symbols" that delimits the subGs in the structure to be processed. |
-> (t a -> Vector a) | The function that is used internally to convert to the boxed |
-> (t (t a) -> Vector (Vector a)) | The function that is used internally to convert to the boxed |
-> (Vector a -> t a) | The function that is used internally to convert from the boxed |
-> Vector (Vector Int) | The list of permutations of |
-> PreApp t a | A parameter to specify the lists to be prepended and postpended to the given data to be processed before actual processment. |
-> Vector (t2 b -> b) |
|
-> FuncRep (t a) (Vector c) (t2 b) | It includes the defined earlier variant with data constructor |
-> t a | The data to be processed. |
-> Vector (UniquenessG1T2 t t2 a b) |
A variant for uniquenessVariants2GNB
and uniquenessVariants2GNPB
with the second argument defining, which one is used.
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, 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. |
-> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniqG2T2 t t2 a b |
Rearranges the last argument.
Finds out the group of maximum elements with respect of the k
"properties" (the most significant of which is the rightest one,
then to the left less significant etc.) of the second argument. The number of "properties" is given as the first argument. Then the function
rearranges the last argument by moving the elements equal by the second element in the triple to the maximum element to the first element in
the resulting tuple. The elements that are not equal to the maximum one are moved to the second element in the tuple.
If the second element of the tuple is empty, then just returns the last argument.
The last by significance "property" is the first element in the Vector
of "properties" ([b] -> b
) (so that the order of significance is
from the right to the left in the respective Vector
). If the length of the vector of properties is greater than the first argument then
the last element(s) in the vector do not participate in producing the result (are ignored).
:: (Eq a, Foldable t, InsertLeft t a, Monoid (t a), Monoid (t (t a)), Foldable t2, Ord b, Show a, Show b) | |
=> Vector (t2 b -> b) |
|
-> UniqG2T2 t t2 a b | The data to be analyzed. |
-> UniqG2T2 t t2 a b |
A variant of the maximumElByVec
where all the given "properties" are used.
IO functions
Printing subsystem
:: (Foldable t, Show (t a), Monoid (t a)) | |
=> FilePath | The |
-> t (t a) | Each element is appended on the new line to the file. |
-> IO () |
Prints every element from the structure on the new line to the file. Uses appendFile
function inside.
:: FilePath | The |
-> [String] | Each |
-> IO () |
Prints every String
from the list on the new line to the file. Uses appendFile
function inside.
With String
-based arguments
printUniquenessG1ListStr Source #
:: (Show b, Show (t2 b)) | |
=> Info2 | A parameter to control the predefined behaviour of the printing. The |
-> Vector (UniquenessG1T2 [] t2 Char b) | The |
-> IO () |
A variant of the printUniquenessG1List
where a
is Char
so that the inner third arguments in the triples are String
s.
With Vector
Char
based arguments
printUniquenessG1VChar Source #
:: (Show b, Show (t2 b)) | |
=> Info2 | A parameter to control the predefined behaviour of the printing. The |
-> Vector (UniquenessG1T2 Vector t2 Char b) | The |
-> IO () |
A variant of the printUniquenessG1List
where a
is Char
so that the inner third arguments in the triples are Vector
of Char
.
Auxiliary functions
newLineEnding :: String Source #
Auxiliary printing function to define the line ending in some cases.