add vec.map

This commit is contained in:
rhiannon morris 2024-06-02 17:34:58 +02:00
parent 7b3ccfc45a
commit 68c414a941
1 changed files with 3 additions and 0 deletions

View File

@ -240,6 +240,9 @@ def0 ZipWith = zip-with.Result
def zip-with-het = zip-with.zip-with-het
def zip-with-hetω = zip-with.zip-with-hetω
def map : 0.(A B : ★) → ω.(A → B) → (n : ) → Vec n A → Vec n B =
λ A B f ⇒ elim A (λ n _ ⇒ Vec n B) 'nil (λ x _ _ ys ⇒ (f x, ys))
#[compile-scheme "(lambda% (n xs) xs)"]
def up : 0.(A : ★) → (n : ) → Vec n A → Vec¹ n A =
λ A n ⇒