on master help sign in
Simplify Prelude.Vect.range
8bc1c7fMelvar Chen
lib/Prelude/Vect.idr+2−6
@@ -322,12 +322,8 @@ diag [] = []
322diag ((x::xs)::xss) = x :: diag (map tail xss)
322diag ((x::xs)::xss) = x :: diag (map tail xss)
323
323
324range : Vect n (Fin n)
324range : Vect n (Fin n)
325−range =
325+range {n=Z} = []
326− reverse range_
326+range {n=S _} = fZ :: map fS range
327− where
328− range_ : Vect n (Fin n)
329− range_ {n=Z} = Nil
330− range_ {n=(S _)} = last :: map weaken range_
331
327
332--------------------------------------------------------------------------------
328--------------------------------------------------------------------------------
333-- Proofs
329-- Proofs