Proposal: Add chop function to Data.List

Yitzchak Gale gale at sefer.org
Tue Dec 14 11:46:49 CET 2010


Lennart Augustsson wrote:
>> chop..
>> The function is clearly related to unfoldr, but I find it more
>> convenient to use in a lot of cases.

Henning Thielemann wrote:
> Is the difference between 'unfoldr' and 'chop' just the Maybe result type of
> f?

No. unfoldr is slightly more general in that it allows the
unfolding to continue on null input. chop is more efficient
in the common case that the unfolding stops on null input.

Regards,
Yitz



More information about the Libraries mailing list