∀ {β : Type v} {m : Type v → Type w} [inst : Monad m] (f : UInt8 → β → m β) (as : ByteSlice) (_x : (_ : ℕ) ×' β),
  ByteSlice.foldrM.loop._unary✝ f as _x =
    PSigma.casesOn _x fun i acc =>
      if h : i < as.size then do
        let newAcc ← f as[as.size - 1 - i] acc
        ByteSlice.foldrM.loop._unary✝¹ f as ⟨i + 1, newAcc⟩
      else pure acc