Skip to content

Conversation

@armanbilge
Copy link
Member

@armanbilge armanbilge commented Jun 6, 2021

So far I've added instances for Stateful and Handle for IO. Any others I can provide? Or for other datatypes in CE3?

Comment on lines 29 to 33
IOLocal(0)
.flatMap { implicit local =>
IO.delay(checkAll("Stateful[IO]", StatefulTests[IO, Int].stateful))
}
.unsafeRunAndForget()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't work right now, and IDK how to make it work. The tricky part is to create an instance of Stateful[IO, Int] we need an IOLocal[Int] first which only comes in an IO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/typelevel/munit-cats-effect

Have a look at the Resource support! :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! Looking

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now hacked/fixed 🙃

@ChristopherDavenport
Copy link
Member

So I think this is a great idea, but for development this does build a cycle

cats-effect depends on cats-mtl for Test scope.

So whenever a new binary incompatible scala version drops this will need to not be released. Then cats-effect released, and then this module released.

I still think this is probably the right place. But its probably worth noting.

@armanbilge
Copy link
Member Author

armanbilge commented Jun 6, 2021

So I think this is a great idea, but for development this does build a cycle

Oops. Wouldn't this be much easier as a CE module then?

@armanbilge
Copy link
Member Author

armanbilge commented Jun 6, 2021

Via Discord: @djspiewak suggests adding this module would be "dodgy". Alternatives are that this goes in Cats Effect or I spin up a microlib. Also pinging @oleg-py for his thoughts.

Also want to reference #120 which (possibly in some variation) could also find a happy home with effect-related stuff. Edit: Also #86's StateIO can join too?

Finally, can someone help me figure out the build failure? I don't understand what it's referencing. Thanks!

Comment on lines +27 to +28
import cats.mtl.laws.discipline.{HandleTests, StatefulTests}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the imports need to be here, but the other tests do it too.

@armanbilge
Copy link
Member Author

I ended up putting these odds and ends together in a microlib: https://github.com/armanbilge/oxidized

@rossabaker rossabaker changed the base branch from master to main August 19, 2021 13:10
@armanbilge armanbilge closed this Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants