Proposal: Adding Kleisli composition to Control.Monad

Henning Thielemann lemming at henning-thielemann.de
Mon Nov 13 08:14:57 EST 2006


On Mon, 13 Nov 2006, Donald Bruce Stewart wrote:

> > I would personally rather see repeatM and repeatM_ like the
> > replicateM/replicateM_ pair already in Control.Monad.
> > 
> > I implement them like this:
> > repeatM  = sequence  . repeat
> > repeatM_ = sequence_ . repeat
> > 
> > Google CodeSearch tells me it's the way replicateM was implemented too:
> > http://www.google.com/codesearch?hl=en&lr=&q=replicateM+file%3A%5C.hs%
> > 24&btnG=Search
> > 
> > Btw, i hope it is ok to give my opinion on this. Im asking since im not
> > a library developer or anything just a normal programmer.
> 
> On this topic, we can go back to:
>     http://www.mail-archive.com/cvs-all@haskell.org/msg26511.html
> 
> However, it was pointed out that repeatM is next to useless, and it is
> traditional to use 'forever' for repeatM_ (see for example "Tackling the
> Awkward Squad", and http://haskell.org/haskellwiki/Roll_your_own_IRC_bot
> 
> That being said, repeatM_ isn't too bad, should people prefer it.

I prefer repeatM_ in analogy to List.repeat.


More information about the Libraries mailing list