We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here is the code from the book
Inductive phantom (T : Type) (p : T) := Phantom. Definition set_of (T : eqType) (_ : phantom Type (Equality.sort T)) := seq T. Notation "{ 'set' T }" := (set_of _ (Phantom Type T)) (at level 0, format "{ ’set’ T }") : type_scope.
Since the book recommends the setting Set Implicit Arguments. which will make many arguments here implicit, therefore this code will not work
Set Implicit Arguments.
Here is a version that write out all the argument explicitly, which will pass the type checking
Inductive phantom (T : Type) (p : T) := Phantom. Definition set_of (T : eqType) (_ : @phantom Type (Equality.sort T)) := seq T. Notation "{ 'set' T }" := (@set_of _ (@Phantom Type T)) (at level 0, format "{ 'set' T }") : type_scope. (*Some examples*) Check {set nat}. Check [:: 1]: {set nat}.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is the code from the book
Since the book recommends the setting
Set Implicit Arguments.
which will make many arguments here implicit, therefore this code will not workHere is a version that write out all the argument explicitly, which will pass the type checking
The text was updated successfully, but these errors were encountered: