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'm happy to discuss any suggestions for improving this.
Also note that I've put my own name in the copyright field on line 4, I am not certain if that is the right thing to do.
Edit: And maybe we should have a more explicit constraint that the MEff should be the last one in the effect stack. Something like:
classLasthewherelastContext::Contexte->Context (h:*())
instanceLasth (h:*()) where
lastContext =idinstanceLasthe=>Lasth (h':*e) where
lastContext ctx = lastContext (ctail ctx)
-- I've chosen $ because it means end of a line in regular expressions.typeh:$?e=Lasthe
@xnning I think this pull request is a bit outdated. Wrapping Ctl with IO like I do in #7 is in my opinion a much better and probably much more performant way to implement IO. The only problem perhaps is that the performance of non-IO code takes a small hit, but on the other hand it improves the correctness of code that uses the Local effect (see #6).
There are some different designs. For example, you could wrap Ctl with an arbitrary monad m then code that doesn't use Local or IO can use Identity for that m and code that only wants a Local effect could perhaps use ST and code that don't use either can use Identity. With Identity there should be no overhead over the current, but then you cannot use Local anymore.
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.
Fixes #2
I'm happy to discuss any suggestions for improving this.
Also note that I've put my own name in the copyright field on line 4, I am not certain if that is the right thing to do.
Edit: And maybe we should have a more explicit constraint that the MEff should be the last one in the effect stack. Something like: