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

Semantics of Writer #16

Open
re-xyr opened this issue Apr 23, 2022 · 0 comments
Open

Semantics of Writer #16

re-xyr opened this issue Apr 23, 2022 · 0 comments

Comments

@re-xyr
Copy link
Owner

re-xyr commented Apr 23, 2022

Writer is probably the strangest "classical" effect, in the sense that it is both mutable (tell) and scoped (listen and pass).

This means we have 3 distinct semantics for listen:

  • tell in listen appends to main accumulator immediately;
  • tell in listen appends to an alternative accumulator that is later "merged" into the main one. On error, the merge still happens.
  • Same as above, but on error, the merge never happens.

And 2 distinct semantics for pass:

  • tell in pass appends to an alternative accumulator and later merged into the main one. On error, the merge still happens.
  • Same as above, but on error, the merge never happens.

If we make censor a primitive operation on its own rights, then it has 2 semantics:

  • Same with the mtl definition, inheriting whatever the semantics pass has.
  • Same with eff, apply the transformation function on each individual output. Modulo errors, this coincides with the mtl definition only when the the transformation is a homomorphism.
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