1 import "Prelude" hiding (scanl)
3 scanl :: (b -> a -> <e> b) -> b -> [a] -> <e> [b]
4 scanl f initial l = build (loop initial 0)
7 loop cur i accum cons = let nl = cons accum cur
10 else loop (f cur (l!i)) (i+1) nl cons
12 main = scanl (+) 0 [1,2,3]