@@ -100,17 +100,15 @@ updateAt (fS k) f (x::xs) = x :: updateAt k f xs
101||| Get the first m elements of a Vect
101||| Get the first m elements of a Vect
102||| @ m the number of elements to take
102||| @ m the number of elements to take
103−take : {n : Nat} -> (m : Fin (S n)) -> Vect n a -> Vect (cast m) a
103+take : (n : Nat) -> Vect (n + m) a -> Vect n a
104−take (fS k) [] = FinZElim k
104+take Z xs = []
106−take (fS k) (x::xs) = x :: take k xs
105+take (S k) (x :: xs) = x :: take k xs
108||| Remove the first m elements of a Vect
107||| Remove the first m elements of a Vect
109||| @ m the number of elements to remove
108||| @ m the number of elements to remove
110−drop : (m : Fin (S n)) -> Vect n a -> Vect (n - cast m) a
109+drop : (n : Nat) -> Vect (n + m) a -> Vect m a
111−drop (fS k) [] = FinZElim k
110+drop Z xs = xs
113−drop (fS k) (x::xs) = drop k xs
111+drop (S k) (x :: xs) = drop k xs
115--------------------------------------------------------------------------------
113--------------------------------------------------------------------------------
116-- Transformations
114-- Transformations
@@ -407,7 +405,7 @@ nub = nubBy (==)
407||| It is equivalent to (take n xs, drop n xs)
405||| It is equivalent to (take n xs, drop n xs)
408||| @ m the index to split at
406||| @ m the index to split at
409||| @ xs the Vect to split in two
407||| @ xs the Vect to split in two
410−splitAt : {n : Nat} -> (m : Fin (S n)) -> (xs : Vect n a) -> (Vect (cast m) a, Vect (n - cast m) a)
408+splitAt : (n : Nat) -> (xs : Vect (n + m) a) -> (Vect n a, Vect m a)
411splitAt n xs = (take n xs, drop n xs)
409splitAt n xs = (take n xs, drop n xs)
413--------------------------------------------------------------------------------
411--------------------------------------------------------------------------------
@@ -489,12 +487,6 @@ vectAppendAssociative (x :: xs) ys zs =
490--------------------------------------------------------------------------------
488--------------------------------------------------------------------------------
492−Prelude.Vect.drop_lemma_1 = proof {
494− rewrite sym (minusZeroRight n);
498Prelude.Vect.reverse'_lemma_1 = proof {
490Prelude.Vect.reverse'_lemma_1 = proof {
500 rewrite prf;
492 rewrite prf;