This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Put everything in terms of FreeT and ExceptT#745
Closed
Gurkenglas wants to merge 9 commits intohaskell:masterfrom
Closed
Put everything in terms of FreeT and ExceptT#745Gurkenglas wants to merge 9 commits intohaskell:masterfrom
Gurkenglas wants to merge 9 commits intohaskell:masterfrom
Conversation
alanz
reviewed
Aug 8, 2018
| instance GM.GmOut m => GM.GmOut (IDErring m) where gmoAsk = lift GM.gmoAsk | ||
| instance GM.GmState m => GM.GmState (IDErring m) where gmsGet = lift GM.gmsGet; gmsPut = lift . GM.gmsPut; gmsState = lift . GM.gmsState | ||
| instance (Functor f, MonadFree f m) => MonadFree f (IDErring m) where wrap x = liftWith (\run -> wrap $ fmap run x) >>= restoreT . return | ||
|
|
Collaborator
There was a problem hiding this comment.
Please do not let lines get longer than 115 chars (preferably 80), else the github UI does not show them properly
Contributor
Author
There was a problem hiding this comment.
Huh, shows fine for me. I liked hiding the obvious boilerplate way to the right.
Contributor
Author
|
(I hope you tick the squash box on merge.) |
Contributor
Author
|
|
Collaborator
|
@Gurkenglas is this still relevant? |
Collaborator
|
No response for 3 months, i guess this one is dead. |
Collaborator
|
Agree, and there was a different refactor that achieved a similar goal that landed after. @Gurkenglas if you want to pursue this, re-open the PR |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I pulled on some loose threads and this happened.
A bunch of code was reimplementing FreeT, another bunch could be made prettier with ExceptT, such as diverging indentation. Beyond that there was much refactoring, such as replacing some lens code with lens oneliners.
The alias names/structure aren't final. Maybe there should be more newtype wrapping for better errors? Sucks that type aliases aren't properly used in GHC's error messages, though.
I haven't implemented gmask for FreeT yet. I'm not sure whether it's needed/possible.
Depends on alanz/ghc-mod#12 and alanz/HaRe#54 because FreeT doesn't have MonadTransControl, but if that's a hassle one could work around those dependency updates.