Skip to content
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

Open
Atry opened this issue Nov 2, 2016 · 4 comments
Open

Support cats.Monad #44

Atry opened this issue Nov 2, 2016 · 4 comments

Comments

@Atry
Copy link
Collaborator

Atry commented Nov 2, 2016

No description provided.

@Atry
Copy link
Collaborator Author

Atry commented Feb 3, 2023

@Atry Atry closed this as completed Feb 3, 2023
@ScalaWilliam
Copy link

@Atry I don't quite understand, how do you use each with cats? Tried some imports but could not get them to work together.

@ScalaWilliam
Copy link

ScalaWilliam commented Mar 11, 2023

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, *]] {
// ...

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)
  }

@Atry
Copy link
Collaborator Author

Atry commented Mar 12, 2023

To be clear, each does not support cats. I just mean I created another similar library that supports cats.

(reopen this issue so that people could find the solution in dsl-domains-cats easier)

@Atry Atry reopened this Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants