Looking for feedback: Move from monad-control & lifted-base to unliftio.
I'm considering switching over from uses of monad-control to unliftio. A few of the reasons:
- New yesod versions don't provide instances for
MonadBaseControlin Handlers. - There are noted issues with bracketing in the context of
MonadBaseControl(see https://www.fpcomplete.com/blog/2017/06/tale-of-two-brackets). In the case ofdatadog's usage, bracketing is one of the main reasons that we use it, so I'd like to restrict usage to a safer subset of monad transformers.
Any feedback is welcome, but thinking about doing a major release with #18 and #21 soon, so it'd be a good time to make the transition.
@dfithian would be particularly interested to hear from you on this if you've got any opinions on it. I expect people using withDogStatsD itself in one of the 'dangerous' transformers are few and far between.
Out of the country right now but will look next week
On Wed, Jun 20, 2018, 19:46 Ian Duncan [email protected] wrote:
@dfithian https://github.com/dfithian would be particularly interested to hear from you on this if you've got any opinions on it. I expect people using withDogStatsD itself in one of the 'dangerous' transformers are few and far between.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iand675/datadog/issues/22#issuecomment-398931807, or mute the thread https://github.com/notifications/unsubscribe-auth/AIBQ6IZt37-nkQK5xFWV2gJX7yd3wGjaks5t-t68gaJpZM4UwnXx .
This is the first time I've heard of unliftio. It looks like the advantage is that you can provide an implementation for running a monad transformer stack without pinning the makeup of the monad stack itself. Is that right? In addition, another advantage would be that one could nest ResourceT blocks? Certainly the latter is a beneficial result; many a time have I been bit by accidentally embedding multiple runResourceT calls.
I would say that given the ResourceT problem presents as a runtime error I'd be very careful about this change and make sure that it's not only called out in the README. Also potentially not completely rewriting the API but deprecating the old API and providing a new implementation.
Okay I'm totally on the MonadUnliftIO bandwagon now. Having used it this week I'm heavily in favor of banishing ExceptT to purgatory.
👍 glad to hear it. I think given that Yesod has dropped MonadBaseControl, it leaves us in a less-than-desirable position for popular usage.