vext 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+85/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src-indef/Vector.hs +10/−0
- src/Vector/Bit.hs +15/−3
- src/Vector/Lifted.hs +1/−0
- src/Vector/Word64.hs +57/−0
- vext.cabal +2/−1
src-indef/Vector.hs view
@@ -67,6 +67,7 @@ , foldlM , foldrZip , foldr+ , ifoldr , ifoldl' , ifoldlSlice' , replicate@@ -181,6 +182,15 @@ -> b {-# inline foldr #-} foldr f b0 n v = Fin.descend# n b0 (\fin b -> f (index v fin) b)++ifoldr :: forall (n :: GHC.Nat) (a :: TYPE R) (b :: Type).+ (Fin# n -> a -> b -> b)+ -> b+ -> Nat# n+ -> Vector n a+ -> b+{-# inline ifoldr #-}+ifoldr f b0 n v = Fin.descend# n b0 (\fin b -> f fin (index v fin) b) traverse_ :: forall (n :: GHC.Nat) (m :: Type -> Type) (a :: TYPE R) (b :: Type). Monad m
src/Vector/Bit.hs view
@@ -1,6 +1,7 @@ {-# language MagicHash #-}-{-# language PatternSynonyms #-} {-# language MultiWayIf #-}+{-# language PatternSynonyms #-}+{-# language UnboxedTuples #-} module Vector.Bit ( -- Types@@ -12,6 +13,7 @@ -- * Primitives , write# , write+ , read , read# , index# , index@@ -57,14 +59,24 @@ , allEqTrue ) where -import Prelude hiding (replicate, map, Bounded, all, foldr)+import Prelude hiding (replicate, map, Bounded, all, foldr, read) import Data.Unlifted (Bool#, pattern True#, pattern False#) +import GHC.ST (ST(ST)) import Vector.Std.Word1 import Vector.Eq.Word1 (equals)-import Arithmetic.Types (Nat#)+import Arithmetic.Types (Nat#,Fin#) import qualified Vector.Zip.Bit.Bit.Bit as Zip++read :: MutableVector s n Bool# -> Fin# n -> ST s Bool+{-# inline read #-}+read (MutableVector v) i = ST+ (\s0 -> case read# v i s0 of+ (# s1, x #) -> case x of+ True# -> (# s1, True #)+ _ -> (# s1, False #)+ ) allEqTrue :: Nat# n -> Vector n Bool# -> Bool allEqTrue n = foldr (\b acc -> case b of {True# -> acc; _ -> False}) True n
src/Vector/Lifted.hs view
@@ -45,6 +45,7 @@ , foldlM , ifoldl' , ifoldlSlice'+ , ifoldr , foldr , foldrZip , replicate
+ src/Vector/Word64.hs view
@@ -0,0 +1,57 @@+{-# language DataKinds #-}+{-# language MagicHash #-}+{-# language NumericUnderscores #-}+{-# language BangPatterns #-}+{-# language TypeApplications #-}+{-# language TypeOperators #-}++module Vector.Word64+ ( -- Types+ Vector(..)+ , Vector#+ , MutableVector(..)+ , MutableVector#+ , Bounded(..)+ , Vector_(..)+ -- * Primitives+ , write#+ , write+ , read#+ , index#+ , index+ , unlift+ , substitute+ , initialized+ , unsafeCoerceLength+ , expose+ , expose#+ -- * Ranges+ , set+ , setSlice+ -- * Freeze+ , unsafeShrinkFreeze+ , unsafeFreeze+ , freeze+ , freezeSlice+ -- * Copy+ , thaw+ -- * Composite+ , map+ , ifoldl'+ , ifoldlSlice'+ , replicate+ , construct3+ , construct4+ , append+ , clone+ , cloneSlice+ -- * Index+ , index0+ , index1+ , index2+ , index3+ ) where++import Prelude hiding (replicate,map,maximum,Bounded,all)++import Vector.Std.Word64
vext.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.4 name: vext-version: 0.1.0.0+version: 0.1.1.0 synopsis: Array library monomorphized with backpack bug-reports: https://github.com/andrewthad/vex-unified/issues license: BSD-3-Clause@@ -388,6 +388,7 @@ Vector.Word8 Vector.Word16 Vector.Word32+ Vector.Word64 Vector.Word128 Vector.Word128.Masked Vector.Int