replaceVector :: forall a. Storable a => BufferTarget -> V.Vector a -> IO ()
replaceVector target v = V.unsafeWith v $ \ptr ->
                           bufferData target $= (numBytes, ptr, StaticDraw)
  where numBytes = fromIntegral $ V.length v * sizeOf (undefined::a)

-- |Produce a 'Ptr' value to be used as an offset of the given number
-- of bytes.
replaceVector :: forall a. Storable a => BufferTarget -> V.Vector a -> IO ()
replaceVector target v = V.unsafeWith v $ \ptr ->
                           bufferData target $= (numBytes, ptr, StaticDraw)
  where numBytes = fromIntegral $ V.length v * sizeOf (undefined::a)

-- |Produce a 'Ptr' value to be used as an offset of the given number
-- of bytes.
replaceVector target v = V.unsafeWith v $ \ptr ->
                           bufferData target $= (numBytes, ptr, StaticDraw)
  where numBytes = fromIntegral $ V.length v * sizeOf (undefined::a)

-- |Produce a 'Ptr' value to be used as an offset of the given number
-- of bytes.