[vector] #24: Conversion between different types of vectors
vector
vector at projects.haskell.org
Tue Jun 15 02:09:06 EDT 2010
#24: Conversion between different types of vectors
------------------------+---------------------------------------------------
Reporter: Khudyakov | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Version: | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by rl):
Actually, the darcs version includes this:
{{{
convert :: (Vector v a, Vector w a) => v a -> w a
}}}
This is an O(n) function, however. I agree that O(1) conversions between
unboxed and storable vectors would be very desirable. This would require
basing Data.Vector.Unboxed on Data.Vector.Storable instead of
Data.Vector.Primitive, though. I've been thinking about that for a while
but currently, GHC doesn't optimise storable vectors as well as primitive
ones in some cases. In particular, see
http://hackage.haskell.org/trac/ghc/ticket/4096. I'll try to get these
primitives into GHC 6.14 but that means that storable-unboxed conversions
won't be O(1) at least as long as 6.12 is widely used.
--
Ticket URL: <http://trac.haskell.org/vector/ticket/24#comment:2>
vector <http://trac.haskell.org/vector>
Package vector
More information about the vector
mailing list