0
我该怎么办才能让put
在forM_里面工作在StateT monad上?StateT and forM_
loop :: Integer -> StateT World IO()
loop passes = do
(scene, b1) <- get
forM_ [1..passes] $ \pass -> do
let b2 = foo b1 pass
-- other stuff --
put (scene, b2) -- this no longer puts into the StateT monad
还是有更好的方法吗?
为什么你不觉得我窝RKS? –
(提示:你的'get'在循环之外,所以只运行*一次*) –