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

Test code using AlmostEff is subject to dead code elimination #304

Open
anttih opened this issue Jul 11, 2023 · 1 comment
Open

Test code using AlmostEff is subject to dead code elimination #304

anttih opened this issue Jul 11, 2023 · 1 comment

Comments

@anttih
Copy link

anttih commented Jul 11, 2023

The type

type AlmostEff = Unit -> Unit

causes code that uses it to be removed when compiling using the backend-optimizer. This is problematic when implementing a new backend where the backend-optimizer is of great benefit.

I suggest we replace the use of AlmostEff with just enough Effect to prevent this from happening.

Even if not using the backend-optimizer or somehow making it possible to prevent dead code elimination I think it would still be better not to use Unit -> Unit as the type in the tests.

@anttih
Copy link
Author

anttih commented Jul 11, 2023

I should clarify, it's that the backend-optimizer sees Unit -> Unit as a pure function and any bind seems to be doing nothing.

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

1 participant