contiguous 0.6.1.1 → 0.6.2.0
raw patch · 3 files changed
+45/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Primitive.Contiguous: foldlZipWith' :: (Contiguous arr1, Contiguous arr2, Element arr1 a, Element arr2 b) => (c -> a -> b -> c) -> c -> arr1 a -> arr2 b -> c
+ Data.Primitive.Contiguous: ifoldlZipWith' :: (Contiguous arr1, Contiguous arr2, Element arr1 a, Element arr2 b) => (Int -> c -> a -> b -> c) -> c -> arr1 a -> arr2 b -> c
Files
- bench/Main.hs +9/−9
- contiguous.cabal +1/−1
- src/Data/Primitive/Contiguous.hs +35/−0
bench/Main.hs view
@@ -58,17 +58,17 @@ func "primArray100" size primArray100 func "primArray1000" size primArray1000 - io "marray10" sizeMutable marray10- io "marray100" sizeMutable marray100- io "marray1000" sizeMutable marray1000+ io "marray10" sizeMut marray10+ io "marray100" sizeMut marray100+ io "marray1000" sizeMut marray1000 - io "msmallArray10" sizeMutable msmallArray10- io "msmallArray100" sizeMutable msmallArray100- io "msmallArray1000" sizeMutable msmallArray1000+ io "msmallArray10" sizeMut msmallArray10+ io "msmallArray100" sizeMut msmallArray100+ io "msmallArray1000" sizeMut msmallArray1000 - io "mprimArray10" sizeMutable mprimArray10- io "mprimArray100" sizeMutable mprimArray100- io "mprimArray1000" sizeMutable mprimArray1000+ io "mprimArray10" sizeMut mprimArray10+ io "mprimArray100" sizeMut mprimArray100+ io "mprimArray1000" sizeMut mprimArray1000 wgroup "null" $ do func "array10" null array10 func "array100" null array100
contiguous.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: contiguous-version: 0.6.1.1+version: 0.6.2.0 homepage: https://github.com/andrewthad/contiguous bug-reports: https://github.com/andrewthad/contiguous/issues author: Andrew Martin
src/Data/Primitive/Contiguous.hs view
@@ -154,6 +154,8 @@ -- ** Zipping Folds , foldrZipWith , ifoldrZipWith+ , foldlZipWith'+ , ifoldlZipWith' , foldlZipWithM' , ifoldlZipWithM' @@ -1858,6 +1860,39 @@ else z in go 0 {-# inline ifoldrZipWith #-}++foldlZipWith' ::+ ( Contiguous arr1+ , Contiguous arr2+ , Element arr1 a+ , Element arr2 b+ ) => (c -> a -> b -> c)+ -> c+ -> arr1 a+ -> arr2 b+ -> c+foldlZipWith' f = ifoldlZipWith' (\_ x y c -> f x y c)+{-# inline foldlZipWith' #-}++ifoldlZipWith' ::+ ( Contiguous arr1+ , Contiguous arr2+ , Element arr1 a+ , Element arr2 b+ ) => (Int -> c -> a -> b -> c)+ -> c+ -> arr1 a+ -> arr2 b+ -> c+ifoldlZipWith' f !z !arr1 !arr2 =+ let !sz = min (size arr1) (size arr2)+ go !ix !acc = if ix == sz+ then acc+ else case index# arr1 ix of+ (# x #) -> case index# arr2 ix of+ (# y #) -> go (ix + 1) (f ix acc x y)+ in go 0 z+{-# inline ifoldlZipWith' #-} -- | Variant of 'foldlZipWithM\'' that provides the index of each pair of elements. ifoldlZipWithM' ::