summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-06-27 17:24:37 +0000
committerAlberto Ruiz <aruiz@um.es>2008-06-27 17:24:37 +0000
commitdeb17122b5804d04b06cc830f5aa121e739eaf21 (patch)
tree75834f13b68273faee07d86d2e3d5a3d965fddc5 /examples
parentfe795ee9b1e71666d408879ce30fe6d4ca80830e (diff)
tested with ghc-6.8.3
Diffstat (limited to 'examples')
-rw-r--r--examples/inplace.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/inplace.hs b/examples/inplace.hs
index 9f23e0c..dcfff56 100644
--- a/examples/inplace.hs
+++ b/examples/inplace.hs
@@ -129,6 +129,14 @@ histoCheck ds = runSTVector $ do
129 mapM_ inc ds 129 mapM_ inc ds
130 return h 130 return h
131 131
132hc = fromList [1 .. 15::Double]
133
134-- check that thawVector creates a new array
135histoCheck2 ds = runSTVector $ do
136 h <- thawVector hc
137 let inc k = modifyVector h k (+1)
138 mapM_ inc ds
139 return h
132 140
133test8 = do 141test8 = do
134 let ds = [0..14] 142 let ds = [0..14]
@@ -138,4 +146,7 @@ test8 = do
138 print $ histoCheck ds 146 print $ histoCheck ds
139 print $ histoCheck ds 147 print $ histoCheck ds
140 print $ histoCheck ds 148 print $ histoCheck ds
149 print $ histoCheck2 ds
150 print $ histoCheck2 ds
151 print $ histoCheck2 ds
141 putStrLn "----------------------" 152 putStrLn "----------------------"