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