
14 Dec
2010
14 Dec
'10
5:40 a.m.
Henning,
I would like to propose the following function for inclusion in Data.List chop :: (a -> (b, [a]) -> [a] -> [b] chop _ [] = [] chop f as = b : chop f as' where (b, as') = f as
Is the difference between 'unfoldr' and 'chop' just the Maybe result type of f?
Yes. chop f = unfoldr g where g [] = Nothing g as = Just (f as) Cheers, Stefan