-
Notifications
You must be signed in to change notification settings - Fork 73
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
No instance for (MonadMask (Sem DefaultMembers)) #395
Comments
not sure this is gonna work, but you might be better off using |
@tek thanks a lot for the help, I managed to improve things a bit but I am still stuck. |
@teto it's not a lot to ask at all, I'm happy to take a look! Unfortunately, I can't build your project since it appears to depend on others in your file system. Furthermore, your However, I can give you sufficient advice from looking at the code! The canonical way to specify the stack is to use Please don't hesitate to ask for further advice! |
oh, and please join us at https://funprog.zulipchat.com , we have a Polysemy stream there! |
just realized I forgot the most significant bit about the You can simply change the signature of |
thanks for the help. So you suggest to remove runCommand and CommandCb ? I've tried some things but maybe I am too tired (or stupid), I can't make anything work. I've pushed several modifications so that compilation should at least start without any fiddling at https://github.com/teto/quantum/tree/final. I hope to give it a try tomorrow with a fresher mind. |
well, clear your head and then post some compile errors, we'll figure it out 🙂 as for the |
some preliminary pointers:
|
I am stuck on the 2 very problem/pointers you mentioned : embed IO and runFinal.
and
I logged in to the zulip but couldn't find any polysemy stream (even via the search engine) ? NB: I've noticed sometime the order in evaluating effect matters in terms of compilation (I know it matters at runtime ?), was it an artifact of refactoring or a fixed stack vs freeform or an hallucination ? |
curious, are you sure you're on the right server? this is the direct link to the stream: https://funprog.zulipchat.com/#narrow/stream/216942-Polysemy I would recommend trying to build smaller working programs first, then extending those with your app code. runInputT $ runFinal @(InputT IO) $ embedFinal $ pure () Then try embedding an In order to convert an And lots of type annotations are very helpful! |
thanks that was super helpful.
so then I try to add my log effect
but the logToIO interpreter adds a constraint (Embed IO) not visible in testLoop and so the compiler complains about Embed IO not being interpreted ("No instance for (Find (Embed IO) '[]) arising from a use of ‘logToIO"/"Unhandled effect 'Embed IO'") .
|
oh right, I thought the equivalent of Wouldn't be surprised if you'd need to add type applications there. |
I am happy to announce the end of my quest:
works. Now it seems that in my architecture
DefaultMembers must be the union of the effects of the different entries, if I forget one effect in default member, the ocmpiler complains. I had thought that maybe it could deduce the correct hashmap value type by itself ? |
awesome!! If you wanted each entry to have a separate list of |
yes you understood me correctly. Didn't know about dependant map but this looks overkill. As you say the commands shall be called only from inputLoop so implementing Command as an effect should be doable. Once again thanks a lot @tek ! |
I'd still highly recommend you try finding us on Zulip! |
haha I am on the zulip already (stalking). This week was too busy to interact but soon for sure. |
Hi,
I've spent the WE converting my MTL-based prototype to polysemy and I love it. Makes much more sense and has been a pleasure to work with (minus the polysemy plugin panics).
I am trying to use haskeline to write some REPL (code is not public but I could eventually make it public) and so I call my effects
runCache . logToIO
frommain
with:This generates the error
and now I wonder how to work around this issue. I've seen polysemy-research/polysemy-zoo#61 but it's a bit too meta for me.
The text was updated successfully, but these errors were encountered: