Idris2/tests/idris2/coverage/coverage001/Vect3.idr
2023-09-07 14:57:22 +01:00

12 lines
247 B
Idris

%default partial
data Vect : Nat -> Type -> Type where
Nil : Vect Z a
(::) : a -> Vect k a -> Vect (S k) a
zip : Vect n a -> Vect n b -> Vect n (a, b)
zip [] Z impossible
zip [] [] = Nil
zip (x :: xs) (y :: ys) = (x, y) :: zip xs ys