-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cats.Monad #44
Comments
Implemented in https://github.com/ThoughtWorksInc/dsl-domains-cats |
@Atry I don't quite understand, how do you use |
For those interested, this solution worked for me:
implicit val monadR: scalaz.Monad[Resource[IO, *]] =
new Monad[Resource[IO, *]] {
override def point[A](a: => A): Resource[IO, A] = cats.effect.Resource
.pure(a)
override def bind[A, B](
fa: Resource[IO, A],
)(f: A => Resource[IO, B]): Resource[IO, B] = fa.flatMap(f)
}
import com.thoughtworks.each.Monadic._
monadic[Resource[IO, *]] {
// ...
private implicit val monadR: scalaz.Monad[IO] = new scalaz.Monad[IO] {
override def bind[A, B](fa: IO[A])(f: A => IO[B]): IO[B] = fa.flatMap(f)
override def point[A](a: => A): IO[A] = IO.delay(a)
} |
To be clear, (reopen this issue so that people could find the solution in dsl-domains-cats easier) |
No description provided.
The text was updated successfully, but these errors were encountered: