data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + b = b
succ a + b = succ (a + b)
_·_ : ℕ → ℕ → ℕ
zero · b = zero
succ a · b = b + (a · b)
data List (A : Set) : Set where
[] : List A
_∷_ : A → List A → List A
sum : List ℕ → ℕ
sum [] = {!!}
sum (x ∷ xs) = {!!}
map : {A B : Set} → (A → B) → List A → List B
map f xs = {!!}
data Vector (A : Set) : ℕ → Set where
[] : Vector A zero
_∷_ : {n : ℕ} → A → Vector A n → Vector A (succ n)
lengthV : {n : ℕ} {A : Set} → Vector A n → ℕ
lengthV [] = zero
lengthV (x ∷ xs) = succ (lengthV xs)
lengthV' : {n : ℕ} {A : Set} → Vector A n → ℕ
lengthV' {n} {A} xs = n
mapV : {n : ℕ} {A B : Set} → (A → B) → Vector A n → Vector B n
mapV f xs = {!!}
zipWithV : {A B C : Set} {n : ℕ} → (A → B → C) → Vector A n → Vector B n → Vector C n
zipWithV f [] [] = {!!}
zipWithV f (x ∷ xs) (y ∷ ys) = {!!}
dropV : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A n
dropV k xs = {!!}
takeV : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A k
takeV zero xs = []
takeV (succ k) (x ∷ xs) = x ∷ takeV k xs
_++_ : {A : Set} {n m : ℕ} → Vector A n → Vector A m → Vector A (n + m)
xs ++ ys = {!!}
snocV : {A : Set} {n : ℕ} → Vector A n → A → Vector A (succ n)
snocV xs y = {!!}
reverseV : {A : Set} {n : ℕ} → Vector A n → Vector A n
reverseV xs = {!!}
concatV : {A : Set} {n m : ℕ} → Vector (Vector A n) m → Vector A (m · n)
concatV [] = []
concatV (xs ∷ xss) = xs ++ concatV xss