Permalink
Browse files

Merge pull request #1 from jhance/master

Data.Vector.Generic support
  • Loading branch information...
2 parents 81beecc + ff93e4d commit 2ea3aeff2971709c30d4621ba73fc4a62b91153d @TomMD committed Apr 3, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 Data/Vector/Strategies.hs
@@ -7,7 +7,8 @@ module Data.Vector.Strategies
import Control.DeepSeq (NFData(..))
import Control.Parallel.Strategies
import Control.Monad
-import qualified Data.Vector as V
+import qualified Data.Vector.Generic as V
+import qualified Data.Vector as VB
-- |Evaluate the elements of a boxed vector in parallel.
--
@@ -22,8 +23,8 @@ import qualified Data.Vector as V
-- @
--
-- 'parVector' can not provide any benefits (read: no parallelism) for unboxed vectors!
-parVector :: NFData a => Int -> Strategy (V.Vector a)
+parVector :: V.Vector v a => NFData a => Int -> Strategy (v a)
parVector n = liftM V.fromList . parListChunk n rdeepseq . V.toList
-instance NFData a => NFData (V.Vector a) where
+instance NFData a => NFData (VB.Vector a) where
rnf = rnf . V.toList

0 comments on commit 2ea3aef

Please sign in to comment.