@@ -411,8 +411,8 @@ It simply iterates using `IteratorLoopPartial` and counts the elements.
411411For certain iterators, more efficient implementations are possible and should be used instead.
412412-/
413413@[always_inline, inline]
414- instance IteratorSize.Partial .defaultImplementation {α β : Type w} {m : Type w → Type w'} [Monad m]
415- [Iterator α m β] [Finite α m] [ IteratorLoopPartial α m m] :
414+ instance IteratorSizePartial .defaultImplementation {α β : Type w} {m : Type w → Type w'} [Monad m]
415+ [Iterator α m β] [IteratorLoopPartial α m m] :
416416 IteratorSizePartial α m where
417417 size := IterM.DefaultConsumers.sizePartial
418418
@@ -422,6 +422,10 @@ are caused by calling `size`, and if the monad is nondeterministic, it is also u
422422returned value should be. The reference implementation, `IteratorSize.defaultImplementation`,
423423simply iterates over the whole iterator monadically, counting the number of emitted values.
424424An `IteratorSize` instance is considered lawful if it is equal to the reference implementation.
425+
426+ **Performance** :
427+
428+ Default performance is linear in the number of steps taken by the iterator.
425429-/
426430@[always_inline, inline]
427431def IterM.size {α : Type } {m : Type → Type w'} {β : Type } [Iterator α m β] [Monad m]
@@ -439,6 +443,10 @@ An `IteratorSize` instance is considered lawful if it is equal to the reference
439443
440444This is the partial version of `size`. It does not require a proof of finiteness and might loop
441445forever. It is not possible to verify the behavior in Lean because it uses `partial`.
446+
447+ **Performance** :
448+
449+ Default performance is linear in the number of steps taken by the iterator.
442450-/
443451@[always_inline, inline]
444452def IterM.Partial.size {α : Type } {m : Type → Type w'} {β : Type } [Iterator α m β] [Monad m]
0 commit comments