sidnt / zionotes

⸮ 🔴zio notes | zio nursery 🔵?
0 stars 0 forks source link

managed semantics #14

Open sidnt opened 4 years ago

sidnt commented 4 years ago

a constructor of mea: Managed[E,A]

object Managed {
  ...
  final def make[E, A](acquire: IO[E, A])(release: A => UIO[Any]): Managed[E, A] =
  ...
}

acquire is a by value parameter here. so, upon an invocation of make, the reference provided as acquire would be fully evaluated to yield a value of the mentioned type, first thing to happen after make is invoked, is the evaluation of acquire reference to an IO[E,A] value. acquire: IO[E,A]


after introduction,

managed semantics is defined as the operations available on a mea:Managed[E,A] instance.