monad-loops
monad-loops copied to clipboard
Is iterateM_ incorrectly named?
Since it has type Monad m => (a -> m a) -> a -> m b shouldn't it be called iterateM?
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.
That would seem reasonable but obviously there is no urgency.