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

Does hedgehog support comparison with IO? #8

Open
joelberkeley opened this issue Dec 28, 2021 · 3 comments
Open

Does hedgehog support comparison with IO? #8

joelberkeley opened this issue Dec 28, 2021 · 3 comments

Comments

@joelberkeley
Copy link

joelberkeley commented Dec 28, 2021

Forgive the naive question, but when you say

Gen is not a monad transformer right now, therefore it cannot be combined with additional monadic effects. The main reason for this is that we use a Cotree codata type for shrinking, and it is hard to combine this with monadic effects in a provably total way.

Does this mean it's not possible to write tests when the result is in an IO? For example, testing the Nat in the output of

foo : Nat -> IO Nat
@stefan-hoeck
Copy link
Owner

I'm truly sorry I missed this question. Right now, there seems no easy way to do this other than using unsafePerformIO. I'll have to think some more about how easy it will be to test computations with side effects.

@joelberkeley
Copy link
Author

OK, thanks, and not a problem. I don't particularly care about testing the side effects themselves at the moment. I'm mostly interested in the contained value.

@joelberkeley
Copy link
Author

btw I no longer need this, but I'll leave the ticket open because it's presumably useful

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

No branches or pull requests

2 participants