Documentation

Init.Data.Slice.Array.Iterator

This module implements an iterator for array slices (Subarray).

@[unbox]
structure SubarrayIterator (α : Type u) :
Instances For
    @[inline]
    def SubarrayIterator.step {α : Type u} {m : Type u → Type u_1} :
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[implicit_reducible]
      instance instForInSubarrayOfMonad {α : Type u} {m : Type v → Type w} [Monad m] :
      ForIn m (Subarray α) α
      Equations

      Without defining the following function Subarray.foldlM, it is still possible to call subarray.foldlM, which would be elaborated to Slice.foldlM (s := subarray). However, in order to maximize backward compatibility and avoid confusion in the manual entry for Subarray, we explicitly provide the wrapper function Subarray.foldlM for Slice.foldlM, providing a more specific docstring.

      @[inline]
      def Subarray.forIn {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (s : Subarray α) (b : β) (f : αβm (ForInStep β)) :
      m β

      The implementation of ForIn.forIn for Subarray, which allows it to be used with for loops in do-notation.

      Equations
      Instances For
        def Subarray.copy {α : Type u} (s : Subarray α) :

        Allocates a new array that contains the contents of the subarray.

        Equations
        Instances For
          @[implicit_reducible]
          instance instCoeSubarrayArray {α : Type u} :
          Coe (Subarray α) (Array α)
          Equations
          @[simp]
          theorem Subarray.copy_eq_toArray {α : Type u} {s : Subarray α} :
          def Array.ofSubarray {α : Type u} (s : Subarray α) :

          Allocates a new array that contains the contents of the subarray.

          Equations
          Instances For
            @[implicit_reducible]
            Equations
            def Array.Subarray.repr {α : Type u} [Repr α] (s : Subarray α) :

            Subarray representation.

            Equations
            Instances For
              @[implicit_reducible]
              instance Array.instReprSubarray {α : Type u} [Repr α] :
              Equations
              @[implicit_reducible]
              Equations