The only way to make a Definition
into an Instance
in one go is to fully write out the type of the instance.
E.g.
Class class := mk_class {}.
Instance works : class := mk_class.
Or with two commands, but without the need to annotate types:
Definition def := mk_class.
Existing Instance def.
I’m now wondering why this is not equivalent to
Instance inst := mk_class.
which does not even parse. The following also doesn’t work:
Fail Instance inst : _ := mk_class. (* The command has indeed failed with message:
?X1 is not a declared type class. *)
Is there a deeper reason behind this implementation choices? I would have expected Instance
to be a shortcut for Definition + Existing Instance
.