
10 Apr
2006
10 Apr
'06
10:01 a.m.
Simon Marlow wrote:
inits xs = [] : (zipWith take [1..] $ map (const xs) xs)
I propose to replace inits in Data.List with this one.
I think such a function should not use arithmetics (comparisons of ints via take) Christian for finite lists "reverse . map reverse . tails . reverse" is quite good (but it is 80% garbage collecting on my machine)