natefaubion / purescript-run

An extensible-effects implementation
MIT License
158 stars 14 forks source link

Suggestion: add `modify_`, change `modify`. #27

Open artemisSystem opened 4 years ago

artemisSystem commented 4 years ago

Currently, we have modify :: forall s r. (s -> s) -> Run (state :: STATE s | r) Unit. It would be nice to instead have: modify :: forall s r. (s -> s) -> Run (state :: STATE s | r) s (returns the new state) modify_ :: forall s r. (s -> s) -> Run (state :: STATE s | r) Unit (current modify)

This would be a breaking change, but it could be added along with all the changes that are necesscary for 0.14, since they will be breaking as well.