Documentation

Init.Data.Range.Polymorphic.RangeIterator

@[unbox]
structure Std.Rxc.Iterator (α : Type u) :

Internal state of the range iterators. Do not depend on its internals.

  • next : Option α
  • upperBound : α
Instances For
    @[inline]

    The pure function mapping a range iterator of type IterM to the next step of the iterator.

    This function is prefixed with Monadic in order to disambiguate it from the version for iterators of type Iter.

    Instances For
      @[inline]
      def Std.Rxc.Iterator.step {α : Type u} [PRange.UpwardEnumerable α] [LE α] [DecidableLE α] (it : Iter α) :
      IterStep (Iter α) α

      The pure function mapping a range iterator of type Iter to the next step of the iterator.

      Instances For
        theorem Std.Rxc.Iterator.isPlausibleStep_iff {α : Type u} [PRange.UpwardEnumerable α] [LE α] [DecidableLE α] {it : Iter α} {step : IterStep (Iter α) α} :
        @[implicit_reducible, inline]

        An efficient IteratorLoop instance: As long as the compiler cannot optimize away the Option in the internal state, we use a special loop implementation.

        @[inline]
        def Std.Rxc.Iterator.instIteratorLoop.loop {α : Type u} [PRange.UpwardEnumerable α] [LE α] [DecidableLE α] [PRange.LawfulUpwardEnumerable α] [PRange.LawfulUpwardEnumerableLE α] {n : Type u → Type w} [Monad n] (γ : Type u) (Pl : αγForInStep γProp) (LargeEnough : αProp) (hl : ∀ (a b : α), a bLargeEnough aLargeEnough b) (upperBound : α) (acc : γ) (next : α) (h : LargeEnough next) (f : (out : α) → LargeEnough outout upperBound(c : γ) → n (Subtype (Pl out c))) :
        n γ
        Instances For
          @[unbox]
          structure Std.Rxo.Iterator (α : Type u) :

          Internal state of the range iterators. Do not depend on its internals.

          • next : Option α
          • upperBound : α
          Instances For
            @[inline]

            The pure function mapping a range iterator of type IterM to the next step of the iterator.

            This function is prefixed with Monadic in order to disambiguate it from the version for iterators of type Iter.

            Instances For
              @[inline]
              def Std.Rxo.Iterator.step {α : Type u} [PRange.UpwardEnumerable α] [LT α] [DecidableLT α] (it : Iter α) :
              IterStep (Iter α) α

              The pure function mapping a range iterator of type Iter to the next step of the iterator.

              Instances For
                theorem Std.Rxo.Iterator.isPlausibleStep_iff {α : Type u} [PRange.UpwardEnumerable α] [LT α] [DecidableLT α] {it : Iter α} {step : IterStep (Iter α) α} :
                @[implicit_reducible, inline]

                An efficient IteratorLoop instance: As long as the compiler cannot optimize away the Option in the internal state, we use a special loop implementation.

                @[inline]
                def Std.Rxo.Iterator.instIteratorLoop.loop {α : Type u} [PRange.UpwardEnumerable α] [LT α] [DecidableLT α] [PRange.LawfulUpwardEnumerable α] {n : Type u → Type w} [Monad n] (γ : Type u) (Pl : αγForInStep γProp) (LargeEnough : αProp) (hl : ∀ (a b : α), PRange.UpwardEnumerable.LE a bLargeEnough aLargeEnough b) (upperBound : α) (acc : γ) (next : α) (h : LargeEnough next) (f : (out : α) → LargeEnough outout < upperBound(c : γ) → n (Subtype (Pl out c))) :
                n γ
                Instances For
                  @[unbox]
                  structure Std.Rxi.Iterator (α : Type u) :

                  Internal state of the range iterators. Do not depend on its internals.

                  Instances For
                    @[inline]

                    The pure function mapping a range iterator of type IterM to the next step of the iterator.

                    This function is prefixed with Monadic in order to disambiguate it from the version for iterators of type Iter.

                    Instances For
                      @[inline]

                      The pure function mapping a range iterator of type Iter to the next step of the iterator.

                      Instances For
                        @[implicit_reducible, inline]

                        An efficient IteratorLoop instance: As long as the compiler cannot optimize away the Option in the internal state, we use a special loop implementation.

                        @[inline]
                        def Std.Rxi.Iterator.instIteratorLoop.loop {α : Type u} [PRange.UpwardEnumerable α] [PRange.LawfulUpwardEnumerable α] {n : Type u → Type w} [Monad n] (γ : Type u) (Pl : αγForInStep γProp) (LargeEnough : αProp) (hl : ∀ (a b : α), PRange.UpwardEnumerable.LE a bLargeEnough aLargeEnough b) (acc : γ) (next : α) (h : LargeEnough next) (f : (out : α) → LargeEnough out(c : γ) → n (Subtype (Pl out c))) :
                        n γ
                        Instances For