Proposal (Trac ticket #3671): Add takeRec, genericTakeRec and spanRec to Data.List

Yitzchak Gale gale at sefer.org
Thu Nov 19 07:15:07 EST 2009


Ian Lynagh wrote:
>>    breaks (',' ==) "123,456,,78" == ["123", "456", "", "78"]

I wrote:
> runs = groupBy . on (==)
> breaks p = filter (not . p . head) . runs p

Except that has slightly different semantics than Ian's:

breaks (',' ==) "123,456,,78" == ["123","456","78"]

-Yitz


More information about the Libraries mailing list