summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/ST.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-06-19 17:25:58 +0000
committerAlberto Ruiz <aruiz@um.es>2008-06-19 17:25:58 +0000
commitfe795ee9b1e71666d408879ce30fe6d4ca80830e (patch)
tree81e691ee455832823bebad6febde9fdf216b0b86 /lib/Data/Packed/ST.hs
parent8dce18602825da9914832114283748244fa9b859 (diff)
ST bug fixed with NOINLINE newVector/Matrix
Diffstat (limited to 'lib/Data/Packed/ST.hs')
-rw-r--r--lib/Data/Packed/ST.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Data/Packed/ST.hs b/lib/Data/Packed/ST.hs
index 1311ff9..ed0a05e 100644
--- a/lib/Data/Packed/ST.hs
+++ b/lib/Data/Packed/ST.hs
@@ -89,6 +89,7 @@ readVector = safeIndexV unsafeReadVector
89writeVector :: Storable t => STVector s t -> Int -> t -> ST s () 89writeVector :: Storable t => STVector s t -> Int -> t -> ST s ()
90writeVector = safeIndexV unsafeWriteVector 90writeVector = safeIndexV unsafeWriteVector
91 91
92{-# NOINLINE newVector #-}
92newVector :: Element t => t -> Int -> ST s (STVector s t) 93newVector :: Element t => t -> Int -> ST s (STVector s t)
93newVector v = unsafeThawVector . constant v 94newVector v = unsafeThawVector . constant v
94 95
@@ -154,5 +155,6 @@ readMatrix = safeIndexM unsafeReadMatrix
154writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () 155writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s ()
155writeMatrix = safeIndexM unsafeWriteMatrix 156writeMatrix = safeIndexM unsafeWriteMatrix
156 157
158{-# NOINLINE newMatrix #-}
157newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t) 159newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t)
158newMatrix v r c = unsafeThawMatrix . reshape c . constant v $ r*c 160newMatrix v r c = unsafeThawMatrix . reshape c . constant v $ r*c