Return the successive accumulator values of a left fold, including the initial accumulator:
scanl f e [] = [e] and scanl f e (x:xs) = e : scanl f (f e x) xs. The th result is the fold of the first elements, proved by the fold equation. Thus the scan equals map (foldl f e) . inits, but computes updates instead of on a finite input of length . Accumulator strictness and the cost of an update remain separate from this operation count. New to topics? Read the docs here!