Array iterator #
This module provides an iterator for arrays that is accessible via Array.iterM
.
The underlying state of a list iterator. Its contents are internal and should not be used by downstream users of the library.
- array : Array α
Internal implementation detail of the iterator library.
- pos : Nat
Internal implementation detail of the iterator library.
Instances For
- Std.Iterators.instFiniteArrayIterator
- Std.Iterators.instIteratorArrayIteratorOfPure
- Std.Iterators.instIteratorCollectArrayIteratorOfMonad
- Std.Iterators.instIteratorCollectPartialArrayIteratorOfMonad
- Std.Iterators.instIteratorLoopArrayIteratorOfMonad
- Std.Iterators.instIteratorLoopPartialArrayIteratorOfMonad
- Std.Iterators.instIteratorSizeArrayIterator
- Std.Iterators.instIteratorSizePartialArrayIterator
Returns a finite monadic iterator for the given array starting at the given index. The iterator yields the elements of the array in order and then terminates.
The pure version of this iterator is Array.iterFromIdx
.
Termination properties:
Finite
instance: alwaysProductive
instance: always
Equations
- array.iterFromIdxM m pos = Std.Iterators.toIterM { array := array, pos := pos } m α
Returns a finite monadic iterator for the given array. The iterator yields the elements of the array in order and then terminates. There are no side effects.
The pure version of this iterator is Array.iter
.
Termination properties:
Finite
instance: alwaysProductive
instance: always
Equations
- array.iterM m = array.iterFromIdxM m 0
Equations
- One or more equations did not get rendered due to their size.