Monad.untilM_as the means of repetition. We are currently on 7.1.10, and it looks like the bug is an anonymous function leakage related to the lazy val in
Monad.whileM. This has been changed in scalaz 7.2,x to use
Needrather than a direct lazy val. Empirically this fixes the issue (more encouragement to bite the bullet and upgrade across the breaking changes from 7.1 to 7.2), but I want to understand the nature of the fix, and I can't quite figure out the general need for the
Needabstraction. I think this is just encapsulating the lazy val into an object that can be GC'd after the recursion (at least after it trampolines at some point) but I was wondering if anyone could point me at a generalized explanation for the use-cases of
Needin broad terms...?