summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-08-13 04:18:46 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-08-13 04:18:46 +0000
commit5c50b54a92c01218e5265413208b52321080c779 (patch)
treec90cd3e4943fe01a6c6d71689422931d1108873e /examples
parent91510a3d127d8d9bb10daec9a9ec22d3ad2c199e (diff)
remove MonadIO constraint from mapVectorM(_)
Diffstat (limited to 'examples')
-rw-r--r--examples/vector-map.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/vector-map.hs b/examples/vector-map.hs
index d778358..f116946 100644
--- a/examples/vector-map.hs
+++ b/examples/vector-map.hs
@@ -7,7 +7,6 @@ import Data.Packed.Vector
7import Numeric.LinearAlgebra.Interface 7import Numeric.LinearAlgebra.Interface
8 8
9import Control.Monad.State 9import Control.Monad.State
10import Control.Monad.Trans
11 10
12------------------------------------------- 11-------------------------------------------
13 12
@@ -20,7 +19,7 @@ v = fromList $ take 10 [0..]
20test1 :: Vector Int -> IO (Vector Int) 19test1 :: Vector Int -> IO (Vector Int)
21test1 = do 20test1 = do
22 mapVectorM (\x -> do 21 mapVectorM (\x -> do
23 putStr $ (show) x ++ " " 22 putStr $ (show x) ++ " "
24 return (x + 1)) 23 return (x + 1))
25 24
26-- we can have an arbitrary monad AND do IO 25-- we can have an arbitrary monad AND do IO
@@ -36,7 +35,7 @@ main = do
36 v' <- test1 v 35 v' <- test1 v
37 putStrLn "" 36 putStrLn ""
38 putStrLn $ show v' 37 putStrLn $ show v'
39 evalStateT (addInitialM v) 1 38 evalStateT (addInitialM v) 0
40 putStrLn "" 39 putStrLn ""
41 return () 40 return ()
42 41