difficulty with a polymorphic effect handler #488
-
i've been failing to get a handler for a polymorphic effect to compile... here's some elided code, with just the dependencies of the failing function (full code here ) (the code is a 🚧 work-in-progress 🚧 attempt at a functional-core message-processing pattern, with introspection logging and recovery)
i get an error against the
as far as i can see from the error the any help greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I haven't looked at it too closely, but the following two alternatives type-check fine: Most likely you are trying to resume after running this part of the chain, but as written your operations do not resume. You can either add the resume, or swap
Or if you are trying to not resume, and just want to jump out of the computation and return from the handler here, the issue is that
|
Beta Was this translation helpful? Give feedback.
I haven't looked at it too closely, but the following two alternatives type-check fine:
Most likely you are trying to resume after running this part of the chain, but as written your operations do not resume. You can either add the resume, or swap
ctl
andresume
for afun
operation since it is tail resumptive. Note that you can use the more restrictivefun
operation here even if you want to keep the effect itself more flexible by allowing anyctl
operation.