-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccumT
is a regular transformer and should have a regular MonadAccum
instance.
#141
base: master
Are you sure you want to change the base?
Conversation
c21c548
to
b1e36c4
Compare
Moving this here just so that it doesn't get lost (from #140):
My motivation was instance (Monoid w, Monad m) => MonadWriter (WriterT w m) I also feel like this is the way, that all transformers instances work (except for So if you would argue to keep Well I think the way that |
There is no reason to restrict this instance any further.
b1e36c4
to
7172d34
Compare
Sorry, I'm confused as to why you feel this is "the way"? What way? Are you making the argument that it's always the case that If this is not the case and you've found a way to make it work, do you mind presenting your work and showing us that the laws pass? |
I did the work: https://felixspringer.xyz/homepage/blog/accumtsMonadaccumInstance
I didn't check this in particular, but considering that I just proved it for any base monad your finding cannot be true (unless I made a mistake of course, so please thoroughly check it). |
This looks like a fine change to me. I'm also puzzled why |
@jumper149 I believe i was looking at the PR last night and proved something else for something entirely unrelated to the PR. I checked again and yes, your proof is fine, thanks for providing it. It seems like this would be fine! |
I think this was accidentaly copy-pasted, see #140 .
I don't see any problem with doing it this way.
Maybe you can spot anything?