-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create stuck bindings for fun and profit (type errors, postulates) #132
base: master
Are you sure you want to change the base?
Conversation
cf9f60e
to
f82c0e1
Compare
This seems to work.
Automating this test depends on #94, but I could add files to Then, I turned cons1 into a postulate, and the code compiled with no error. However, because of limitations of the parser support, I needed to desugar by hand the telescope:
However, the limitation is trivial to fix, since postulates reuse the code for bindings (and just omit the body). |
Untested. This is a close variant to Tillmann's proposal in Toxaris#98.
Tillmann suggested writing `recover` in terms of `recoverWith`, but that requires changing more code, and it was not fully obvious to me how to do those changes.
Follow more closely Tillmann's pseudocode. Instead of generating a typed variable by hand (duplicating typechecker logic/using a not fully documented API), and then get from it a value (by evaluation), a type and a sort, just generate an untyped value by hand (which is easier), and pass the expected type/sort separately. I'll admit these conditionals in the needed code are slightly more complex, but I guess they're OK. Also, the variable names in the new code are not single letters, which is somewhat inconsistent (but then, I don't get the old names anyway).
Declarations without type annotations are going to be well-sorted in *some* PTS, which might be bigger than the one considered. Hence call checkProperType there anyway. This finally achieves the consistency discussed in Toxaris#98.
This is just (the semantics of) Proposal 1 (with a twist), based on the code for Bind. No test added yet.
That's convenient when refactoring a binding to a postulate, and since postulates reuse code for bindings, it's also trivial to support. For instance, now we can turn: > cons1 (A B : *) : A -> B -> Pair1 A B = ...; into: > postulate cons1 (A B : *) : A -> B -> Pair1 A B;
dd3d30d
to
eca9624
Compare
Add filepath explicitly for the tests as well (even though elsewhere it's implied by the pts library).
Files are shown in testing output only if they contain assertions (which seems unfortunate), so add some now.
Just rebased on top of master (also to fix merge conflicts). |
As suggested in 5d34f40 Reindenting/renaming deferred.
In response to 59a0613#commitcomment-9673662
As requested in 3d98ef5
examples/
.