-
Notifications
You must be signed in to change notification settings - Fork 21
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
Do you see value in a Ref-Monad like State? #32
Comments
I think something along these lines is unlikely to be merged in this library; we prefer to keep core libraries as lean and unopinionated as is reasonably possible. Are you imagining something that is more or less equivalent to |
Putting a reference into a local state ( |
Yes, you're right, I did mean Reader rather than State. But in any case I don't think this is something we will want to include in this library. |
My initial idea is complicated by the fact that a reference-based, global state monad, being effectful, cannot have an instance of the type-class The only way out that I can see would be to re-implement an effectful variant of |
I am using purescript for a canvas-based web app and don't need any fancy UI library. I end up with a lean, global application state and deal with events quite bare-footed.
I find myself writing
quite a lot.
If you don't object, I'll come up with a pull request soon to allow to write the above via a monad for effectfull, global state:
I miss the lenses :)
Also, maybe you have a suggestion for the module name.
How about
Effect.Ref.Monad
? AlternativelyControl.Monad.State.Global
.The text was updated successfully, but these errors were encountered: