Proposal: Add split and splitWith (trac #2048)

Henning Thielemann lemming at henning-thielemann.de
Fri Jan 18 02:07:07 EST 2008


On Thu, 17 Jan 2008, Duncan Coutts wrote:

> On Thu, 2008-01-17 at 17:36 +0100, Christian Maeder wrote:
> >
> > I've convinced myself (see my previous mails) that Twan's version is
> > right and Data.ByteString.Char8.split should be changed (and all its
> > usages need to be checked)!
> >
> > The documentation in both modules should contain the example!
> >   split c [] == [[]]
> >
> > I don't think that the oddity of Data.ByteString.Char8.split on empty
> > input helps to establish the treatment of a missing final newline for
> > the lines function.
>
> If everyone thinks this is the right behaviour we can certainly change
> Data.ByteString to follow. It is supposed to follow the Data.List api.

I vote for the change.


More information about the Libraries mailing list