on master help sign in
Merge pull request #4603 from kjekac/patch-1
011db5fNiklas Larsson
libs/base/Data/Vect.idr+2−1
@@ -315,7 +315,8 @@ concat (v::vs) = v ++ concat vs
315
315
316||| Foldr without seeding the accumulator
316||| Foldr without seeding the accumulator
317foldr1 : (t -> t -> t) -> Vect (S n) t -> t
317foldr1 : (t -> t -> t) -> Vect (S n) t -> t
318−foldr1 f (x::xs) = foldr f x xs
318+foldr1 f [x] = x
319+foldr1 f (x::y::xs) = f x (foldr1 f (y::xs))
319
320
320||| Foldl without seeding the accumulator
321||| Foldl without seeding the accumulator
321foldl1 : (t -> t -> t) -> Vect (S n) t -> t
322foldl1 : (t -> t -> t) -> Vect (S n) t -> t