Proposal: Add chop function to Data.List
stefan at vectorfabrics.com
Tue Dec 14 11:40:38 CET 2010
>> 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?
chop f = unfoldr g
g  = Nothing
g as = Just (f as)
More information about the Libraries