You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that such a function is useful. However, if it's going be in mtl, I would rather see its monomorphic cousin appear in transformers first. The name feels a little disconnected. The function is closely related to local, and none of the existing reader functions mention with or Env in their name. A few ideas (not that I particularly like any of these): localEnv, localConst, local' (gross), local_.
I agree that such a function is useful. However, if it's going be in mtl, I would rather see its monomorphic cousin appear in transformers first. The name feels a little disconnected. The function is closely related to local, and none of the existing reader functions mention with or Env in their name. A few ideas (not that I particularly like any of these): localEnv, localConst, local' (gross), local_.
This makes sense. An issue should first be opened on transformers then.
btw, perhaps readerM is a good name? because we have
reader::MonadReaderrm=> (r->a) ->ma
so readerM makes a nice contrast, just indicating that the function is monadic:
readerM:: (r->ma) ->ma
readerM f = ask >>= f
I had something else in mind when writting this comment. disregard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
It's useful when you're storing the environment in a data structure.