Skip to content
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

Provide TH for generating "wrappers" around incompatible interfaces #352

Open
TheMatten opened this issue Jun 21, 2020 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@TheMatten
Copy link
Collaborator

Users are often interested in integrating existing libraries based around concrete monad / mtl-style typeclass with polysemy - while sometimes possible without much boilerplate (orphan instances), current situation mostly requires writing wrapper effects that delegate calls into some embedded monad. Investigate possibility of generating these wrappers with TH - possibly by taking name of effect, final monad and list of actions to wrap and creating effect with wrapped actions that interprets into final monad.

@TheMatten TheMatten added the enhancement New feature or request label Jun 21, 2020
@adamConnerSax
Copy link

Is the ConstraintAbsorber machinery relevant here? Or do you mean something different from calling library functions with MTL-style constraints?

@TheMatten
Copy link
Collaborator Author

Hmm, I forgot about this one - so it allows fundeps, removes need for orphans and allows using existing methods from what I understand. Amount of code ends up being similar, but it feels cleaner and may better interop with other libraries. Yeah, thanks for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants