diff options
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 | ||