Skip to content

Commit 875e007

Browse files
feat: start work on iterators and ranges (#672)
Co-authored-by: Paul Reichert <[email protected]>
1 parent 824b2b9 commit 875e007

File tree

15 files changed

+1963
-11
lines changed

15 files changed

+1963
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
- name: Run LinkChecker (local links only)
223223
if: github.event_name == 'push' || github.event_name == 'pull_request'
224224
run: |
225-
linkchecker './_out/html-multi/'
225+
linkchecker --config=.linkchecker/linkcheckerrc './_out/html-multi/'
226226
227227
# This saved number is used by a workflow_run trigger. It
228228
# manages labels that indicate the status of the built HTML.

.linkchecker/linkcheckerrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[filtering]
2+
ignorewarnings=url-content-too-large,url-too-long

Manual.lean

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Manual.Simp
2020
import Manual.Grind
2121
import Manual.VCGen
2222
import Manual.BasicTypes
23+
import Manual.Iterators
2324
import Manual.BasicProps
2425
import Manual.NotationsMacros
2526
import Manual.IO
@@ -118,6 +119,7 @@ draft := true
118119

119120
{docstring Dynamic.get?}
120121

122+
{include 0 Manual.Iterators}
121123

122124
# Standard Library
123125
%%%
@@ -345,6 +347,32 @@ Std.ExtHashSet
345347
Std.TreeMap
346348
Std.DTreeMap
347349
Std.TreeSet
350+
Std.Iterators
351+
Std.Iterators.Iter
352+
Std.Iterators.Iter.Equiv
353+
Std.Iterators.Iter.TerminationMeasures
354+
Std.Iterators.IterM
355+
Std.Iterators.IterM.Equiv
356+
Std.Iterators.IterM.TerminationMeasures
357+
Std.Iterators.Iterator
358+
Std.Iterators.IteratorAccess
359+
Std.Iterators.IteratorLoop
360+
Std.Iterators.IteratorLoopPartial
361+
Std.Iterators.Finite
362+
Std.Iterators.Productive
363+
Std.Iterators.PostconditionT
364+
Std.Iterators.HetT
365+
Std.PRange
366+
Std.PRange.UpwardEnumerable
367+
Std.Rco
368+
Std.Rcc
369+
Std.Rci
370+
Std.Roo
371+
Std.Roc
372+
Std.Roi
373+
Std.Rio
374+
Std.Ric
375+
Std.Rii
348376
```
349377

350378
```exceptions
@@ -836,6 +864,17 @@ Prod.lex
836864
Prod.Lex
837865
```
838866

867+
```exceptions
868+
Std.Iterators.Iter.instForIn'
869+
Std.Iterators.Iter.step_filter
870+
Std.Iterators.Iter.val_step_filter
871+
```
872+
873+
```exceptions
874+
Std.Iterators.IterM.instForIn'
875+
Std.Iterators.IterM.toListRev.go
876+
```
877+
839878
```exceptions
840879

841880
Lean.Elab.Tactic.elabSetOption

Manual/BasicTypes.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Manual.BasicTypes.List
2525
import Manual.BasicTypes.Maps
2626
import Manual.BasicTypes.Subtype
2727
import Manual.BasicTypes.Thunk
28+
import Manual.BasicTypes.Range
2829

2930
open Manual.FFIDocType
3031

@@ -319,6 +320,8 @@ Most comparisons on Booleans should be performed using the {inst}`DecidableEq Bo
319320

320321
{include 0 Manual.BasicTypes.ByteArray}
321322

323+
{include 0 Manual.BasicTypes.Range}
324+
322325
{include 0 Manual.BasicTypes.Maps}
323326

324327
{include 0 Manual.BasicTypes.Subtype}

Manual/BasicTypes/Array.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,14 @@ tag := "array-api"
336336

337337
## Iteration
338338

339+
{docstring Array.iter}
340+
341+
{docstring Array.iterFromIdx}
342+
343+
{docstring Array.iterM}
344+
345+
{docstring Array.iterFromIdxM}
346+
339347
{docstring Array.foldr}
340348

341349
{docstring Array.foldrM}

Manual/BasicTypes/List.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ tag := "list-api-reference"
254254

255255
## Iteration
256256

257+
{docstring List.iter}
258+
259+
{docstring List.iterM}
260+
257261
{docstring List.forA}
258262

259263
{docstring List.forM}

Manual/BasicTypes/Maps.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,12 @@ $_ ~m $_
449449

450450
## Iteration
451451

452+
{docstring Std.HashMap.iter}
453+
454+
{docstring Std.HashMap.keysIter}
455+
456+
{docstring Std.HashMap.valuesIter}
457+
452458
{docstring Std.HashMap.map}
453459

454460
{docstring Std.HashMap.fold}
@@ -571,6 +577,12 @@ $_ ~m $_
571577

572578
## Iteration
573579

580+
{docstring Std.DHashMap.iter}
581+
582+
{docstring Std.DHashMap.keysIter}
583+
584+
{docstring Std.DHashMap.valuesIter}
585+
574586
{docstring Std.DHashMap.map}
575587

576588
{docstring Std.DHashMap.fold}
@@ -812,6 +824,8 @@ $_ ~m $_
812824

813825
## Iteration
814826

827+
{docstring Std.HashSet.iter}
828+
815829
{docstring Std.HashSet.all}
816830

817831
{docstring Std.HashSet.any}
@@ -972,6 +986,12 @@ The declarations in this section should be imported using `import Std.DTreeMap`.
972986

973987
## Iteration
974988

989+
{docstring Std.DTreeMap.iter}
990+
991+
{docstring Std.DTreeMap.keysIter}
992+
993+
{docstring Std.DTreeMap.valuesIter}
994+
975995
{docstring Std.DTreeMap.map}
976996

977997
{docstring Std.DTreeMap.foldl}

Manual/BasicTypes/Maps/TreeMap.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ The declarations in this section should be imported using `import Std.TreeMap`.
219219

220220
# Iteration
221221

222+
{docstring Std.TreeMap.iter}
223+
224+
{docstring Std.TreeMap.keysIter}
225+
226+
{docstring Std.TreeMap.valuesIter}
227+
222228
{docstring Std.TreeMap.map}
223229

224230
{docstring Std.TreeMap.all}

Manual/BasicTypes/Maps/TreeSet.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ tag := "TreeSet"
127127

128128
# Iteration
129129

130+
{docstring Std.TreeSet.iter}
131+
130132
{docstring Std.TreeSet.all}
131133

132134
{docstring Std.TreeSet.any}

0 commit comments

Comments
 (0)