Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is related to using a custom monad stack.
I have found using a custom monad stack useful for storing
Behavior
s, such that one part of the application can easily emit a new value, or some other part of the applicationsink
that value. Simply byask
ing for the necessary function.I also use a custom monad stack for a unique ID generator.
The problem with the approach in #161 is if I choose to edit my monad stack then I'll have to change all uses of
lift
to perhapslift $ lift
-- and usinglift
doesn't scale well with the amount of stacked monads. It's easier to make the custom monad stack an instance ofMonadUI
and useliftUI
instead oflift
, then if my monad stack changes in the future I will only have to edit the instance ofMonadUI
, instead of all the uses oflift
.