phladiprelio-general-datatype 0.3.0.1 → 0.3.1.0
raw patch · 4 files changed
+40/−4 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Phladiprelio.General.Datatype: readBasic4 :: (String -> [a]) -> ([a] -> [Double]) -> (String -> [b]) -> ([b] -> [String]) -> [Read2] -> [(String, Double)]
+ Phladiprelio.General.Datatype: readBasic4G :: (String -> Bool) -> (String -> [a]) -> ([a] -> [Double]) -> (String -> [b]) -> ([b] -> [String]) -> [Read2] -> [(String, Double)]
+ Phladiprelio.General.Datatype: showDoubleAsInsert :: Double -> String
Files
- CHANGELOG.md +8/−0
- Phladiprelio/General/Datatype.hs +30/−2
- README.md +1/−1
- phladiprelio-general-datatype.cabal +1/−1
CHANGELOG.md view
@@ -25,3 +25,11 @@ * Third version. Added new datatype and functions to the library. Some documentation improvements. +## 0.3.0.1 -- 2023-10-01++* Third version revised A. Fixed issue with README.md file.++## 0.3.1.0 -- 2023-10-01++* Third version revised B. Added new functions to the library.+
Phladiprelio/General/Datatype.hs view
@@ -11,6 +11,7 @@ import Text.Show (Show(..)) import GHC.Num ((*)) import Data.Maybe (fromMaybe)+import Data.Tuple (snd) data Phladiprelio t a b = Phl { inputData :: t a,@@ -85,15 +86,21 @@ f xs = S xs xss = map f . groupBy (\x y -> (isDigit y || y == '_') && (isDigit x || x == '_') || not (or [isDigit x, isDigit y, x == '_', y == '_'])) $ xs +showDoubleAsInsert :: Double -> String+showDoubleAsInsert d+ | d <= 0 = []+ | otherwise = '_':(filter (/= '.') . show $ d)+{-# INLINE showDoubleAsInsert #-}+ readBasic2G :: (String -> Bool) -- ^ A special function to check whether the 'String' contains needed information. Must return 'True' for the 'String' that contains the needed for usual processment information, otherwise — 'False'. -> (String -> [a]) -> ([a] -> [Double]) -> [Read2] -> [Double]-readBasic2G p fConvA fConvD xs@(D ys:S t:ts) = map (\y -> y * h) ys `mappend` readBasic2G p fConvA fConvD (S t:ts)+readBasic2G p fConvA fConvD xs@(D ys:S t:ts) = map (* h) ys `mappend` readBasic2G p fConvA fConvD (S t:ts) where h = readHead fConvA fConvD t-readBasic2G p fConvA fConvD xs@(S ys:D ts:ks) = dc `mappend` map (\y -> y * l) ts `mappend` readBasic2G p fConvA fConvD ks+readBasic2G p fConvA fConvD xs@(S ys:D ts:ks) = dc `mappend` map (* l) ts `mappend` readBasic2G p fConvA fConvD ks where dc = fConvD . fConvA $ ys l = last dc readBasic2G p fConvA fConvD [S ys] = fConvD . fConvA $ ys@@ -104,6 +111,27 @@ readBasic3 = readBasic3G (not . null . filter (not . isSpace)) {-# INLINABLE readBasic3 #-}++-- | Is intended to be used in the "music" mode for PhLADiPreLiO.+readBasic4G + :: (String -> Bool) -- ^ A special function to check whether the 'String' contains needed information. Must return 'True' for the 'String' that contains the needed for usual processment information, otherwise — 'False'.+ -> (String -> [a])+ -> ([a] -> [Double])+ -> (String -> [b])+ -> ([b] -> [String])+ -> [Read2]+ -> [(String, Double)]+readBasic4G p fConvA fConvD gConvB gConvS xs@(D ys:S t:ts) = map (\y -> (showDoubleAsInsert y, y * h)) ys `mappend` readBasic4G p fConvA fConvD gConvB gConvS (S t:ts)+ where h = readHead fConvA fConvD t+readBasic4G p fConvA fConvD gConvB gConvS xs@(S ys:D ts:ks) = dc `mappend` map (\y -> (showDoubleAsInsert y, y * l)) ts `mappend` readBasic4G p fConvA fConvD gConvB gConvS ks+ where dc = zip (gConvS . gConvB $ ys) (fConvD . fConvA $ ys)+ dl = last dc+ l = snd dl+readBasic4G p fConvA fConvD gConvB gConvS [S ys] = zip (gConvS . gConvB $ ys) (fConvD . fConvA $ ys)+readBasic4G _ _ _ _ _ _ = []++readBasic4 = readBasic4G (not . null . filter (not . isSpace))+{-# INLINE readBasic4 #-} -- | Is a way to read duration of the additional added time period into the line. readU2 :: String -> Double
README.md view
@@ -18,7 +18,7 @@ On the 2023/09/22 there is Nathalie's Kok birthday. She is the mother of the foundation founder [Emma Kok](https://emmakok.nl) and the member of the foundation board, so the versions 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.2.1.0 and 0.2.2.0 (the first, the initial ones) are also dedicated to Nathalie Kok. -On the 01/10/2023 there are International Music Day and [André's Rieu](https://www.andrerieu.com/en) Birthday. So the versions 0.3.0.0 and 0.3.0.1 are+On the 01/10/2023 there are International Music Day and [André's Rieu](https://www.andrerieu.com/en) Birthday. So the versions 0.3.0.0, 0.3.0.1 and 0.3.1.0 are additionally devoted to him as well as to the Kok family — [Emma](https://emmakok.nl) and [Enzo](https://enzokok.nl) are amazing and fantastic musicians, Vico works with PhilZuid, Sophie sings in the classical manner. Nathalie Kok with love to her family and appreciation for André's Rieu support also celebrates the Day. In Ukraine this day has several
phladiprelio-general-datatype.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.24 name: phladiprelio-general-datatype-version: 0.3.0.1+version: 0.3.1.0 synopsis: Extended functionality of PhLADiPreLiO description: Can be used not only for language, but also for simpler music and lyrics composing. homepage: