Documentation

Init.Data.Array.Subarray.Split

def Subarray.split {α : Type u_1} (s : Subarray α) (i : Fin s.size.succ) :

Splits a subarray into two parts.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def Subarray.drop {α : Type u_1} (arr : Subarray α) (i : Nat) :

    Removes the first i elements of the subarray. If there are i or fewer elements, the resulting subarray is empty.

    Equations
    • arr.drop i = { array := arr.array, start := min (arr.start + i) arr.stop, stop := arr.stop, start_le_stop := , stop_le_array_size := }
    Instances For
      def Subarray.take {α : Type u_1} (arr : Subarray α) (i : Nat) :

      Keeps only the first i elements of the subarray. If there are i or fewer elements, the resulting subarray is empty.

      Equations
      • arr.take i = { array := arr.array, start := arr.start, stop := min (arr.start + i) arr.stop, start_le_stop := , stop_le_array_size := }
      Instances For