vector 0.9.1 → 0.10
raw patch · 32 files changed
+200/−1129 lines, 32 filesdep +deepseqdep ~basedep ~primitive
Dependencies added: deepseq
Dependency ranges changed: base, primitive
Files
- Changelog +0/−30
- Data/Vector.hs +14/−2
- Data/Vector/Fusion/Stream.hs +25/−23
- Data/Vector/Fusion/Stream/Monadic.hs +1/−1
- Data/Vector/Fusion/Stream/Monadic/Safe.hs +0/−78
- Data/Vector/Fusion/Stream/Safe.hs +0/−82
- Data/Vector/Fusion/Stream/Size.hs +0/−5
- Data/Vector/Fusion/Util.hs +0/−5
- Data/Vector/Generic.hs +1/−1
- Data/Vector/Generic/Mutable.hs +14/−0
- Data/Vector/Generic/Mutable/Safe.hs +0/−61
- Data/Vector/Generic/New/Safe.hs +0/−25
- Data/Vector/Generic/Safe.hs +0/−157
- Data/Vector/Mutable.hs +12/−0
- Data/Vector/Mutable/Safe.hs +0/−54
- Data/Vector/Primitive.hs +6/−2
- Data/Vector/Primitive/Mutable.hs +7/−0
- Data/Vector/Primitive/Mutable/Safe.hs +0/−53
- Data/Vector/Primitive/Safe.hs +0/−134
- Data/Vector/Safe.hs +0/−143
- Data/Vector/Storable.hs +5/−1
- Data/Vector/Storable/Mutable.hs +42/−0
- Data/Vector/Unboxed.hs +1/−1
- Data/Vector/Unboxed/Base.hs +5/−0
- Data/Vector/Unboxed/Mutable/Safe.hs +0/−57
- Data/Vector/Unboxed/Safe.hs +0/−141
- LICENSE +1/−1
- benchmarks/vector-benchmarks.cabal +5/−5
- tests/Tests/Move.hs +34/−0
- tests/Tests/Vector.hs +9/−10
- tests/vector-tests.cabal +4/−4
- vector.cabal +14/−53
− Changelog
@@ -1,30 +0,0 @@-Changes 0.6 - 0.6.0.1-- * Improved documentation--Changes 0.5 - 0.6-- * More efficient representation of Storable vectors-- * Block copy operations used when possible-- * Typeable and Data instances-- * Monadic combinators (replicateM, mapM etc.)-- * Better support for recycling (see create and modify)-- * Performance improvements--Changes 0.4.2 - 0.5-- * Unboxed vectors of primitive types and tuples.-- * Redesigned interface between mutable and immutable vectors. It now- includes the popular unsafeFreeze primitive.-- * Many new combinators.-- * Significant performance improvements. Unboxed vectors are usually faster- than primitive unboxed DPH arrays.-
Data/Vector.hs view
@@ -1,4 +1,9 @@-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeFamilies, Rank2Types #-}+{-# LANGUAGE FlexibleInstances+ , MultiParamTypeClasses+ , TypeFamilies+ , Rank2Types+ , BangPatterns+ #-} -- | -- Module : Data.Vector@@ -156,6 +161,7 @@ import Data.Primitive.Array import qualified Data.Vector.Fusion.Stream as Stream +import Control.DeepSeq ( NFData, rnf ) import Control.Monad ( MonadPlus(..), liftM, ap ) import Control.Monad.ST ( ST ) import Control.Monad.Primitive@@ -191,6 +197,12 @@ {-# UNPACK #-} !(Array a) deriving ( Typeable ) +instance NFData a => NFData (Vector a) where+ rnf (Vector i n arr) = force i+ where+ force !ix | ix < n = rnf (indexArray arr ix) `seq` force (ix+1)+ | otherwise = ()+ instance Show a => Show (Vector a) where showsPrec = G.showsPrec @@ -650,7 +662,7 @@ -- | Execute the monadic action and freeze the resulting vector. -- -- @--- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\' }) = \<'a','b'\>+-- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\'; return v }) = \<'a','b'\> -- @ create :: (forall s. ST s (MVector s a)) -> Vector a {-# INLINE create #-}
Data/Vector/Fusion/Stream.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleInstances, Rank2Types #-}+{-# LANGUAGE FlexibleInstances, Rank2Types, BangPatterns #-} -- | -- Module : Data.Vector.Fusion.Stream@@ -77,7 +77,7 @@ import Data.Vector.Fusion.Stream.Size import Data.Vector.Fusion.Util-import Data.Vector.Fusion.Stream.Monadic ( Step(..) )+import Data.Vector.Fusion.Stream.Monadic ( Step(..), SPEC(..) ) import qualified Data.Vector.Fusion.Stream.Monadic as M import Prelude hiding ( length, null,@@ -477,38 +477,40 @@ -- Comparisons -- ----------- +-- FIXME: Move these to Monadic+ -- | Check if two 'Stream's are equal eq :: Eq a => Stream a -> Stream a -> Bool {-# INLINE_STREAM eq #-}-eq (M.Stream step1 s1 _) (M.Stream step2 s2 _) = eq_loop0 s1 s2+eq (M.Stream step1 s1 _) (M.Stream step2 s2 _) = eq_loop0 SPEC s1 s2 where- eq_loop0 s1 s2 = case unId (step1 s1) of- Yield x s1' -> eq_loop1 x s1' s2- Skip s1' -> eq_loop0 s1' s2- Done -> null (M.Stream step2 s2 Unknown)+ eq_loop0 !sPEC s1 s2 = case unId (step1 s1) of+ Yield x s1' -> eq_loop1 SPEC x s1' s2+ Skip s1' -> eq_loop0 SPEC s1' s2+ Done -> null (M.Stream step2 s2 Unknown) - eq_loop1 x s1 s2 = case unId (step2 s2) of- Yield y s2' -> x == y && eq_loop0 s1 s2'- Skip s2' -> eq_loop1 x s1 s2'- Done -> False+ eq_loop1 !sPEC x s1 s2 = case unId (step2 s2) of+ Yield y s2' -> x == y && eq_loop0 SPEC s1 s2'+ Skip s2' -> eq_loop1 SPEC x s1 s2'+ Done -> False -- | Lexicographically compare two 'Stream's cmp :: Ord a => Stream a -> Stream a -> Ordering {-# INLINE_STREAM cmp #-}-cmp (M.Stream step1 s1 _) (M.Stream step2 s2 _) = cmp_loop0 s1 s2+cmp (M.Stream step1 s1 _) (M.Stream step2 s2 _) = cmp_loop0 SPEC s1 s2 where- cmp_loop0 s1 s2 = case unId (step1 s1) of- Yield x s1' -> cmp_loop1 x s1' s2- Skip s1' -> cmp_loop0 s1' s2- Done -> if null (M.Stream step2 s2 Unknown)- then EQ else LT+ cmp_loop0 !sPEC s1 s2 = case unId (step1 s1) of+ Yield x s1' -> cmp_loop1 SPEC x s1' s2+ Skip s1' -> cmp_loop0 SPEC s1' s2+ Done -> if null (M.Stream step2 s2 Unknown)+ then EQ else LT - cmp_loop1 x s1 s2 = case unId (step2 s2) of- Yield y s2' -> case x `compare` y of- EQ -> cmp_loop0 s1 s2'- c -> c- Skip s2' -> cmp_loop1 x s1 s2'- Done -> GT+ cmp_loop1 !sPEC x s1 s2 = case unId (step2 s2) of+ Yield y s2' -> case x `compare` y of+ EQ -> cmp_loop0 SPEC s1 s2'+ c -> c+ Skip s2' -> cmp_loop1 SPEC x s1 s2'+ Done -> GT instance Eq a => Eq (M.Stream Id a) where {-# INLINE (==) #-}
Data/Vector/Fusion/Stream/Monadic.hs view
@@ -13,7 +13,7 @@ -- module Data.Vector.Fusion.Stream.Monadic (- Stream(..), Step(..),+ Stream(..), Step(..), SPEC(..), -- * Size hints size, sized,
− Data/Vector/Fusion/Stream/Monadic/Safe.hs
@@ -1,78 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Fusion.Stream.Monadic.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable------ Safe interface to "Data.Vector.Fusion.Stream.Monadic"-----module Data.Vector.Fusion.Stream.Monadic.Safe (- Stream(..), Step(..),-- -- * Size hints- size, sized,-- -- * Length- length, null,-- -- * Construction- empty, singleton, cons, snoc, replicate, replicateM, generate, generateM, (++),-- -- * Accessing elements- head, last, (!!),-- -- * Substreams- slice, init, tail, take, drop,-- -- * Mapping- map, mapM, mapM_, trans, unbox, concatMap, flatten,- - -- * Zipping- indexed, indexedR, zipWithM_,- zipWithM, zipWith3M, zipWith4M, zipWith5M, zipWith6M,- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- zip, zip3, zip4, zip5, zip6,-- -- * Filtering- filter, filterM, takeWhile, takeWhileM, dropWhile, dropWhileM,-- -- * Searching- elem, notElem, find, findM, findIndex, findIndexM,-- -- * Folding- foldl, foldlM, foldl1, foldl1M, foldM, fold1M,- foldl', foldlM', foldl1', foldl1M', foldM', fold1M',- foldr, foldrM, foldr1, foldr1M,-- -- * Specialised folds- and, or, concatMapM,-- -- * Unfolding- unfoldr, unfoldrM,- unfoldrN, unfoldrNM,- iterateN, iterateNM,-- -- * Scans- prescanl, prescanlM, prescanl', prescanlM',- postscanl, postscanlM, postscanl', postscanlM',- scanl, scanlM, scanl', scanlM',- scanl1, scanl1M, scanl1', scanl1M',-- -- * Enumerations- enumFromStepN, enumFromTo, enumFromThenTo,-- -- * Conversions- toList, fromList, fromListN-) where--import Data.Vector.Fusion.Stream.Monadic-import Prelude ()-
− Data/Vector/Fusion/Stream/Safe.hs
@@ -1,82 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Fusion.Stream.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Fusion.Stream"-----module Data.Vector.Fusion.Stream.Safe (- -- * Types- Step(..), Stream, MStream,-- -- * In-place markers- inplace,-- -- * Size hints- size, sized,-- -- * Length information- length, null,-- -- * Construction- empty, singleton, cons, snoc, replicate, generate, (++),-- -- * Accessing individual elements- head, last, (!!),-- -- * Substreams- slice, init, tail, take, drop,-- -- * Mapping- map, concatMap, flatten, unbox,- - -- * Zipping- indexed, indexedR,- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- zip, zip3, zip4, zip5, zip6,-- -- * Filtering- filter, takeWhile, dropWhile,-- -- * Searching- elem, notElem, find, findIndex,-- -- * Folding- foldl, foldl1, foldl', foldl1', foldr, foldr1,-- -- * Specialised folds- and, or,-- -- * Unfolding- unfoldr, unfoldrN, iterateN,-- -- * Scans- prescanl, prescanl',- postscanl, postscanl',- scanl, scanl',- scanl1, scanl1',-- -- * Enumerations- enumFromStepN, enumFromTo, enumFromThenTo,-- -- * Conversions- toList, fromList, fromListN, liftStream,-- -- * Monadic combinators- mapM, mapM_, zipWithM, zipWithM_, filterM, foldM, fold1M, foldM', fold1M',-- eq, cmp-) where--import Data.Vector.Fusion.Stream-import Prelude ()-
Data/Vector/Fusion/Stream/Size.hs view
@@ -1,8 +1,3 @@-#if __GLASGOW_HASKELL__ >= 703-{-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 701-{-# LANGUAGE Trustworthy #-}-#endif -- | -- Module : Data.Vector.Fusion.Stream.Size -- Copyright : (c) Roman Leshchinskiy 2008-2010
Data/Vector/Fusion/Util.hs view
@@ -1,8 +1,3 @@-#if __GLASGOW_HASKELL__ >= 703-{-# LANGUAGE Safe #-}-#elif __GLASGOW_HASKELL__ >= 701-{-# LANGUAGE Trustworthy #-}-#endif -- | -- Module : Data.Vector.Fusion.Util -- Copyright : (c) Roman Leshchinskiy 2009
Data/Vector/Generic.hs view
@@ -709,7 +709,7 @@ -- | Execute the monadic action and freeze the resulting vector. -- -- @--- create (do { v \<- 'M.new' 2; 'M.write' v 0 \'a\'; 'M.write' v 1 \'b\' }) = \<'a','b'\>+-- create (do { v \<- 'M.new' 2; 'M.write' v 0 \'a\'; 'M.write' v 1 \'b\'; return v }) = \<'a','b'\> -- @ create :: Vector v a => (forall s. ST s (Mutable v s a)) -> v a {-# INLINE create #-}
Data/Vector/Generic/Mutable.hs view
@@ -72,6 +72,20 @@ -- | Class of mutable vectors parametrised with a primitive state token. --+-- Minimum complete implementation:+--+-- * 'basicLength'+--+-- * 'basicUnsafeSlice'+--+-- * 'basicOverlaps'+--+-- * 'basicUnsafeNew'+--+-- * 'basicUnsafeRead'+--+-- * 'basicUnsafeWrite'+-- class MVector v a where -- | Length of the mutable vector. This method should not be -- called directly, use 'length' instead.
− Data/Vector/Generic/Mutable/Safe.hs
@@ -1,61 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif--- |--- Module : Data.Vector.Generic.Mutable.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Generic.Mutable"-----module Data.Vector.Generic.Mutable.Safe (- -- * Class of mutable vector types- MVector,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Extracting subvectors- slice, init, tail, take, drop, splitAt,-- -- ** Overlapping- overlaps,-- -- * Construction-- -- ** Initialisation- new, replicate, replicateM, clone,-- -- ** Growing- grow,-- -- ** Restricting memory usage- clear,-- -- * Accessing individual elements- read, write, swap,-- -- * Modifying vectors-- -- ** Filling and copying- set, copy, move,-- -- * Internal operations- unstream, unstreamR,- munstream, munstreamR,- transform, transformR,- fill, fillR,- accum, update, reverse,- unstablePartition, unstablePartitionStream, partitionStream-) where--import Data.Vector.Generic.Mutable-import Prelude ()-
− Data/Vector/Generic/New/Safe.hs
@@ -1,25 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Generic.New.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Generic.New"-----module Data.Vector.Generic.New.Safe (- New(..), create, run, apply, modify, modifyWithStream,- unstream, transform, unstreamR, transformR,- slice, init, tail, take, drop-) where--import Data.Vector.Generic.New-import Prelude ()-
− Data/Vector/Generic/Safe.hs
@@ -1,157 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif--- |--- Module : Data.Vector.Generic.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Generic"-----module Data.Vector.Generic.Safe (- -- * Immutable vectors- Vector, Mutable,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Indexing- (!), (!?), head, last,-- -- ** Monadic indexing- indexM, headM, lastM,-- -- ** Extracting subvectors (slicing)- slice, init, tail, take, drop, splitAt,-- -- * Construction-- -- ** Initialisation- empty, singleton, replicate, generate, iterateN,-- -- ** Monadic initialisation- replicateM, generateM, create,-- -- ** Unfolding- unfoldr, unfoldrN,-- -- ** Enumeration- enumFromN, enumFromStepN, enumFromTo, enumFromThenTo,-- -- ** Concatenation- cons, snoc, (++), concat,-- -- ** Restricting memory usage- force,-- -- * Modifying vectors-- -- ** Bulk updates- (//), update, update_,-- -- ** Accumulations- accum, accumulate, accumulate_,-- -- ** Permutations - reverse, backpermute,-- -- ** Safe destructive updates- modify,-- -- * Elementwise operations-- -- ** Indexing- indexed,-- -- ** Mapping- map, imap, concatMap,-- -- ** Monadic mapping- mapM, mapM_, forM, forM_,-- -- ** Zipping- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- izipWith, izipWith3, izipWith4, izipWith5, izipWith6,- zip, zip3, zip4, zip5, zip6,-- -- ** Monadic zipping- zipWithM, zipWithM_,-- -- ** Unzipping- unzip, unzip3, unzip4, unzip5, unzip6,-- -- * Working with predicates-- -- ** Filtering- filter, ifilter, filterM,- takeWhile, dropWhile,-- -- ** Partitioning- partition, unstablePartition, span, break,-- -- ** Searching- elem, notElem, find, findIndex, findIndices, elemIndex, elemIndices,-- -- * Folding- foldl, foldl1, foldl', foldl1', foldr, foldr1, foldr', foldr1',- ifoldl, ifoldl', ifoldr, ifoldr',-- -- ** Specialised folds- all, any, and, or,- sum, product,- maximum, maximumBy, minimum, minimumBy,- minIndex, minIndexBy, maxIndex, maxIndexBy,-- -- ** Monadic folds- foldM, foldM', fold1M, fold1M',- foldM_, foldM'_, fold1M_, fold1M'_,-- -- ** Monadic sequencing- sequence, sequence_,-- -- * Prefix sums (scans)- prescanl, prescanl',- postscanl, postscanl',- scanl, scanl', scanl1, scanl1',- prescanr, prescanr',- postscanr, postscanr',- scanr, scanr', scanr1, scanr1',-- -- * Conversions-- -- ** Lists- toList, fromList, fromListN,-- -- ** Different vector types- convert,-- -- ** Mutable vectors- freeze, thaw, copy,-- -- * Fusion support-- -- ** Conversion to/from Streams- stream, unstream, streamR, unstreamR,-- -- ** Recycling support- new, clone,-- -- * Utilities-- -- ** Comparisons- eq, cmp,-- -- ** @Data@ and @Typeable@- gfoldl, dataCast, mkType-) where--import Data.Vector.Generic-import Prelude ()-
Data/Vector/Mutable.hs view
@@ -54,6 +54,8 @@ import Data.Primitive.Array import Control.Monad.Primitive +import Control.DeepSeq ( NFData, rnf )+ import Prelude hiding ( length, null, replicate, reverse, map, read, take, drop, splitAt, init, tail ) @@ -69,6 +71,16 @@ type IOVector = MVector RealWorld type STVector s = MVector s++-- NOTE: This seems unsafe, see http://trac.haskell.org/vector/ticket/54+{-+instance NFData a => NFData (MVector s a) where+ rnf (MVector i n arr) = unsafeInlineST $ force i+ where+ force !ix | ix < n = do x <- readArray arr ix+ rnf x `seq` force (ix+1)+ | otherwise = return ()+-} instance G.MVector MVector a where {-# INLINE basicLength #-}
− Data/Vector/Mutable/Safe.hs
@@ -1,54 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Mutable.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Mutable"-----module Data.Vector.Mutable.Safe (- -- * Mutable boxed vectors- MVector, IOVector, STVector,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Extracting subvectors- slice, init, tail, take, drop, splitAt,-- -- ** Overlapping- overlaps,-- -- * Construction-- -- ** Initialisation- new, replicate, replicateM, clone,-- -- ** Growing- grow,-- -- ** Restricting memory usage- clear,-- -- * Accessing individual elements- read, write, swap,-- -- * Modifying vectors-- -- ** Filling and copying- set, copy, move-) where--import Data.Vector.Mutable-import Prelude ()-
Data/Vector/Primitive.hs view
@@ -140,6 +140,8 @@ import Data.Primitive.ByteArray import Data.Primitive ( Prim, sizeOf ) +import Control.DeepSeq ( NFData )+ import Control.Monad ( liftM ) import Control.Monad.ST ( ST ) import Control.Monad.Primitive@@ -172,6 +174,8 @@ {-# UNPACK #-} !ByteArray deriving ( Typeable ) +instance NFData (Vector a)+ instance (Show a, Prim a) => Show (Vector a) where showsPrec = G.showsPrec @@ -205,7 +209,7 @@ basicUnsafeSlice j n (Vector i _ arr) = Vector (i+j) n arr {-# INLINE basicUnsafeIndexM #-}- basicUnsafeIndexM (Vector i _ arr) j = return (indexByteArray arr (i+j))+ basicUnsafeIndexM (Vector i _ arr) j = return $! indexByteArray arr (i+j) {-# INLINE basicUnsafeCopy #-} basicUnsafeCopy (MVector i n dst) (Vector j _ src)@@ -583,7 +587,7 @@ -- | Execute the monadic action and freeze the resulting vector. -- -- @--- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\' }) = \<'a','b'\>+-- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\'; return v }) = \<'a','b'\> -- @ create :: Prim a => (forall s. ST s (MVector s a)) -> Vector a {-# INLINE create #-}
Data/Vector/Primitive/Mutable.hs view
@@ -55,6 +55,8 @@ import Control.Monad.Primitive import Control.Monad ( liftM ) +import Control.DeepSeq ( NFData )+ import Prelude hiding ( length, null, replicate, reverse, map, read, take, drop, splitAt, init, tail ) @@ -71,6 +73,8 @@ type IOVector = MVector RealWorld type STVector s = MVector s +instance NFData (MVector s a)+ instance Prim a => G.MVector MVector a where basicLength (MVector _ n _) = n basicUnsafeSlice j m (MVector i n arr)@@ -104,6 +108,9 @@ = moveByteArray dst (i*sz) src (j*sz) (n * sz) where sz = sizeOf (undefined :: a)++ {-# INLINE basicSet #-}+ basicSet (MVector i n arr) x = setByteArray arr i n x -- Length information -- ------------------
− Data/Vector/Primitive/Mutable/Safe.hs
@@ -1,53 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif--- |--- Module : Data.Vector.Primitive.Mutable.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector.Primitive.Mutable"-----module Data.Vector.Primitive.Mutable.Safe (- -- * Mutable vectors of primitive types- MVector, IOVector, STVector, Prim,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Extracting subvectors- slice, init, tail, take, drop, splitAt,-- -- ** Overlapping- overlaps,-- -- * Construction-- -- ** Initialisation- new, replicate, replicateM, clone,-- -- ** Growing- grow,-- -- ** Restricting memory usage- clear,-- -- * Accessing individual elements- read, write, swap,-- -- * Modifying vectors-- -- ** Filling and copying- set, copy, move-) where--import Data.Vector.Primitive.Mutable-import Prelude ()-
− Data/Vector/Primitive/Safe.hs
@@ -1,134 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Primitive.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable------ Safe interface to "Data.Vector.Primitive" -----module Data.Vector.Primitive.Safe (- -- * Primitive vectors- Vector, MVector, Prim,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Indexing- (!), (!?), head, last,-- -- ** Monadic indexing- indexM, headM, lastM,-- -- ** Extracting subvectors (slicing)- slice, init, tail, take, drop, splitAt,-- -- * Construction-- -- ** Initialisation- empty, singleton, replicate, generate, iterateN,-- -- ** Monadic initialisation- replicateM, generateM, create,-- -- ** Unfolding- unfoldr, unfoldrN,- constructN, constructrN,-- -- ** Enumeration- enumFromN, enumFromStepN, enumFromTo, enumFromThenTo,-- -- ** Concatenation- cons, snoc, (++), concat,-- -- ** Restricting memory usage- force,-- -- * Modifying vectors-- -- ** Bulk updates- (//), update_,-- -- ** Accumulations- accum, accumulate_,-- -- ** Permutations - reverse, backpermute,-- -- ** Safe destructive updates- modify,-- -- * Elementwise operations-- -- ** Mapping- map, imap, concatMap,-- -- ** Monadic mapping- mapM, mapM_, forM, forM_,-- -- ** Zipping- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- izipWith, izipWith3, izipWith4, izipWith5, izipWith6,-- -- ** Monadic zipping- zipWithM, zipWithM_,-- -- * Working with predicates-- -- ** Filtering- filter, ifilter, filterM,- takeWhile, dropWhile,-- -- ** Partitioning- partition, unstablePartition, span, break,-- -- ** Searching- elem, notElem, find, findIndex, findIndices, elemIndex, elemIndices,-- -- * Folding- foldl, foldl1, foldl', foldl1', foldr, foldr1, foldr', foldr1',- ifoldl, ifoldl', ifoldr, ifoldr',-- -- ** Specialised folds- all, any,- sum, product,- maximum, maximumBy, minimum, minimumBy,- minIndex, minIndexBy, maxIndex, maxIndexBy,-- -- ** Monadic folds- foldM, foldM', fold1M, fold1M',- foldM_, foldM'_, fold1M_, fold1M'_,-- -- * Prefix sums (scans)- prescanl, prescanl',- postscanl, postscanl',- scanl, scanl', scanl1, scanl1',- prescanr, prescanr',- postscanr, postscanr',- scanr, scanr', scanr1, scanr1',-- -- * Conversions-- -- ** Lists- toList, fromList, fromListN,-- -- ** Other vector types- G.convert,-- -- ** Mutable vectors- freeze, thaw, copy,-) where--import Data.Vector.Primitive-import qualified Data.Vector.Generic as G-import Prelude ()-
− Data/Vector/Safe.hs
@@ -1,143 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif--- |--- Module : Data.Vector.Safe--- Copyright : (c) Roman Leshchinskiy 2008-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable--- --- Safe interface to "Data.Vector"-----module Data.Vector.Safe (- -- * Boxed vectors- Vector, MVector,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Indexing- (!), (!?), head, last,-- -- ** Monadic indexing- indexM, headM, lastM,-- -- ** Extracting subvectors (slicing)- slice, init, tail, take, drop, splitAt,-- -- * Construction-- -- ** Initialisation- empty, singleton, replicate, generate, iterateN,-- -- ** Monadic initialisation- replicateM, generateM, create,-- -- ** Unfolding- unfoldr, unfoldrN,- constructN, constructrN,-- -- ** Enumeration- enumFromN, enumFromStepN, enumFromTo, enumFromThenTo,-- -- ** Concatenation- cons, snoc, (++), concat,-- -- ** Restricting memory usage- force,-- -- * Modifying vectors-- -- ** Bulk updates- (//), update, update_,-- -- ** Accumulations- accum, accumulate, accumulate_,-- -- ** Permutations - reverse, backpermute,-- -- ** Safe destructive updates- modify,-- -- * Elementwise operations-- -- ** Indexing- indexed,-- -- ** Mapping- map, imap, concatMap,-- -- ** Monadic mapping- mapM, mapM_, forM, forM_,-- -- ** Zipping- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- izipWith, izipWith3, izipWith4, izipWith5, izipWith6,- zip, zip3, zip4, zip5, zip6,-- -- ** Monadic zipping- zipWithM, zipWithM_,-- -- ** Unzipping- unzip, unzip3, unzip4, unzip5, unzip6,-- -- * Working with predicates-- -- ** Filtering- filter, ifilter, filterM,- takeWhile, dropWhile,-- -- ** Partitioning- partition, unstablePartition, span, break,-- -- ** Searching- elem, notElem, find, findIndex, findIndices, elemIndex, elemIndices,-- -- * Folding- foldl, foldl1, foldl', foldl1', foldr, foldr1, foldr', foldr1',- ifoldl, ifoldl', ifoldr, ifoldr',-- -- ** Specialised folds- all, any, and, or,- sum, product,- maximum, maximumBy, minimum, minimumBy,- minIndex, minIndexBy, maxIndex, maxIndexBy,-- -- ** Monadic folds- foldM, foldM', fold1M, fold1M',- foldM_, foldM'_, fold1M_, fold1M'_,-- -- ** Monadic sequencing- sequence, sequence_,-- -- * Prefix sums (scans)- prescanl, prescanl',- postscanl, postscanl',- scanl, scanl', scanl1, scanl1',- prescanr, prescanr',- postscanr, postscanr',- scanr, scanr', scanr1, scanr1',-- -- * Conversions-- -- ** Lists- toList, fromList, fromListN,-- -- ** Other vector types- G.convert,-- -- ** Mutable vectors- freeze, thaw, copy-) where--import Data.Vector-import qualified Data.Vector.Generic as G-import Prelude ()-
Data/Vector/Storable.hs view
@@ -146,6 +146,8 @@ import Foreign.Ptr import Foreign.Marshal.Array ( advancePtr, copyArray ) +import Control.DeepSeq ( NFData )+ import Control.Monad.ST ( ST ) import Control.Monad.Primitive @@ -178,6 +180,8 @@ {-# UNPACK #-} !(ForeignPtr a) deriving ( Typeable ) +instance NFData (Vector a)+ instance (Show a, Storable a) => Show (Vector a) where showsPrec = G.showsPrec @@ -590,7 +594,7 @@ -- | Execute the monadic action and freeze the resulting vector. -- -- @--- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\' }) = \<'a','b'\>+-- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\'; return v }) = \<'a','b'\> -- @ create :: Storable a => (forall s. ST s (MVector s a)) -> Vector a {-# INLINE create #-}
Data/Vector/Storable/Mutable.hs view
@@ -57,6 +57,8 @@ unsafeWith ) where +import Control.DeepSeq ( NFData )+ import qualified Data.Vector.Generic.Mutable as G import Data.Vector.Storable.Internal @@ -72,7 +74,12 @@ import Foreign.C.Types ( CInt ) import Control.Monad.Primitive+import Data.Primitive.Addr+import Data.Primitive.Types (Prim) +import GHC.Word (Word8, Word16, Word32, Word64)+import GHC.Ptr (Ptr(..))+ import Prelude hiding ( length, null, replicate, reverse, map, read, take, drop, splitAt, init, tail ) @@ -88,6 +95,8 @@ type IOVector = MVector RealWorld type STVector s = MVector s +instance NFData (MVector s a)+ instance Storable a => G.MVector MVector a where {-# INLINE basicLength #-} basicLength (MVector n _) = n@@ -121,6 +130,9 @@ = unsafePrimToPrim $ withForeignPtr fp $ \p -> pokeElemOff p i x + {-# INLINE basicSet #-}+ basicSet = storableSet+ {-# INLINE basicUnsafeCopy #-} basicUnsafeCopy (MVector n fp) (MVector _ fq) = unsafePrimToPrim@@ -134,6 +146,36 @@ $ withForeignPtr fp $ \p -> withForeignPtr fq $ \q -> moveArray p q n++storableSet :: (Storable a, PrimMonad m) => MVector (PrimState m) a -> a -> m ()+{-# INLINE storableSet #-}+storableSet v@(MVector n fp) x+ | n == 0 = return ()+ | otherwise = unsafePrimToPrim $+ case sizeOf x of+ 1 -> storableSetAsPrim n fp x (undefined :: Word8)+ 2 -> storableSetAsPrim n fp x (undefined :: Word16)+ 4 -> storableSetAsPrim n fp x (undefined :: Word32)+ 8 -> storableSetAsPrim n fp x (undefined :: Word64)+ _ -> withForeignPtr fp $ \p -> do+ poke p x++ let do_set i+ | 2*i < n = do+ copyArray (p `advancePtr` i) p i+ do_set (2*i)+ | otherwise = copyArray (p `advancePtr` i) p (n-i)++ do_set 1++storableSetAsPrim+ :: (Storable a, Prim b) => Int -> ForeignPtr a -> a -> b -> IO ()+{-# INLINE [0] storableSetAsPrim #-}+storableSetAsPrim n fp x y = withForeignPtr fp $ \(Ptr p) -> do+ poke (Ptr p) x+ let q = Addr p+ w <- readOffAddr q 0+ setAddr (q `plusAddr` sizeOf x) (n-1) (w `asTypeOf` y) {-# INLINE mallocVector #-} mallocVector :: Storable a => Int -> IO (ForeignPtr a)
Data/Vector/Unboxed.hs view
@@ -563,7 +563,7 @@ -- | Execute the monadic action and freeze the resulting vector. -- -- @--- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\' }) = \<'a','b'\>+-- create (do { v \<- new 2; write v 0 \'a\'; write v 1 \'b\'; return v }) = \<'a','b'\> -- @ create :: Unbox a => (forall s. ST s (MVector s a)) -> Vector a {-# INLINE create #-}
Data/Vector/Unboxed/Base.hs view
@@ -22,6 +22,8 @@ import qualified Data.Vector.Primitive as P +import Control.DeepSeq ( NFData )+ import Control.Monad.Primitive import Control.Monad ( liftM ) @@ -49,6 +51,9 @@ type instance G.Mutable Vector = MVector class (G.Vector Vector a, M.MVector MVector a) => Unbox a++instance NFData (Vector a)+instance NFData (MVector s a) -- ----------------- -- Data and Typeable
− Data/Vector/Unboxed/Mutable/Safe.hs
@@ -1,57 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif--- |--- Module : Data.Vector.Unboxed.Mutable.Safe--- Copyright : (c) Roman Leshchinskiy 2009-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable------ Safe interface to "Data.Vector.Unboxed.Mutable"-----module Data.Vector.Unboxed.Mutable.Safe (- -- * Mutable vectors of primitive types- MVector, IOVector, STVector, Unbox,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Extracting subvectors- slice, init, tail, take, drop, splitAt,-- -- ** Overlapping- overlaps,-- -- * Construction-- -- ** Initialisation- new, replicate, replicateM, clone,-- -- ** Growing- grow,-- -- ** Restricting memory usage- clear,-- -- * Zipping and unzipping- zip, zip3, zip4, zip5, zip6,- unzip, unzip3, unzip4, unzip5, unzip6,-- -- * Accessing individual elements- read, write, swap,-- -- * Modifying vectors-- -- ** Filling and copying- set, copy, move-) where--import Data.Vector.Unboxed.Mutable-import Prelude ()-
− Data/Vector/Unboxed/Safe.hs
@@ -1,141 +0,0 @@-#if __GLASGOW_HASKELL__ >= 701 && defined(VECTOR_BOUNDS_CHECKS)-{-# LANGUAGE Trustworthy #-}-#endif---- |--- Module : Data.Vector.Unboxed.Safe--- Copyright : (c) Roman Leshchinskiy 2009-2010--- License : BSD-style------ Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable------ Safe interface to "Data.Vector.Unboxed"-----module Data.Vector.Unboxed.Safe (- -- * Unboxed vectors- Vector, MVector, Unbox,-- -- * Accessors-- -- ** Length information- length, null,-- -- ** Indexing- (!), (!?), head, last,-- -- ** Monadic indexing- indexM, headM, lastM,-- -- ** Extracting subvectors (slicing)- slice, init, tail, take, drop, splitAt,-- -- * Construction-- -- ** Initialisation- empty, singleton, replicate, generate, iterateN,-- -- ** Monadic initialisation- replicateM, generateM, create,-- -- ** Unfolding- unfoldr, unfoldrN,- constructN, constructrN,-- -- ** Enumeration- enumFromN, enumFromStepN, enumFromTo, enumFromThenTo,-- -- ** Concatenation- cons, snoc, (++), concat,-- -- ** Restricting memory usage- force,-- -- * Modifying vectors-- -- ** Bulk updates- (//), update, update_,-- -- ** Accumulations- accum, accumulate, accumulate_,-- -- ** Permutations - reverse, backpermute,-- -- ** Safe destructive updates- modify,-- -- * Elementwise operations-- -- ** Indexing- indexed,-- -- ** Mapping- map, imap, concatMap,-- -- ** Monadic mapping- mapM, mapM_, forM, forM_,-- -- ** Zipping- zipWith, zipWith3, zipWith4, zipWith5, zipWith6,- izipWith, izipWith3, izipWith4, izipWith5, izipWith6,- zip, zip3, zip4, zip5, zip6,-- -- ** Monadic zipping- zipWithM, zipWithM_,-- -- ** Unzipping- unzip, unzip3, unzip4, unzip5, unzip6,-- -- * Working with predicates-- -- ** Filtering- filter, ifilter, filterM,- takeWhile, dropWhile,-- -- ** Partitioning- partition, unstablePartition, span, break,-- -- ** Searching- elem, notElem, find, findIndex, findIndices, elemIndex, elemIndices,-- -- * Folding- foldl, foldl1, foldl', foldl1', foldr, foldr1, foldr', foldr1',- ifoldl, ifoldl', ifoldr, ifoldr',-- -- ** Specialised folds- all, any, and, or,- sum, product,- maximum, maximumBy, minimum, minimumBy,- minIndex, minIndexBy, maxIndex, maxIndexBy,-- -- ** Monadic folds- foldM, foldM', fold1M, fold1M',- foldM_, foldM'_, fold1M_, fold1M'_,-- -- * Prefix sums (scans)- prescanl, prescanl',- postscanl, postscanl',- scanl, scanl', scanl1, scanl1',- prescanr, prescanr',- postscanr, postscanr',- scanr, scanr', scanr1, scanr1',-- -- * Conversions-- -- ** Lists- toList, fromList, fromListN,-- -- ** Other vector types- G.convert,-- -- ** Mutable vectors- freeze, thaw, copy-) where--import Data.Vector.Unboxed-import qualified Data.Vector.Generic as G-import Prelude ()-
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2008-2009, Roman Leshchinskiy+Copyright (c) 2008-2012, Roman Leshchinskiy All rights reserved. Redistribution and use in source and binary forms, with or without
benchmarks/vector-benchmarks.cabal view
@@ -1,10 +1,10 @@ Name: vector-benchmarks-Version: 0.9.1+Version: 0.10 License: BSD3 License-File: LICENSE Author: Roman Leshchinskiy <rl@cse.unsw.edu.au> Maintainer: Roman Leshchinskiy <rl@cse.unsw.edu.au>-Copyright: (c) Roman Leshchinskiy 2010-2011+Copyright: (c) Roman Leshchinskiy 2010-2012 Cabal-Version: >= 1.2 Build-Type: Simple @@ -12,9 +12,9 @@ Main-Is: Main.hs Build-Depends: base >= 2 && < 5, array,- criterion >= 0.5 && < 0.6,- mwc-random >= 0.5 && < 0.11,- vector == 0.9.1+ criterion >= 0.5 && < 0.7,+ mwc-random >= 0.5 && < 0.13,+ vector == 0.10 if impl(ghc<6.13) Ghc-Options: -finline-if-enough-args -fno-method-sharing
+ tests/Tests/Move.hs view
@@ -0,0 +1,34 @@+module Tests.Move (tests) where++import Test.QuickCheck+import Test.Framework.Providers.QuickCheck2++import Utilities ()++import qualified Data.Vector.Generic as G+import qualified Data.Vector.Generic.Mutable as M++import qualified Data.Vector as V+import qualified Data.Vector.Primitive as P+import qualified Data.Vector.Storable as S+import qualified Data.Vector.Unboxed as U++basicMove :: G.Vector v a => v a -> Int -> Int -> Int -> v a+basicMove v dstOff srcOff len + | len > 0 = G.modify (\ mv -> G.copy (M.slice dstOff len mv) (G.slice srcOff len v)) v+ | otherwise = v++testMove :: (G.Vector v a, Show (v a), Eq (v a)) => v a -> Property+testMove v = G.length v > 0 ==> (do+ dstOff <- choose (0, G.length v - 1)+ srcOff <- choose (0, G.length v - 1)+ len <- choose (1, G.length v - max dstOff srcOff)+ let expected = basicMove v dstOff srcOff len+ let actual = G.modify (\ mv -> M.move (M.slice dstOff len mv) (M.slice srcOff len mv)) v+ printTestCase ("Move: " ++ show (v, dstOff, srcOff, len)) (expected == actual))++tests =+ [testProperty "Data.Vector.Mutable (Move)" (testMove :: V.Vector Int -> Property),+ testProperty "Data.Vector.Primitive.Mutable (Move)" (testMove :: P.Vector Int -> Property),+ testProperty "Data.Vector.Unboxed.Mutable (Move)" (testMove :: U.Vector Int -> Property),+ testProperty "Data.Vector.Storable.Mutable (Move)" (testMove :: S.Vector Int -> Property)]
tests/Tests/Vector.hs view
@@ -514,7 +514,7 @@ --prop_inits = V.inits `eq1` (inits :: v a -> [v a]) --prop_tails = V.tails `eq1` (tails :: v a -> [v a]) -+testGeneralBoxedVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Vector), Ord a) => Data.Vector.Vector a -> [Test] testGeneralBoxedVector dummy = concatMap ($ dummy) [ testSanity, testPolymorphicFunctions,@@ -534,6 +534,7 @@ , testBoolFunctions ] +testNumericBoxedVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Vector), Ord a, Num a, Enum a, Random a) => Data.Vector.Vector a -> [Test] testNumericBoxedVector dummy = concatMap ($ dummy) [ testGeneralBoxedVector@@ -542,7 +543,7 @@ ] -+testGeneralPrimitiveVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Primitive.Vector), Data.Vector.Primitive.Prim a, Ord a) => Data.Vector.Primitive.Vector a -> [Test] testGeneralPrimitiveVector dummy = concatMap ($ dummy) [ testSanity, testPolymorphicFunctions,@@ -550,12 +551,7 @@ testMonoidFunctions ] -testBoolPrimitiveVector dummy = concatMap ($ dummy)- [- testGeneralPrimitiveVector- , testBoolFunctions- ]-+testNumericPrimitiveVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Primitive.Vector), Data.Vector.Primitive.Prim a, Ord a, Num a, Enum a, Random a) => Data.Vector.Primitive.Vector a -> [Test] testNumericPrimitiveVector dummy = concatMap ($ dummy) [ testGeneralPrimitiveVector@@ -564,7 +560,7 @@ ] -+testGeneralStorableVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Storable.Vector), Data.Vector.Storable.Storable a, Ord a) => Data.Vector.Storable.Vector a -> [Test] testGeneralStorableVector dummy = concatMap ($ dummy) [ testSanity, testPolymorphicFunctions,@@ -572,6 +568,7 @@ testMonoidFunctions ] +testNumericStorableVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Storable.Vector), Data.Vector.Storable.Storable a, Ord a, Num a, Enum a, Random a) => Data.Vector.Storable.Vector a -> [Test] testNumericStorableVector dummy = concatMap ($ dummy) [ testGeneralStorableVector@@ -580,7 +577,7 @@ ] -+testGeneralUnboxedVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Unboxed.Vector), Data.Vector.Unboxed.Unbox a, Ord a) => Data.Vector.Unboxed.Vector a -> [Test] testGeneralUnboxedVector dummy = concatMap ($ dummy) [ testSanity, testPolymorphicFunctions,@@ -599,6 +596,7 @@ , testBoolFunctions ] +testNumericUnboxedVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Unboxed.Vector), Data.Vector.Unboxed.Unbox a, Ord a, Num a, Enum a, Random a) => Data.Vector.Unboxed.Vector a -> [Test] testNumericUnboxedVector dummy = concatMap ($ dummy) [ testGeneralUnboxedVector@@ -606,6 +604,7 @@ , testEnumFunctions ] +testTupleUnboxedVector :: forall a. (COMMON_CONTEXT(a, Data.Vector.Unboxed.Vector), Data.Vector.Unboxed.Unbox a, Ord a) => Data.Vector.Unboxed.Vector a -> [Test] testTupleUnboxedVector dummy = concatMap ($ dummy) [ testGeneralUnboxedVector
tests/vector-tests.cabal view
@@ -1,10 +1,10 @@ Name: vector-tests-Version: 0.9.1+Version: 0.10 License: BSD3 License-File: LICENSE Author: Max Bolingbroke, Roman Leshchinskiy Maintainer: Roman Leshchinskiy <rl@cse.unsw.edu.au>-Copyright: (c) Max Bolinbroke, Roman Leshchinskiy 2008-2010+Copyright: (c) Max Bolinbroke, Roman Leshchinskiy 2008-2012 Homepage: http://darcs.haskell.org/vector Category: Data Structures Synopsis: Efficient Arrays@@ -18,7 +18,7 @@ Executable "vector-tests-O0" Main-Is: Main.hs - Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.9.1,+ Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10, random, QuickCheck >= 2, test-framework, test-framework-quickcheck2 @@ -38,7 +38,7 @@ Executable "vector-tests-O2" Main-Is: Main.hs - Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.9.1,+ Build-Depends: base >= 4 && < 5, template-haskell, vector == 0.10, random, QuickCheck >= 2, test-framework, test-framework-quickcheck2
vector.cabal view
@@ -1,10 +1,10 @@ Name: vector-Version: 0.9.1+Version: 0.10 License: BSD3 License-File: LICENSE Author: Roman Leshchinskiy <rl@cse.unsw.edu.au> Maintainer: Roman Leshchinskiy <rl@cse.unsw.edu.au>-Copyright: (c) Roman Leshchinskiy 2008-2011+Copyright: (c) Roman Leshchinskiy 2008-2012 Homepage: http://code.haskell.org/vector Bug-Reports: http://trac.haskell.org/vector Category: Data, Data Structures@@ -29,9 +29,6 @@ . ["Data.Vector.Generic"] Generic interface to the vector types. .- Each module has a @Safe@ version with is marked as @Trustworthy@- (see <http://hackage.haskell.org/trac/ghc/wiki/SafeHaskell>).- . There is also a (draft) tutorial on common uses of vector. . * <http://haskell.org/haskellwiki/Numeric_Haskell:_A_Vector_Tutorial>@@ -41,42 +38,14 @@ . * <http://trac.haskell.org/vector> .- Changes in version 0.9.1- .- * New functions: @unsafeFromForeignPtr0@ and @unsafeToForeignPtr0@- .- * Small performance improvements- .- * Fixes for GHC 7.4- .- Changes in version 0.9- .- * 'MonadPlus' instance for boxed vectors- .- * Export more @construct@ and @constructN@ from @Safe@ modules- .- * Require @primitive-0.4.0.1@- .- Changes in version 0.8- .- * New functions: @constructN@, @constructrN@- .- * Support for GHC 7.2 array copying primitives- .- * New fixity for @(!)@- .- * Safe Haskell support (contributed by David Terei)- .- * 'Functor', 'Monad', 'Applicative', 'Alternative', 'Foldable' and- 'Traversable' instances for boxed vectors- (/WARNING: they tend to be slow and are only provided for completeness/)- .- * 'Show' instances for immutable vectors follow containers conventions- .- * 'Read' instances for all immutable vector types- .- * Performance improvements+ Changes in version 0.10 .+ * @NFData@ instances+ .+ * More efficient block fills+ .+ * Safe Haskell support removed+ . Cabal-Version: >= 1.2.3 Build-Type: Simple@@ -88,6 +57,7 @@ tests/Main.hs tests/Boilerplater.hs tests/Utilities.hs+ tests/Tests/Move.hs tests/Tests/Stream.hs tests/Tests/Vector.hs benchmarks/vector-benchmarks.cabal@@ -107,7 +77,6 @@ benchmarks/TestData/Random.hs internal/GenUnboxTuple.hs internal/unbox-tuple-instances- Changelog Flag BoundsChecks Description: Enable bounds checking@@ -132,22 +101,15 @@ Data.Vector.Fusion.Util Data.Vector.Fusion.Stream.Size Data.Vector.Fusion.Stream.Monadic- Data.Vector.Fusion.Stream.Monadic.Safe Data.Vector.Fusion.Stream- Data.Vector.Fusion.Stream.Safe Data.Vector.Generic.Mutable- Data.Vector.Generic.Mutable.Safe Data.Vector.Generic.Base Data.Vector.Generic.New- Data.Vector.Generic.New.Safe Data.Vector.Generic- Data.Vector.Generic.Safe Data.Vector.Primitive.Mutable- Data.Vector.Primitive.Mutable.Safe Data.Vector.Primitive- Data.Vector.Primitive.Safe Data.Vector.Storable.Internal Data.Vector.Storable.Mutable@@ -155,14 +117,10 @@ Data.Vector.Unboxed.Base Data.Vector.Unboxed.Mutable- Data.Vector.Unboxed.Mutable.Safe Data.Vector.Unboxed- Data.Vector.Unboxed.Safe Data.Vector.Mutable- Data.Vector.Mutable.Safe Data.Vector- Data.Vector.Safe Include-Dirs: include, internal@@ -170,7 +128,10 @@ Install-Includes: vector.h - Build-Depends: base >= 4 && < 5, primitive >= 0.4.0.1 && < 0.5, ghc-prim+ Build-Depends: base >= 4 && < 5+ , primitive >= 0.5 && < 0.6+ , ghc-prim+ , deepseq >= 1.1 && < 1.4 if impl(ghc<6.13) Ghc-Options: -finline-if-enough-args -fno-method-sharing