-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Async Type Checking #136
Comments
This is an interesting idea. Please tinker. :) |
An alternative to having a new definition function would be to annotate a type w/ an |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I propose we support a new function
defAsync
that merely states the result is an asynchronous value (we could parameterize what an async result looks like).Why?
If the user can tell sanctuary-def that a function is async, it could open up this library to moving type checking to a worker thread (in the browser), or a child process (in node). It gives sanctuary-def permission to do exhaustive checks on recursive types or complex constraints without blowing the stack, simply by recurring asynchronously.
If we can move type checking off the main thread, we could keep type checking on in production without experiencing jank in the UI.
We'd also potentially allow sanctuary-def to give us better verification of async results, by allowing sanctuary-def to traverse async results when they eventually arrive.
I'd be happy to tinker with this on another branch if it seems like something we may want. Even if doesn't work out, it could be an interesting experiment.
The text was updated successfully, but these errors were encountered: