[Haskell-cafe] MonadRandom-computation that does not terminate
baumgartner.tim at googlemail.com
Wed Jan 12 00:19:50 CET 2011
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,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe