-
Notifications
You must be signed in to change notification settings - Fork 788
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
[RFC FS-1071] Witnesses passing for trait-constraints w.r.t. quotations #6345
Conversation
@cartermp @KevinRansom @TIHan One specific motivation for fixing this core problem with quotations is the need to use quotations more heavily in any future evolution of the "F# for AI models" prototype I've been involved in. |
What does the term "witness" mean in this case? |
A witness is the lambda term that represents the solution to an SRTP constraint. For example, if you use
Because this is only about quotations, you only actually see these witnesses by matching on the quotation using the new Each witness effectively records the resolution/implementation of a trait constraint in quotations and/or compiled code. (note passing implicit witnesses is the standard technique for implementing Haskell type classes) |
Closed in favour of #6810 from feature branch |
Implementation for RFC FS-1071 - Witness passing for quotations using SRTP-constrained functions and methods
F# quotations of code using SRTP constraint trait calls don't contain sufficient information to represent the semantic intent of the code. Specifically the quotations are missing any record of the resolution of SRTP constraints or how to execute constraint calls.
This RFC addresses this problem by incorporating the necessary information into both quotations and the code laid down for dynamic interpretation of quotations.
TODO
let inline
functions that utilise witnesses (currently no witness arguments are bound in the generated lambda and there is no representation for the utilization of the witness. Needs new LambdaWithWitnesses to detect the witnesses)