Documentation

Init.Data.Iterators.ToIterator

This module provides the typeclass ToIterator, which is implemented by types that can be converted into iterators.

class Std.Iterators.ToIterator (γ : Type u) (m : Type w → Type w') (α β : outParam (Type w)) :
Type (max u w)

This typeclass provides an iterator for elements of type γ.

  • iterMInternal (x : γ) : IterM m β
Instances
    @[inline]
    def Std.Iterators.ToIterator.iterM {γ : Type u_1} {m : Type u_2 → Type u_3} {α β : Type u_2} (x : γ) [ToIterator γ m α β] :
    IterM m β

    Converts x into a monadic iterator.

    Equations
    Instances For
      @[inline]
      def Std.Iterators.ToIterator.iter {γ : Type u_1} {α β : Type u_2} [ToIterator γ Id α β] (x : γ) :
      Iter β

      Converts x into a pure iterator.

      Equations
      Instances For
        @[inline]
        def Std.Iterators.ToIterator.ofM {γ : Type u_1} {m : Type w → Type u_2} {β : Type w} (α : Type w) (iterM : γIterM m β) :
        ToIterator γ m α β

        Creates a monadic ToIterator instance.

        Equations
        Instances For
          @[inline]
          def Std.Iterators.ToIterator.of {γ : Type u_1} {β : Type w} (α : Type w) (iter : γIter β) :
          ToIterator γ Id α β

          Creates a pure ToIterator instance.

          Equations
          Instances For
            theorem Std.Iterators.ToIterator.iterM_eq {γ : Type u} {α β : Type v} {it : γIterM Id β} {x : γ} :
            iterM x = it x

            Replaces ToIterator.iterM with its definition.

            theorem Std.Iterators.ToIterator.iter_eq {γ : Type u} {x : γ} {α β : Type v} {it : γIterM Id β} :
            iter x = (it x).toIter

            Replaces ToIterator.iter with its definition.