by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Cameron Joannidis
    @camjo
    Hey is this the right place to discuss composition of scalaz.Free?
    SteveDraper
    @SteveDraper
    I'm currently looking into a small memory leak in some code that repeatedly executes a monadic composition using 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 Need rather 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 Need abstraction. 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 Need in broad terms...?