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

Add Effectful.Input.Const, Effectful.Output.Array and Effectful.Coroutine #289

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arybczak
Copy link
Member

Proof of concept.

  • Effectful.Input.Const as a restricted version of Reader for ensuring that the input parameter doesn't change (static only, since with a dynamic you can change it with interpose).
  • Effectful.Output.Array is the correct alternative to Writer when you just want to accumulate values.

And then it turned out that these are generalized by the Coroutine effect, so might as well also include it, it looks like there's no point providing a dynamic Input and Output.

Opinions welcome.

@arybczak arybczak marked this pull request as draft December 22, 2024 20:45
@arybczak
Copy link
Member Author

@tomjaguarpaw perhaps you have an opinion about this, i.e. separate Input/Output vs type synonyms for Coroutine?

@tomjaguarpaw
Copy link

If I was doing it again I would have made Stream and Produce newtypes of Coroutine, rather than type synonyms. The error messages would have been better. I don't know that the same reasoning holds for effectful though.

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