-
Notifications
You must be signed in to change notification settings - Fork 0
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
Plan for linear implicit arguments #10
Comments
Some observations from today:
For the last point, I was thinking doing something like piggybacking on the usage environment to produce, at the same time, a formula whose atoms are holes, and connectives are +, sup, scaling, and probably some binding (for |
To expand on your last point, consider this function:
The elaborator first replaces the calls to
The
which uses the given evidence twice, and thus fails. This gets more complicated in the following case:
Here, the implicit argument is used correctly in both branches. So, we first generate the holes
which, again, get solved by the constraint solver:
The constraint solver is completely oblivious to the shape of the program where the constraints originate from, and so the naive check erroneously blows up here. So, an idea is to come up with a formula during constraint generation that properly records the hierarchy of the term. |
f :: A -> B
f’ :: A ->. B
h :: A ->. B -> B
g :: (?x :: A) =>. Bool -> B
g True = h ?x (let ?x = a in f ?x)
g False = f’ ?x Here is an example of something which ought to work but illustrate many of the difficulties. |
Examples which need to fail: f :: A -> B
f’ :: A ->. B
h :: A ->. B -> B
g :: (?x :: A) =>. Bool -> B
g _ = f ?x
g' :: (?x :: A) =>. Bool -> B
g' True = f ?x
g' False = f’ ?x |
In order to isolate the
OutsideIn
part constraint solving from the type-class resolution. Let's start with doing linear implicit arguments.The steps to try and reach, in order, or how complex we expect them to be are:
(?x, ?x)
). Throws a type error.The text was updated successfully, but these errors were encountered: