@@ -326,10 +326,20 @@ foldl1 f (x::xs) = foldl f x xs
326326-- Scans
327327--------------------------------------------------------------------------------
328328
329+||| The scanl function is similar to foldl, but returns all the intermediate
330+||| accumulator states in the form of a vector.
329331scanl : (res -> elem -> res) -> res -> Vect len elem -> Vect (S len) res
330332scanl f q [] = [q]
331333scanl f q (x::xs) = q :: scanl f (f q x) xs
332334
335+||| The scanl1 function is a variant of scanl that doesn't require an explicit
336+||| starting value.
337+||| It assumes the first element of the vector to be the starting value and then
338+||| starts the fold with the element following it.
339+scanl1 : (elem -> elem -> elem) -> Vect len elem -> Vect len elem
340+scanl1 f [] = []
341+scanl1 f (x::xs) = scanl f x xs
342+
333343--------------------------------------------------------------------------------
334344-- Membership tests
335345--------------------------------------------------------------------------------