packages feed

mmsyn2-array 0.1.0.0 → 0.1.0.1

raw patch · 3 files changed

+15/−26 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -3,3 +3,7 @@ ## 0.1.0.0 -- 2020-12-14  * First version. Released on an unsuspecting world.++## 0.1.0.1 -- 2020-12-14++* First version revised A. Some documentation improvements.
CaseBi/Arr.hs view
@@ -4,27 +4,19 @@ {-# LANGUAGE FlexibleContexts #-}  -- | Module    :  CaseBi.Arr--- Copyright   :  (c) OleksandrZhabenko 2019+-- Copyright   :  (c) OleksandrZhabenko 2020 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com -- -- A library that can be used as a @case ... of@ constuction analogue for the multiple @Ord a => a -> b@ -- transformations and data representation. Uses 'Array' internally. If you use the module in GHCi, then, please,--- run the interpreter with the flag -fobject-code.+-- run the interpreter with the flag @-fobject-code@. --  module CaseBi.Arr (-{- |  * Functions that can be used instead of @case ... of@ construction-@-case var of- a1 -> b1- a2 -> b2- a3 -> b3- ...- an -> bn- _  -> def-@+{- |  * Functions that can be used instead of+@ case var of { a1 -> b1 ; a2 -> b2 ; a3 -> b3 ; ... ; an -> bn ; ~z -> def } @ for efficiency or other data representation -}   -- * Basic functions@@ -42,13 +34,7 @@  {- | The function that can be used instead of the 'case ... of' function @-case var of- a1 -> b1- a2 -> b2- a3 -> b3- ...- an -> bn- _  -> defaultValue+case var of { a1 -> b1 ; a2 -> b2 ; a3 -> b3 ; ... ; an -> bn ; ~z -> defaultValue } @ 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.@@ -56,7 +42,8 @@ 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 an 'Array' of @(a, b)@ as somewhat like a complicated filter or like a special sieve. The array must be sorted in ascending order here for the algorithm to be used correctly. For this you can use the function 'listArrSortedBy' or the similar ones.+some situations. 'getBFst'' uses binary search algorithm and an 'Array' of @(a, b)@ as somewhat like a complicated filter or like a special sieve. The array must be sorted in ascending order here for the algorithm to be used correctly. For this you can use the function 'listArrSortedByFst' or the similar ones. If you would like to+use them both, please, consider usage of the 'getBFstLSorted'' or 'getBFstL'' instead. The function 'getBFst''' is used internally in the 'getBFst'' that is recommended to be used in most cases. Nevertheless, it is provided here if you have precomputed the first two arguments or at least some parts of them so that you can reduce the needed amount of computations in the 'getBFst''.@@ -97,7 +84,7 @@ {- | If the list argument is sorted in the ascending order by the first element in every tuple, then to reduce computations instead of @-\def xs x -> getBFst' (def, listArray (0,length xs - 1) xs) x+\\def xs x -> getBFst' (def, listArray (0,length xs - 1) xs) x @ you can use this function. -}@@ -115,9 +102,7 @@  {- | If it is unknown whether the list argument is sorted in the ascending order by the first element in every tuple (or, definitely, it is not, speaking generally), then instead of-@-\def xs x -> getBFst' (def, listArray (0,length xs - 1) . sortBy (comparing fst) $ xs) x-@+@ \\def xs x -> getBFst' (def, listArray (0,length xs - 1) . sortBy (comparing fst) $ xs) x @ you can use this function. -} getBFstL'
mmsyn2-array.cabal view
@@ -2,8 +2,8 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn2-array-version:             0.1.0.0-synopsis:            A library with less dependencies that can be used for multiple @Ord a => a -> b@ transformations.+version:             0.1.0.1+synopsis:            A library with less dependencies that can be used for multiple Ord a => a -> b transformations. description:         A library that can be used as a @case ... of@ constuction analogue for the multiple @Ord a => a -> b@ transformations and data representation. Uses "GHC.Arr" internally. If you use the module in GHCi, then, please, run the interpreter with the flag -fobject-code. homepage:            https://hackage.haskell.org/package/mmsyn2-array license:             MIT