Skip to content

Commit

Permalink
use evalMap
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai committed Jun 29, 2019
1 parent 4348515 commit d476e5e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class ZManagedSyntax[R, E, A](private val managed: ZManaged[R, E, A]) exte
def toResourceZIO(implicit ev: Applicative[ZIO[R, E, ?]]): Resource[ZIO[R, E, ?], A] =
Resource
.make(managed.reserve)(_.release.unit)
.flatMap(Resource liftF _.acquire)
.evalMap(_.acquire)

def toResource[F[_]](implicit F: Async[F], ev: Effect[ZIO[R, E, ?]]): Resource[F, A] =
toResourceZIO.mapK(Lambda[FunctionK[ZIO[R, E, ?], F]](F liftIO ev.toIO(_)))
Expand Down

0 comments on commit d476e5e

Please sign in to comment.