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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to