diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-03-01 11:15:22 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-03-01 11:15:22 +0000 |
commit | 283f3033f86fabde2290bb28a59e7d87fd0754f5 (patch) | |
tree | ac9000c976a805636b557b916af9e139922df70c /lib/Data/Packed/ST.hs | |
parent | 54bcc1fc1e0f9676cb10f627f412eeeea34b5d2c (diff) |
compatible with vector
Diffstat (limited to 'lib/Data/Packed/ST.hs')
-rw-r--r-- | lib/Data/Packed/ST.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs index a47da05..48e35b4 100644 --- a/lib/Data/Packed/ST.hs +++ b/lib/Data/Packed/ST.hs | |||
@@ -37,11 +37,11 @@ import Foreign | |||
37 | 37 | ||
38 | {-# INLINE ioReadV #-} | 38 | {-# INLINE ioReadV #-} |
39 | ioReadV :: Storable t => Vector t -> Int -> IO t | 39 | ioReadV :: Storable t => Vector t -> Int -> IO t |
40 | ioReadV v k = withForeignPtr (fptr v) $ \s -> peekElemOff s k | 40 | ioReadV v k = unsafeWith v $ \s -> peekElemOff s k |
41 | 41 | ||
42 | {-# INLINE ioWriteV #-} | 42 | {-# INLINE ioWriteV #-} |
43 | ioWriteV :: Storable t => Vector t -> Int -> t -> IO () | 43 | ioWriteV :: Storable t => Vector t -> Int -> t -> IO () |
44 | ioWriteV v k x = withForeignPtr (fptr v) $ \s -> pokeElemOff s k x | 44 | ioWriteV v k x = unsafeWith v $ \s -> pokeElemOff s k x |
45 | 45 | ||
46 | newtype STVector s t = STVector (Vector t) | 46 | newtype STVector s t = STVector (Vector t) |
47 | 47 | ||