Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Conversation

@Gurkenglas
Copy link
Contributor

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.

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not let lines get longer than 115 chars (preferably 80), else the github UI does not show them properly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, shows fine for me. I liked hiding the obvious boilerplate way to the right.

@Gurkenglas
Copy link
Contributor Author

(I hope you tick the squash box on merge.)

@Gurkenglas
Copy link
Contributor Author

Gurkenglas commented Aug 9, 2018

UnknownErrorCode is a better choice there than InternalError until we know the proper error code, right?

@alanz
Copy link
Collaborator

alanz commented Dec 24, 2018

@Gurkenglas is this still relevant?

@alanz alanz added this to the 2019-02 milestone Feb 2, 2019
@Anrock
Copy link
Collaborator

Anrock commented Mar 1, 2019

No response for 3 months, i guess this one is dead.

@Anrock Anrock closed this Mar 1, 2019
@alanz
Copy link
Collaborator

alanz commented Mar 1, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants