
8 Apr
2006
8 Apr
'06
10:36 a.m.
Hello Sebastian, Saturday, April 8, 2006, 5:43:44 PM, you wrote:
inits xs = [] : (zipWith take [1..] $ map (const xs) xs) inits xs = [] : zipWith take [1..length xs] (repeat xs)
original defintion use a clever trick whci allows to not fully evaluate list before proceeding. this will require less memory for such lists as [1..10^6] and moreover it's the only way to work with infinite lists -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com