-
Notifications
You must be signed in to change notification settings - Fork 13
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
Lazy state: doesn't work in non-operation function arguments #745
Comments
Is it correct to say that all exposed adaptor functions have arguments that can be callbacks which get called with state? |
@doc-han not all adaptor functions uses expandReferences. |
Alright, thanks @mtuchi Apart from them, and callbacks that are actually state callback like the one from I've been through most adaptors and so far they seem to use expandReferences. will be glad knowing the ones that don't(happy if not many). |
Notes from our call to resolve this issue:
I don't want to do import tracking (yet) because it's still too hard to know which imports are operations We will not relax the So we don't support this:
Some notes about nested state
|
@josephjclark there's a problem with the example I provided during the call Currently
Our current ticket is around fixing 2 and we agreed walking to the top call-expression will do the trick but then, that breaks 1. With adaptor functions, we want to wrap inside the argument not around the function. After a fix
2 get's fixed but then 1 get's broken. Problem.When a function call is an argument to a top-level function call. We don't know whether it's an adaptor function or not.
|
Great catch @doc-han. Damn and blast. I didn't expect this to be such a difficult issue! So we're sort of back to: walk up to the owning operation function and wrap that. But of course we don't have a good way of knowing what an Operation is 🤦 |
So to make this consistent we're just going to have to have a clear rule. The rule could be: lazy state resolves to the nearest function, and you the human need to ensure that the nearest function is an operation. Which is how it works now, right? And I think that covers all the other expression cases, which all resolve to the top operation
I think this works, it's just a question of getting the language right/ Which sounds like a problem for me 😢 |
This:
Compiles to this:
Which is wrong. We needed to walk a bit higher up the try to work out where to put the wrapping function.
Should be:
The text was updated successfully, but these errors were encountered: