-
Notifications
You must be signed in to change notification settings - Fork 11
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
MTL interop #5
Comments
That's right, you can't give Bluefin's |
This approach of passing in multiple effects seems not entirely terrible: bluefin/bluefin-internal/src/Bluefin/Internal.hs Lines 252 to 268 in c7b2b1f
|
So, for a better answer to your question, you can do MTL style effects interop without (defining your own) newtypes. Whether that's "seamless" or not is up for debate. |
Considering that in the "real world" code you will have interleaving of MTL style functions and "native" effects, looks like it's going to be a pain with this approach 🤔 |
By '"native" Effects' do you mean bluefin/bluefin-internal/src/Bluefin/Internal.hs Lines 260 to 272 in b9c1354
I'm not going to say this is the most ergonomic thing I've ever seen, but considering it was the first thing I thought of and I worked on it for about an hour, I think it's promising. |
You could also apply the conversion to individual actions to get the back into bluefin/bluefin-internal/src/Bluefin/Internal.hs Lines 279 to 294 in eeb06e3
|
What if you want to call a function |
That one needs the following form (because runMTLStyle $ handleMTLWith aHandle $ handleMTLWith bHandle $ f Maybe this form, or some infix operator, would be more ergonomic? It remains to be seen. runMTLStyle (f `handleMTLWith` aHandle `handleMTLWith` bHandle) |
Looks like you can't do seamless (i.e. without newtypes) MTL style effects interop, as already evidenced by how Eff can't have a MonadIO instance?
The text was updated successfully, but these errors were encountered: