Documentation

ScalarArray.Int8.Array

Arrays of Int8: array operations #

Removing elements, search, building arrays, iteration, equality, hashing and printing.

Removing elements #

Whether a has no elements.

Equations
Instances For
    @[implemented_by _private.ScalarArray.Int8.Array.0.ScalarArray.Int8Array.popImpl]

    Removes the last element of a, if any, in place when a is not shared.

    Equations
    Instances For
      @[inline]

      The last element of a, or none if a is empty.

      Equations
      Instances For
        @[inline]

        The last element of a. Panics if a is empty, and then returns default.

        Equations
        Instances For
          @[inline]

          The last element of a, which is not empty.

          Equations
          Instances For
            @[implemented_by _private.ScalarArray.Int8.Array.0.ScalarArray.Int8Array.popWhileImpl]

            Removes the longest run of elements at the end of a that satisfy p, in place when a is not shared.

            Equations
            Instances For
              @[implemented_by _private.ScalarArray.Int8.Array.0.ScalarArray.Int8Array.extractImpl]

              The elements of a from index start up to, but not including, min stop a.size, copied into a new array.

              Equations
              Instances For

                Linearity #

                @[never_extract, extern lean_sarray_mark_linear]

                Marks a as linear, a debugging aid: if a marked array is ever copied because it is shared when it needs to be exclusive, as before an in-place write, the runtime panics. The mark goes on an exclusive array, so if a is shared it is copied first and the copy is marked. Logically this is the identity.

                Equations
                Instances For
                  @[never_extract, extern lean_sarray_propagate_mark]

                  Returns b, marked as linear if a is marked. Like markLinear, marking copies b first if it is shared. Logically this is b.

                  Equations
                  Instances For
                    @[inline]
                    def ScalarArray.Int8Array.findFinIdx? (a : Int8Array) (p : Int8 → Bool) (start : Nat := 0) :

                    The index of the first element at or after start that satisfies p, with a proof that it is in bounds.

                    Equations
                    Instances For
                      @[inline]
                      def ScalarArray.Int8Array.findIdx? (a : Int8Array) (p : Int8 → Bool) (start : Nat := 0) :

                      The index of the first element at or after start that satisfies p.

                      Equations
                      Instances For

                        Building arrays #

                        @[implemented_by _private.ScalarArray.Int8.Array.0.ScalarArray.Int8Array.replicateImpl]

                        An array of n copies of v.

                        Equations
                        Instances For
                          @[implemented_by _private.ScalarArray.Int8.Array.0.ScalarArray.Int8Array.ofFnImpl]

                          The array #[f 0, …, f (n - 1)].

                          Equations
                          Instances For

                            The array with the elements of l.

                            Equations
                            Instances For

                              Iteration #

                              def ScalarArray.Int8Array.foldlM {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Int8 → m β) (init : β) (a : Int8Array) (start : Nat := 0) (stop : Nat := a.size) :
                              m β

                              Folds a monadic function over the elements of a from index start up to, but not including, stop, from first to last.

                              Equations
                              Instances For
                                @[inline]
                                def ScalarArray.Int8Array.foldlMImpl {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Int8 → m β) (init : β) (a : Int8Array) (start : Nat := 0) (stop : Nat := a.size) :
                                m β

                                For internal use only.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def ScalarArray.Int8Array.foldrM {β : Type v} {m : Type v → Type w} [Monad m] (f : Int8 → β → m β) (init : β) (a : Int8Array) :
                                  m β

                                  Folds a monadic function over the elements of a, from last to first.

                                  Equations
                                  Instances For
                                    @[inline]
                                    def ScalarArray.Int8Array.foldrMImpl {β : Type v} {m : Type v → Type w} [Monad m] (f : Int8 → β → m β) (init : β) (a : Int8Array) :
                                    m β

                                    For internal use only.

                                    Equations
                                    Instances For
                                      @[inline]
                                      def ScalarArray.Int8Array.foldl {β : Type v} (f : β → Int8 → β) (init : β) (a : Int8Array) (start : Nat := 0) (stop : Nat := a.size) :
                                      β

                                      Folds a function over the elements of a from index start up to, but not including, stop, from first to last.

                                      Equations
                                      Instances For
                                        @[inline]
                                        def ScalarArray.Int8Array.foldr {β : Type v} (f : Int8 → β → β) (init : β) (a : Int8Array) :
                                        β

                                        Folds a function over the elements of a, from last to first.

                                        Equations
                                        Instances For
                                          @[inline]
                                          def ScalarArray.Int8Array.forM {m : Type v → Type w} [Monad m] (f : Int8 → m PUnit) (a : Int8Array) :

                                          Runs a monadic action on each element of a, from first to last.

                                          Equations
                                          Instances For
                                            def ScalarArray.Int8Array.forIn {β : Type v} {m : Type v → Type w} [Monad m] (a : Int8Array) (init : β) (f : Int8 → β → m (ForInStep β)) :
                                            m β

                                            The loop behind for x in a. Logically it is the loop over a.toArray.

                                            Equations
                                            Instances For
                                              @[inline]
                                              def ScalarArray.Int8Array.forInImpl {β : Type v} {m : Type v → Type w} [Monad m] (a : Int8Array) (init : β) (f : Int8 → β → m (ForInStep β)) :
                                              m β

                                              For internal use only.

                                              Equations
                                              Instances For
                                                @[instance_reducible]
                                                Equations

                                                Whether some element of a satisfies p.

                                                Equations
                                                Instances For
                                                  @[inline]

                                                  For internal use only.

                                                  Equations
                                                  Instances For

                                                    Whether every element of a satisfies p.

                                                    Equations
                                                    Instances For
                                                      @[inline]

                                                      For internal use only.

                                                      Equations
                                                      Instances For

                                                        Whether some element of a is == to v.

                                                        Equations
                                                        Instances For

                                                          For internal use only.

                                                          Equations
                                                          Instances For
                                                            @[instance_reducible]

                                                            x ∈ a when x is an element of a.

                                                            Equations

                                                            Equality and hashing #

                                                            @[extern lean_sarray_dec_eq]

                                                            Decides equality by comparing the two arrays' memory.

                                                            Equations
                                                            Instances For

                                                              The same hash as a.toArray.

                                                              Equations
                                                              Instances For

                                                                For internal use only.

                                                                Equations
                                                                Instances For

                                                                  Conversion and printing #

                                                                  The elements of a as a list.

                                                                  Equations
                                                                  Instances For
                                                                    @[instance_reducible]

                                                                    Prints ScalarArray.Int8Array.mk #[...], which evaluates to an equal array.

                                                                    Equations
                                                                    @[instance_reducible]
                                                                    Equations
                                                                    @[inline]

                                                                    The array with the elements of l.

                                                                    Equations
                                                                    Instances For