on master help sign in
changed the definition of insertAt
commitacf32dd4abe60eb41d69a1c098e9380378e1a4a7 authorjeffersoncarpenter <jeffersoncarpenter2@gmail.com> dateThu 29 May 2014, 10:41 (12 years ago) parente3e3528
1 file changed+3−3
libs/prelude/Prelude/Vect.idr+3−3
libs/prelude/Prelude/Vect.idr+3−3
@@ -70,9 +70,9 @@ index fZ [] impossible
7070
7171||| Insert an element at a particular index
7272insertAt : Fin (S n) -> a -> Vect n a -> Vect (S n) a
73−insertAt fZ y [] = [y]
74−insertAt (fS k) y (x::xs) = x :: insertAt k y xs
75−insertAt k y xs = y :: xs
73+insertAt fZ y xs = y :: xs
74+insertAt (fS k) y (x::xs) = x :: insertAt k y xs
75+insertAt (fS k) y [] = absurd k
7676
7777||| Construct a new vector consisting of all but the indicated element
7878deleteAt : Fin (S n) -> Vect (S n) a -> Vect n a