summaryrefslogtreecommitdiff
path: root/backends/lean/Base/Primitives/Vec.lean
diff options
context:
space:
mode:
Diffstat (limited to 'backends/lean/Base/Primitives/Vec.lean')
-rw-r--r--backends/lean/Base/Primitives/Vec.lean4
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/lean/Base/Primitives/Vec.lean b/backends/lean/Base/Primitives/Vec.lean
index e600a151..2c3fce91 100644
--- a/backends/lean/Base/Primitives/Vec.lean
+++ b/backends/lean/Base/Primitives/Vec.lean
@@ -37,6 +37,10 @@ example {a: Type u} (v : Vec a) : v.length ≤ Scalar.max ScalarTy.Usize := by
def Vec.new (α : Type u): Vec α := ⟨ [], by apply Scalar.cMax_suffices .Usize; simp ⟩
+instance (α : Type u) : Inhabited (Vec α) := by
+ constructor
+ apply Vec.new
+
-- TODO: very annoying that the α is an explicit parameter
def Vec.len (α : Type u) (v : Vec α) : Usize :=
Usize.ofIntCore v.val.len (by scalar_tac) (by scalar_tac)