summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/ST.hs
diff options
context:
space:
mode:
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