-
Notifications
You must be signed in to change notification settings - Fork 126
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
Type schema shown with :t
doesn't match the declaration
#522
Comments
Here's an even weirder one:
|
Argh, this is just wrong, the |
This alleviates some of the problems in #522
Ok, so I fixed some of the issues (you shouldn't see What's happening is that when we check a definition with a signature, after we are done checking things, we apply a substitution to the inferred signatures (so that we can fill in This automatic simplification on substitution is quite convenient, but perhaps we should try to separate the two, although we'd have to work out some invariants about when to simplify things. |
If the signature has no underscores, then the substitution applied at the end would be empty, wouldn't it? If so, then couldn't we just skip doing the substitution in that case? |
Yes, we could do that. The constraints would still get simplified in some cases (i.e., when there are |
Ok, so it is a more tricky than I thought, as we also normalize types when we kind check them (i.e., when they are imported from the parsed to the typechecker AST). We do this, so that things are always in the normal form we expect when we write simplification rules. While this makes sense, perhaps this normalization should happen at a different time, but the change is non-trivial, so I'll leave this open for now. |
Should we just decide that type signatures will always be normalized, and mark this one as |
If a Cryptol file contains a declaration with an explicit signature, I would expect
:t
to show the exact same signature. However, it seems that there is some preprocessing going on. For exampleGranted, these new type signatures are logically equivalent to the ones I provided; but I still find this quite surprising. Is this intended behavior?
The text was updated successfully, but these errors were encountered: