
11 Sep
2012
11 Sep
'12
12:20 p.m.
I would like to propose adding a the functions scanl' and scanl1' to Data.List. The presence and regular use of foldl' and foldl1' suggests that corresponding scan functions should be available.
scanl' :: (a -> b -> a) -> a -> [b] -> [a] scanl' f q ls = q `seq` (q : (case ls of [] -> [] x:xs -> scanl' f (f q x) xs))
What do you think? Niklas