-
Notifications
You must be signed in to change notification settings - Fork 235
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
Behavior of inferred effect arguments without val
#581
Comments
Default effects are slippery. I made an attempt to remove all default effects a while back, but I failed because it seems our code heavily relies on at least I am leaning towards establishing that as the official default effects convention. We're close to having that behavior currently, except we do not properly detect when a computation has a type that has been annotated. For example, should this computation be considered to have an annotated type-and-effect?
I would argue "yes", this computation has been annotated as Happy to discuss further. |
Thanks for clarifying this. Shouldn't |
My point was that we have no default effects aside from Tot and GTot. The fact that t -> s is interpreted as t -> ML s is orthogonal |
I see. That's exactly the source of my confusion: that I guess you don't want to make |
In discussions with @protz, we were considering changing Perhaps this will clear some of the confusion, given that That way, the default effect annotation and default inferred effect will coincide. But, changing |
That would be a solution, although losing compatibility with OCaml is unfortunate. Why is it a bad idea to infer an effect instead of using |
Well, one main reason the F* implementation is tractable is that we lack effect polymorphism. What would you infer for the type of
Without resorting to our defaults, we'd have to generalize an effect variable. And the cat's out the bag ... |
I'm a big fan of having soundness and purity be the default, so I think this change would be awesome. I think the only place where ML compatibility actually matters is bootstrapping. But maybe we could have an extra flag there? Or maybe with |
@nikswamy just fixed this |
I was surprised to see that giving no
val
declaration isn't equivalent to giving one without refinements or effects, as illustrated in the example below.This isn't the case with
--stratified
. It was confusing for me and at least one other person run into this problem when playing withex1a-safe-read-write.fst
in the tutorial.Is this really the behaviour we want?
If we prefer to have a consistent behaviour, which one to choose?
The text was updated successfully, but these errors were encountered: