scalaz.effect.RefCountedFinalizer.scala Maven / Gradle / Ivy
package scalaz
package effect
sealed abstract class RefCountedFinalizer {
val finalizer: IO[Unit]
val refcount: IORef[Int]
}
object RefCountedFinalizer extends RefCountedFinalizers {
def apply(u: IO[Unit], i: IORef[Int]): RefCountedFinalizer = refCountedFinalizer(u, i)
}
trait RefCountedFinalizers {
def refCountedFinalizer(u: IO[Unit], i: IORef[Int]): RefCountedFinalizer =
new RefCountedFinalizer {
val finalizer = u
val refcount = i
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy