Skip to content

remove Realized #76

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

Merged
5 commits merged into from
Apr 17, 2024
Merged

remove Realized #76

5 commits merged into from
Apr 17, 2024

Conversation

MaximilianAlgehed
Copy link
Collaborator

@abailly-iohk how do I make the formatter ruin my code? Didn't we used to have a script for that somewhere?

Checklist:

  • Check source-code formatting is consistent

@MaximilianAlgehed MaximilianAlgehed requested a review from a user April 11, 2024 09:51
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Love removing code! Minor suggestion to deprecate instead of remove Realized

@ghost
Copy link

ghost commented Apr 11, 2024

how do I make the formatter ruin my code? Didn't we used to have a script for that somewhere?

No, we just use fourmolu with the provided fourmolu.yaml file. what's the problem?

@ghost
Copy link

ghost commented Apr 11, 2024

Ah it seems the CI is failing on cabal formatting 🤷

Copy link
Contributor

@jorisdral jorisdral left a comment

Choose a reason for hiding this comment

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

Since Realized would be removed, is there a suggested alternative for running tests in a monad other than IO?

@MaximilianAlgehed
Copy link
Collaborator Author

Since Realized would be removed, is there a suggested alternative for running tests in a monad other than IO?

Yes, if you're using IOSim the method is to index the state type by the monad, so if before you had ThreadId in the state type and you were running in IOSim s you'd now have ThreadId m in the state type instead.

@jorisdral
Copy link
Contributor

jorisdral commented Apr 17, 2024

Since Realized would be removed, is there a suggested alternative for running tests in a monad other than IO?

Yes, if you're using IOSim the method is to index the state type by the monad, so if before you had ThreadId in the state type and you were running in IOSim s you'd now have ThreadId m in the state type instead.

👍 I figured this was probably going to be the suggested method. Thanks!

@MaximilianAlgehed
Copy link
Collaborator Author

I'll remember to put something in the release notes about this!

@MaximilianAlgehed
Copy link
Collaborator Author

MaximilianAlgehed commented Apr 17, 2024

@abailly-iohk can we agree - in the light of @jorisdral's comment about -werror - that perhaps deprecating isn't necessary and we should just rip the band-aide off?

@ghost
Copy link

ghost commented Apr 17, 2024

Ah yes, I don't mind although I could argue that an error triggered by -Werror does not qualify as a breaking change and PVP is just wrong, but I won't :) Please revert my change and go ahead removing it

@MaximilianAlgehed
Copy link
Collaborator Author

@abailly-iohk any clue what's up with CI?

@ghost
Copy link

ghost commented Apr 17, 2024

@abailly-iohk any clue what's up with CI?

Some nix f**ery 🤷

@ghost ghost merged commit b50a995 into main Apr 17, 2024
@jorisdral
Copy link
Contributor

jorisdral commented Mar 12, 2025

Since Realized would be removed, is there a suggested alternative for running tests in a monad other than IO?

Yes, if you're using IOSim the method is to index the state type by the monad, so if before you had ThreadId in the state type and you were running in IOSim s you'd now have ThreadId m in the state type instead.

👍 I figured this was probably going to be the suggested method. Thanks!

So one thing this does not address is how to handle actions where the result type mentions the monad m. quickcheck-dynamic requires the result types of actions to be Typeable, but for IOSim s to be typeable, s has to be typeable, which is not the case for ST-style monad runners (unless you use something like stToIO). The upside of the Realized type family was that the action type and realized result could be different, and then we didn't have to have this problem. Any other ideas on how to mitigate this, except for using something like stToIO?

This pull request was closed.
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.

2 participants