Closed noamz closed 8 years ago
Nevermind, from your thesis it's pretty clear that that's exactly what's going on: the expressions f true
and g true
are inferrable terms, so they synthesize sorts, and Cidre just has to check that those sorts are subsorts of the annotations.
Consider:
Naturally, the unsafe annotation
fails <: true ref & bool ref
fails...but I was a bit surprised that the safe annotation
passes <: true list & bool list
passes the sort-checker, even though the definition ofpasses
syntactically violates the value restriction.Is there a simple explanation for what exactly Cidre is doing? I guess it probably has something to do with the fact that the sort
true list
(which can be synthesized for the applicationf true
) is a subsort oftrue list & bool list
, but the sorttrue ref
is not a subsort oftrue ref & bool ref
?