diff options
Diffstat (limited to 'lib/Data/Packed/ST.hs')
-rw-r--r-- | lib/Data/Packed/ST.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs index 48e35b4..652f43e 100644 --- a/lib/Data/Packed/ST.hs +++ b/lib/Data/Packed/ST.hs | |||
@@ -90,11 +90,11 @@ writeVector :: Storable t => STVector s t -> Int -> t -> ST s () | |||
90 | writeVector = safeIndexV unsafeWriteVector | 90 | writeVector = safeIndexV unsafeWriteVector |
91 | 91 | ||
92 | {-# NOINLINE newUndefinedVector #-} | 92 | {-# NOINLINE newUndefinedVector #-} |
93 | newUndefinedVector :: Element t => Int -> ST s (STVector s t) | 93 | newUndefinedVector :: Storable t => Int -> ST s (STVector s t) |
94 | newUndefinedVector = unsafeIOToST . fmap STVector . createVector | 94 | newUndefinedVector = unsafeIOToST . fmap STVector . createVector |
95 | 95 | ||
96 | {-# INLINE newVector #-} | 96 | {-# INLINE newVector #-} |
97 | newVector :: Element t => t -> Int -> ST s (STVector s t) | 97 | newVector :: Storable t => t -> Int -> ST s (STVector s t) |
98 | newVector x n = do | 98 | newVector x n = do |
99 | v <- newUndefinedVector n | 99 | v <- newUndefinedVector n |
100 | let go (-1) = return v | 100 | let go (-1) = return v |
@@ -164,9 +164,9 @@ writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () | |||
164 | writeMatrix = safeIndexM unsafeWriteMatrix | 164 | writeMatrix = safeIndexM unsafeWriteMatrix |
165 | 165 | ||
166 | {-# NOINLINE newUndefinedMatrix #-} | 166 | {-# NOINLINE newUndefinedMatrix #-} |
167 | newUndefinedMatrix :: Element t => MatrixOrder -> Int -> Int -> ST s (STMatrix s t) | 167 | newUndefinedMatrix :: Storable t => MatrixOrder -> Int -> Int -> ST s (STMatrix s t) |
168 | newUndefinedMatrix order r c = unsafeIOToST $ fmap STMatrix $ createMatrix order r c | 168 | newUndefinedMatrix order r c = unsafeIOToST $ fmap STMatrix $ createMatrix order r c |
169 | 169 | ||
170 | {-# NOINLINE newMatrix #-} | 170 | {-# NOINLINE newMatrix #-} |
171 | newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t) | 171 | newMatrix :: Storable t => t -> Int -> Int -> ST s (STMatrix s t) |
172 | newMatrix v r c = unsafeThawMatrix $ reshape c $ runSTVector $ newVector v (r*c) | 172 | newMatrix v r c = unsafeThawMatrix $ reshape c $ runSTVector $ newVector v (r*c) |