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

Warning multiple evaluation of a single effectful computation at the development mode #30

Open
ENvironmentSet opened this issue Aug 25, 2023 · 0 comments

Comments

@ENvironmentSet
Copy link
Owner

ENvironmentSet commented Aug 25, 2023

All the functions of hyogwa assume that given generators representing effectful computation are 'fresh' (i.e. never executed after the creation). Therefore, passing around effectful computation that was already evaluated have high possibility to cause unsound results. For this problem, we can help the users not to make invariants by adding invariant checkers that work at development mode.

function* foo() {
  const bar = baz()

  yield* bar
  yield* bar // this can be problemetic
}
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