diff options
| author | Anton Trunov | 2018-11-27 12:17:47 +0100 |
|---|---|---|
| committer | Anton Trunov | 2018-12-04 12:43:20 +0100 |
| commit | 8c82657e7692049dde4a4c44a2ea53d0c4fa7cb5 (patch) | |
| tree | c973a8517cb257f127c60299e86d3f553ba51462 /mathcomp/ssreflect/eqtype.v | |
| parent | add6e85884691faef1bf8742e803374815672cc2 (diff) | |
Document parameter names whenever possible
As suggested by @ggonthier
[here](https://github.com/math-comp/math-comp/pull/249#pullrequestreview-177938295)
> One of the design ideas for the `Arguments` command was that it would allow
to centralise the documentation of the application of constants.
In that spirit it would be in my opinion better to make as much use of this
as possible, and to document the parameter names whenever possible,
especially that of implicit parameters.
and
[here](https://github.com/math-comp/math-comp/pull/253#discussion_r237434163):
> As a general rule, defined functional constants should have maximal prenex
implicit arguments, as this facilitates their use as arguments to functionals,
because this mimics the way function constants are treated in functional
programming languages with Hindley-Milner type inference. Conversely, lemmas and
theorems should have on-demand implicit arguments, possibly interspersed with
explicit ones, as it's fairly common for other lemmas to have universally
quantified premises; also, this makes it easier to specify such arguments with
the apply: tactic. This policy may be amended for lemmas that are used as
functional arguments, such as reflection or cancellation lemmas. Unfortunately
there is currently no easy way to tell Coq to use different defaults for
definitions and lemmas, so MathComp sticks to the on-demand default, as there
are significantly more lemmas than definition, and use the Prenex Implicits to
redress matters in bulk for definitions. However, this is not completely
systematic, and is sometimes omitted for constants that are not used as
functional arguments in the library, or inside the sections in which the
definition occur, since such commands need to be repeated after the section is
closed. Since Arguments commands should document the intended constant usage as
best as possible, they should follow the implicits policy - even in cases such
as this where the Prenex Implicits had been skipped.
Diffstat (limited to 'mathcomp/ssreflect/eqtype.v')
| -rw-r--r-- | mathcomp/ssreflect/eqtype.v | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mathcomp/ssreflect/eqtype.v b/mathcomp/ssreflect/eqtype.v index 4487ab4..7473ed7 100644 --- a/mathcomp/ssreflect/eqtype.v +++ b/mathcomp/ssreflect/eqtype.v @@ -460,7 +460,7 @@ Notation "x |-> y" := (FunDelta x y) format "'[hv' x '/ ' |-> y ']'") : fun_delta_scope. Delimit Scope fun_delta_scope with FUN_DELTA. -Arguments app_fdelta _ _%type _%FUN_DELTA _ _. +Arguments app_fdelta {aT rT%type} df%FUN_DELTA f z. Notation "[ 'fun' z : T => F 'with' d1 , .. , dn ]" := (SimplFunDelta (fun z : T => @@ -603,7 +603,7 @@ Arguments vrefl_rect {T P}. Arguments clone_subType [T P] U v [sT] _ [c Urec cK]. Arguments insub {T P sT}. Arguments insubT [T] P [sT x]. -Arguments val_inj {T P sT}. +Arguments val_inj {T P sT} [x1 x2]. Prenex Implicits val insubd. Local Notation inlined_sub_rect := @@ -779,7 +779,7 @@ Proof. by case/andP. Qed. End ProdEqType. -Arguments pair_eq {T1 T2} _ _ /. +Arguments pair_eq {T1 T2} u v /. Arguments pair_eqP {T1 T2}. Definition predX T1 T2 (p1 : pred T1) (p2 : pred T2) := @@ -805,7 +805,7 @@ Canonical option_eqType := Eval hnf in EqType (option T) option_eqMixin. End OptionEqType. -Arguments opt_eq {T} !_ !_. +Arguments opt_eq {T} !u !v. Section TaggedAs. @@ -851,7 +851,7 @@ Proof. by rewrite -tag_eqE /tag_eq eqxx tagged_asE. Qed. End TagEqType. -Arguments tag_eq {I T_} !_ !_. +Arguments tag_eq {I T_} !u !v. Arguments tag_eqP {I T_ x y}. Section SumEqType. @@ -875,5 +875,5 @@ Lemma sum_eqE : sum_eq = eq_op. Proof. by []. Qed. End SumEqType. -Arguments sum_eq {T1 T2} !_ !_. +Arguments sum_eq {T1 T2} !u !v. Arguments sum_eqP {T1 T2 x y}. |
