
12 Jan
2011
12 Jan
'11
4:51 p.m.
On Wed, Jan 12, 2011 at 12:19:50AM +0100, Tim Baumgartner wrote:
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'
As a side note, the MonadRandom constraint is funny, since this function doesn't depend on any sort of randomness. You may consider changing the constraint to simply Monad m => ... -Brent