Proposal: Add split and splitWith (trac #2048)

Neil Mitchell ndmitchell at gmail.com
Wed Jan 16 19:32:24 EST 2008


Hi

> > One or the other should be changed so that these agree:
> >
> > *Main> split 'a' ""
> > [""]
> > *Main> Data.ByteString.Char8.split 'a' (Data.ByteString.Char8.pack "")
> > Loading package array-0.1.0.0 ... linking ... done.
> > Loading package bytestring-0.9.0.1 ... linking ... done.
> > []
> >
> > although I couldn't say which is "right" OTTOMH...
>
> I hadn't noticed. In my opinion the Data.List version is more consistent,

You can show you can build it up from an inductive argument, yes. But
the Data.ByteString version probably matches what I'd expect to happen
much more - just a gut feeling.

Thanks

Neil


More information about the Libraries mailing list