Skip to content

Commit 00bb847

Browse files
feat: improve description of instance implicits (#218)
Closes #193
1 parent 180f0b7 commit 00bb847

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Manual/Terms.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ The {keywordOf Lean.Parser.Term.fun}`=>` may be replaced by {keywordOf Lean.Pars
382382
Function abstractions may also use pattern matching syntax as part of their parameter specification, avoiding the need to introduce a local variable that is immediately destructured.
383383
This syntax is described in the {ref "pattern-fun"}[section on pattern matching].
384384

385-
## Implicit Functions
385+
## Implicit Parameters
386386
%%%
387387
tag := "implicit-functions"
388388
%%%
@@ -407,7 +407,10 @@ Implicit parameters come in three varieties:
407407
: Instance implicit parameters
408408

409409
Arguments for {deftech}_instance implicit_ parameters are found via {ref "instance-synth"}[type class synthesis].
410-
Instance implicit parameters are written in square brackets (`[` and `]`), and in most cases omit the parameter name because instances synthesized as parameters to functions are already available in the functions' bodies, even without being named explicitly.
410+
Instance implicit parameters are written in square brackets (`[` and `]`).
411+
Unlike the other kinds of implicit parameter, instance implicit parameters that are written without a `:` specify the parameter's type rather than providing a name.
412+
Furthermore, only a single name is allowed.
413+
Most instance implicit parameters omit the parameter name because instances synthesized as parameters to functions are already available in the functions' bodies, even without being named explicitly.
411414

412415
::::keepEnv
413416
:::example "Ordinary vs Strict Implicit Parameters"

0 commit comments

Comments
 (0)