
10 Apr
2006
10 Apr
'06
12:16 p.m.
Chris Kuklewicz wrote:
inits' = helper id where helper f [] = (f []):[] helper f (x:xs) = (f []):helper (f.(x:)) xs
This one looks nice, maybe the helper should be changed to allow "head $ inits' undefined": helper f xs = f [] : case xs of [] -> [] x : r -> helper (f . (x :)) r C.