monad-loops icon indicating copy to clipboard operation
monad-loops copied to clipboard

Suggesting functions repeatM

Open w9 opened this issue 10 years ago • 0 comments

I find the following functions useful that are currently not in the package. They are useful for building simple interactive loops.

repeatM :: Monad m => m a -> m [a]
repeatM = sequence . repeat

repeatM_ :: Monad m => m a -> m ()
repeatM_ = sequence_ . repeat

w9 avatar Oct 17 '15 21:10 w9