Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Manual/Classes/InstanceDecls.lean
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Instances for recursive inductive types are common, however.
There is a standard idiom to work around this limitation: define a recursive function independently of the instance, and then refer to it in the instance definition.
By convention, these recursive functions have the name of the corresponding method, but are defined in the type's namespace.

::: example "Instances are not recursive"
:::example "Instances are not recursive"
Given this definition of {lean}`NatTree`:
```lean
inductive NatTree where
Expand Down Expand Up @@ -153,7 +153,7 @@ def NatTree.beq : NatTree → NatTree → Bool
| .leaf, .leaf =>
true
| .branch l1 v1 r1, .branch l2 v2 r2 =>
l1 == l2 && v1 == v2 && r1 == r2
NatTree.beq l1 l2 && v1 == v2 && NatTree.beq r1 r2
| _, _ =>
false
```
Expand Down
10 changes: 5 additions & 5 deletions Manual/Meta/Example.lean
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def getLeanBlockContents? : TSyntax `block → DocElabM (LeanBlockContent)
| `(block|```$nameStx:ident $args*|$contents:str```) => do
let name ← realizeGlobalConstNoOverload nameStx
if name == ``Manual.imports then
return {content := some contents.getString, shouldElab := false}
return { content := some contents.getString, shouldElab := false }
if name != ``Verso.Genre.Manual.InlineLean.lean then
return {content := none, shouldElab := false}
return { content := none, shouldElab := false }
let args ← Verso.Doc.Elab.parseArgs args
let args ← parseThe InlineLean.LeanBlockConfig args
if !args.keep || args.error then
return {content := none, shouldElab := true}
pure <| {content := some contents.getString, shouldElab := true}
| _ => pure {content := none, shouldElab := false}
return { content := none, shouldElab := true }
pure <| { content := some contents.getString, shouldElab := true }
| _ => pure { content := none, shouldElab := false }

/--
Elaborates all Lean blocks first, enabling local forward references
Expand Down