Documentation

Init.Data.Iterators.Producers.Monadic.List

List iterator #

This module provides an iterator for lists that is accessible via List.iterM.

The underlying state of a list iterator. Its contents are internal and should not be used by downstream users of the library.

Instances For
    theorem Std.Iterators.Types.ListIterator.ext {α : Type w} {x y : ListIterator α} (list : x.list = y.list) :
    x = y
    @[inline]
    def List.iterM {α : Type w} (l : List α) (m : Type w → Type w') [Pure m] :

    Returns a finite iterator for the given list. The iterator yields the elements of the list in order and then terminates.

    The non-monadic version of this iterator is List.iter.

    Termination properties:

    • Finite instance: always
    • Productive instance: always
    Equations
      Instances For
        @[inline]
        instance Std.Iterators.Types.ListIterator.instIterator {m : Type w → Type w'} {α : Type w} [Pure m] :
        Equations
          @[inline]
          instance Std.Iterators.Types.ListIterator.instIteratorLoop {m : Type w → Type w'} {α : Type w} [Monad m] {n : Type x → Type x'} [Monad n] :
          Equations