Array iterator #
This module provides an iterator for arrays that is accessible via Array.iterM.
@[match_pattern, inline]
def Array.iterFromIdxM {α : Type w} (array : Array α) (m : Type w → Type w') (pos : Nat) [Pure m] :
Std.IterM m α
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:
Finiteinstance: alwaysProductiveinstance: always
Instances For
@[inline]
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:
Finiteinstance: alwaysProductiveinstance: always
Equations
- array.iterM m = array.iterFromIdxM m 0
Instances For
@[instance_reducible, inline]
instance Std.Iterators.Types.ArrayIterator.instIterator {m : Type w → Type w'} {α : Type w} [Pure m] :
Iterator (ArrayIterator α) m α
Equations
- One or more equations did not get rendered due to their size.
instance Std.Iterators.Types.ArrayIterator.instFinite {α : Type w} {m : Type w → Type w'} [Pure m] :
Finite (ArrayIterator α) m
@[instance_reducible, inline]
instance Std.Iterators.Types.ArrayIterator.instIteratorLoop {m : Type w → Type w'} {α : Type w} [Monad m] {n : Type x → Type x'} [Monad n] :
IteratorLoop (ArrayIterator α) m n