
11 Jan
2011
11 Jan
'11
6:19 p.m.
Hi, I'm having difficulties with this function I wrote: iterateR :: (MonadRandom m) => (a -> m a) -> a -> m [a] iterateR g s = do s' <- g s return (s:) `ap` iterateR g s' I'm running the computation with evalRandIO and surprisingly the first call of main in ghci succeeds, but the second does not terminate. Reproducible. Any clues what I'm doing wrong here? Thanks in advance, Tim