-
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
Add a MonadBaseControl instance for CofreeT #193
Comments
|
The extra law is a free theorem, as Li-Yao Xia explains. So we can do this if it makes some kind of sense. |
@RyanGlScott, what do you think? |
I'm more asking your opinion about whether it makes sense than whether it
should be added here.
…On Tue, Dec 29, 2020, 7:13 AM Ryan Scott ***@***.***> wrote:
To be honest, I haven't really used monad-control much, so I don't have a
strong opinion on it. Since @ekmett <https://github.com/ekmett> has
expressed reservations about adding instances from monad-control in the
past (see here <#m_3502922702521140048_20>), I'd like to hear his opinion
before going forth and adding a monad-control dependency.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#193 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOOF7KT4LA34KMGZRXT2RDSXHBV3ANCNFSM4I2Q7YOA>
.
|
I personally think we should avoid MonadBaseControl as much as possible. It makes forking and exception handling of stateful monad transformers "work", but often in undesirable ways. Maybe it makes sense if monad-control didn't have the footgun instances for StateT, ExceptT and so on, but it does so it's hard to say for me that the proposed instance makes sense. |
The following certainly typechecks:
I believe it obeys the
MonadTransControl
lawsunder the assumptionusing the fact thatWhile this strikes me as reasonable, I don't have enough experience with the class to know for sure.See basvandijk/monad-control#48.The text was updated successfully, but these errors were encountered: