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

Clarify the type of Fn's jvp field #109

Open
samestep opened this issue Sep 20, 2023 · 0 comments
Open

Clarify the type of Fn's jvp field #109

samestep opened this issue Sep 20, 2023 · 0 comments

Comments

@samestep
Copy link
Contributor

As of #105, the Fn type exposes a jvp field which is currently only meant to be used for setting a custom JVP on a function; to actually use the JVP, one is meant to instead call the jvp function exported by Rose. This can be confusing, since if you have f: Fn then it can seem quite natural to call f.jvp since TypeScript says it's defined; but right now that just gives undefined. Probably the right way to deal with this is to remove the jvp field from the Fn type itself since that type doesn't have enough information to say what kind of function it is, and instead put it directly into the types of things like fn and opaque that return Fns.

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

No branches or pull requests

1 participant