rhythmic-sequences 0.2.2.0 → 0.2.3.0
raw patch · 3 files changed
+15/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- rhythmic-sequences.cabal +1/−1
- src/Rhythmicity/MarkerSeqs.hs +8/−5
CHANGELOG.md view
@@ -41,3 +41,9 @@ * Second version revised C. Some performance improvements for splitF function. Documentation improvements. +## 0.2.3.0 -- 2023-03-17++* Second version revised D. Fixed issue with undefined pattern matching. Modified the +splitF code with the usage of the modified Data.List.unfoldr code to improve performance.+Some documentation improvements.+
rhythmic-sequences.cabal view
@@ -2,7 +2,7 @@ name: rhythmic-sequences -- The package version.-version: 0.2.2.0+version: 0.2.3.0 -- A short (one-line) description of the package. synopsis:
src/Rhythmicity/MarkerSeqs.hs view
@@ -80,12 +80,15 @@ instance Show a => Show (ASort3 a) where show (As3 n k x) = show n ++ '&':show k ++ '~':show x --- | Split the list into lists of @n@ elements where @n@ is the first parameter.+-- | Split the list into lists of @n@ elements where @n@ is the first parameter. Can be used +-- efficiently just for the finite lists. Contains the modified code of the 'Data.List.unfoldr'+-- function from the @base@ package. splitF :: Int -> [a] -> [[a]]-splitF n ys = f' n q ys- where q = length ys `quot` n- f' n q ks@(_:_) = let (ts,ws) = splitAt n ks in ts : f' n (q - 1) ws- f' _ 0 _ = [] +splitF n ys = let q = length ys `quot` n in take q . g (\xs -> splitAt n xs) $ ys+ where {-# INLINE g #-} -- Is a modified 'Data.List.unfoldr' code.+ g f b0 = build (\c n ->+ let go b = case f b of+ (a, new_b) -> a `c` go new_b in go b0) -- | Function to get basic data for hash-based evaluation of the rhythmicity of the list data. Is -- used internally in the 'countHashesG'.