0 | module Data.Vect.Erased
 1 |
 2 | public export
 3 | data Vect0 : Nat -> Type -> Type where
 4 |   Nil : Vect0 0 a
 5 |   (::) : (0 _ : a) -> (_ : Vect0 n a) -> Vect0 (S n) a
 6 |
 7 | public export 0
 8 | Head : Vect0 (S n) a -> a
 9 | Head (x :: _) = x
10 |
11 | public export 0
12 | Last : Vect0 (S n) a -> a
13 | Last (x :: []) = x
14 | Last (_ :: x :: ys) = Last (x :: ys)
15 |
16 | public export
17 | zip : Vect0 n a -> Vect0 n b -> Vect0 n (a, b)
18 | zip [] [] = []
19 | zip (x :: z) (y :: w) = (x, y) :: zip z w
20 |
21 |
22 | public export
23 | pairUp : Vect0 (S n) a -> Vect0 n (a, a)
24 | pairUp [a] = []
25 | pairUp (x :: y :: xs) = (x, y) :: pairUp (y :: xs)
26 |
27 | namespace Quantifiers
28 |   public export
29 |   data All0 : (p : a -> Type) -> Vect0 n a -> Type where
30 |     Nil : All0 p []
31 |     (::) : {0 x : a} -> (_ : p x) -> (_ : All0 p xs) -> All0 p (x :: xs)
32 |