From fe795ee9b1e71666d408879ce30fe6d4ca80830e Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 19 Jun 2008 17:25:58 +0000 Subject: ST bug fixed with NOINLINE newVector/Matrix --- lib/Data/Packed/ST.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Data') 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 writeVector :: Storable t => STVector s t -> Int -> t -> ST s () writeVector = safeIndexV unsafeWriteVector +{-# NOINLINE newVector #-} newVector :: Element t => t -> Int -> ST s (STVector s t) newVector v = unsafeThawVector . constant v @@ -154,5 +155,6 @@ readMatrix = safeIndexM unsafeReadMatrix writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () writeMatrix = safeIndexM unsafeWriteMatrix +{-# NOINLINE newMatrix #-} newMatrix :: Element t => t -> Int -> Int -> ST s (STMatrix s t) newMatrix v r c = unsafeThawMatrix . reshape c . constant v $ r*c -- cgit v1.2.3