Proposal: Add chop function to Data.List

Lennart Augustsson lennart at augustsson.net
Mon Dec 13 18:47:01 CET 2010


Yes, of course I did.  That's what I get for typing instead of using
copy&paste. :)

On Mon, Dec 13, 2010 at 5:36 PM, Malcolm Wallace <malcolm.wallace at me.com>wrote:

> Surely you mean this signature?
>
>
> chop :: ([a] -> (b, [a])) -> [a] -> [b]
>
>
> On 13 Dec 2010, at 17:17, Lennart Augustsson wrote:
>
>  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
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20101213/5b4a7c0c/attachment.htm>


More information about the Libraries mailing list