
17 Jan
2008
17 Jan
'08
1:54 a.m.
On Thu, 17 Jan 2008, Henning Thielemann wrote:
On Thu, 17 Jan 2008, Ian Lynagh wrote:
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...
List's split is more consistent. It always returns a non-empty list. The number of sub-lists is the number of matching elements plus 1.
For QuickCheck: 1 + length (filter p xs) == length (split p xs)