mmsyn2 0.1.6.0 → 0.1.6.1
raw patch · 3 files changed
+11/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CaseBi.hs +7/−10
- ChangeLog.md +3/−0
- mmsyn2.cabal +1/−1
CaseBi.hs view
@@ -1,7 +1,5 @@---{-# LANGUAGE BangPatterns #-}- module CaseBi (--- * Function that can be used instead of 'case ... of' construction+-- * Function that can be used instead of @case ... of@ construction -- -- > case var of -- > a1 -> b1@@ -13,9 +11,9 @@ -- -- for efficiency or other data representation getBFst', getBFst, getBFstV, --- * Additional functions that are used to sort a list of pairs (which can be obtained e. g. by Prelude.zip)+-- * Additional functions that are used to sort a list of pairs (which can be obtained e. g. by 'Prelude.zip') sortFst, sortFstV,--- ** Function that can be used for changing the Vector (a, b) during its creation +-- ** Function that can be used for changing the @Vector (a, b)@ during its creation filterP ) where @@ -36,8 +34,8 @@ -- -- If we follow a lot of teaching materials that explain the workflow of the construction we think that the complexity of it is about /O(n)/ for the transformation of @a@ to @b@ here. -- David Feuer (david.feuer (at) gmail.com) said that 'case ... of' is already optimized in GHC. Some benchmarks show that its behaviour tends to be about of /O(log n)/ complexity, the same as--- the proposed function getBFst'. Nevertheless, the last one shows better performance in some situations, is rather general and can be used for another data representation.--- Therefore, it can be preferred in some situations. getBFst' uses binary search algorithm and a Vector (a, b) as somewhat like a complicated filter or like a special sieve.+-- the proposed function 'getBFst''. Nevertheless, the last one shows better performance in some situations, is rather general and can be used for another data representation.+-- Therefore, it can be preferred in some situations. 'getBFst'' uses binary search algorithm and a @Vector (a, b)@ as somewhat like a complicated filter or like a special sieve. -- The @Vector (a, b)@ must be sorted in ascending order here for the algorithm to be used correctly. For this you can use -- the following functions 'sortFst' and 'sortFstV'. -- @@ -52,9 +50,8 @@ -- > an -> bn -- getBFst' - :: (Ord a) => (b, V.Vector (a, b)) -- ^ @b@ is a default value that can be substituted if there is no correspendence in the set of @(a, b)@ tuples (the 'otherwise' or irrefutable pattern analogue).- -- ^ Vector of the @(a, b)@ tuples that must be sorted in ascending order for the first argument. If there are several pairs @(a, b)@ with the same @a@, - -- ^ the function gives a resulting @b@ as if there is only the first one+ :: (Ord a) => (b, -- ^ @b@ is a default value that can be substituted if there is no correspendence in the set of @(a, b)@ tuples (the 'otherwise' or irrefutable pattern analogue). + V.Vector (a, b)) -- ^ Vector of the @(a, b)@ tuples that must be sorted in ascending order for the first argument. If there are several pairs @(a, b)@ with the same @a@, the function gives a resulting @b@ as if there is only the first one -> a -- ^ an element for which the corresponding resulting b must be found -> b -- ^ the result getBFst' (def, vec) l | if compare l (fst (V.unsafeIndex vec 0)) == LT then True else compare l (fst (V.unsafeIndex vec (V.length vec - 1))) == GT = def
ChangeLog.md view
@@ -23,4 +23,7 @@ * First version revised E. Some performance improvements and changing the documentation. The benchmark testing continues. +## 0.1.6.1 -- 2019-10-22 +* First version revised F. Some minor documentation changes.+The benchmark testing continues.
mmsyn2.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: mmsyn2-version: 0.1.6.0+version: 0.1.6.1 synopsis: The library that can be used for multiple (Ord a) => a -> b transformations description: The library that can be used for optimization or another representation of multiple (Ord a) => a -> b transformations homepage: https://oleksandrzhabenko.github.io/mmsyn2