漓江丽火

Results 81 comments of 漓江丽火

![图片](https://user-images.githubusercontent.com/3401242/178127889-2c021867-f5c4-419c-b8fe-454db3aa4819.png)

It seems that the h2 database closed before http4s start and after data inited. `async[Resources[IO, *]]` works well in the same code on another Scala3 project.

And it seems that Scala2 can have cps transform with macro. [ThoughtWorksInc/each](https://github.com/ThoughtWorksInc/each)

> @djx314 the mechanisms on top of which this library is implemented differ massively from Scala 2 to Scala 3. In Scala 3, the async/await block desugars (roughly) to a...

Let me have a try with [ThoughtWorksInc/dsl-domains-cats](https://github.com/ThoughtWorksInc/dsl-domains-cats) a few days later. It seems that the lib just dependent on `cats.{Applicative, FlatMap, MonadError}` It seems can be a workaround for `async...

[code](https://github.com/scalax/ce-injection-samples/blob/28a4f2d05748d3d38e8500b04e6d6d8e9cbcb7c3/modules/scala213/src/main/scala/ce/injection/samples/mainapp/MainAppInjection.scala#L13-L43) Find a workaround use the lib above with cats2 support only. Now it works as expected.

@djspiewak @Baccata The desire to implement this function disappears since I only use `scala implicit` to implement the `injection` what it is more appropriate to named it `wire`. Just use...

~~I think it's a hard problem. Just show a sample~~ ```scala // trait Useable[T] // val r: Resource[IO, Connection] = ??? // val data1: IO[Int] = ??? // val insertAction:...

~~[scalax/ce-nat-sample](https://github.com/scalax/ce-nat-sample/blob/main/src/main/scala/e01_01/Compare.scala#L14-L20)~~ ~~@sideeffffect @djspiewak It's a sample part of [ghdmzsk/ghdmzsk](https://github.com/ghdmzsk/ghdmzsk)~~ ~~It use nat to abstract cats-effect. And I think it can solve this question. But it's a hard change.~~ ~~This code...

~~It means that change `F[T].flatMap(T => F[S]): F[S]` to `G[T].flatMap(T => F[S]): F[S]`~~ ~~Because `cats.effect.IO` is the center of cats-effect~~