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

Is iterateM_ incorrectly named?

Open idontgetoutmuch opened this issue 11 years ago • 2 comments

Since it has type Monad m => (a -> m a) -> a -> m b shouldn't it be called iterateM?

idontgetoutmuch avatar Jun 14 '14 19:06 idontgetoutmuch

Yes, I believe you're right. Upon thinking about this particular case I realize I've been internally using a different heuristic from what I stated in the comments - that the loop as a whole does not return anything to the point it was called. It doesn't really seem like a relevant distinction either way for this particular function, though. Like forever, the fact that it doesn't return means there's really no need to disambiguate based on what is "returned" in the first place.

I'm not sure about the best way forward... do you feel the disruption of changing it is worthwhile? My inclination is to introduce a properly-named version and deprecate the old one for a while.

mokus0 avatar Jun 27 '14 15:06 mokus0

That would seem reasonable but obviously there is no urgency.

idontgetoutmuch avatar Jul 01 '14 15:07 idontgetoutmuch