Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[RFC FS-1071] Witnesses passing for trait-constraints w.r.t. quotations #6345
Conversation
dsyme
added some commits
Mar 15, 2019
dsyme
added
the
Candidate for F# vNext
label
Mar 20, 2019
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
What does the term "witness" mean in this case? |
This comment has been minimized.
This comment has been minimized.
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) |
dsyme commentedMar 20, 2019
•
edited
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 inlinefunctions 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)