
17 Jan
2008
17 Jan
'08
10:31 a.m.
Don Stewart wrote:
Note here the funniness of lines, complicates the properties:
prop_linessplit xs = lines xs == split '\n' xs ++ (if last xs == '\n' then [empty] else [])
This property is wrong (i.e. for xs == "\n")
What properties relating to current List functoins does this split have?
Data.ByteString.Char8.split only behaves differently to the proposed Data.List.split function on empty input lists. (as Twan showed) last xs == '\n' ==> lines xs == Data.List.split '\n' (init xs) Christian