Spawn[F[_]].background(fa)
does not evaluate fa
under TestContext
#2320
Labels
Spawn[F[_]].background(fa)
does not evaluate fa
under TestContext
#2320
It could be shown by a simple test harness that
IO.pure(1).start.map(_.join.flatMap(_.embedNever)) === IO(IO.pure(1))
, butIO.pure(1).background.map(_.flatMap(_.embedNever)) !== Resource.pure(IO.pure(1))
.I believe that with test
Eq[Resource[F, *]
instance likeEq.by(_.use(F.pure))
above should be equivalent. Moreso,IO.pure(1).background.map(_.flatMap(_.embedNever)).use(identity) === Resource.pure(IO.pure(1)).use(identity)
underTestContext
.Also, there is more complex example with Scala 3 that attempts to create new Applicative instance.
ApplicativeTests
laws such as homomorphism law fail for it exactly by the same cause.The text was updated successfully, but these errors were encountered: