on master help sign in
Fix a duplicated splitWith bug.

--HG-- extra : convert_revision : a136358e3a0c307689b2851ec2e0824cb23abf1b

commit4b9cec0ea9e396371fd905e041166024484e2d46 authorBryan O'Sullivan <bos@serpentine.com> dateFri 14 Aug 2009, 06:53 (17 years ago) parent1e385a4
1 file changed+2−2
Data/Text/Lazy.hs+2−2
Data/Text/Lazy.hs+2−2
@@ -765,9 +765,9 @@ split c = splitWith (==c)
765765-- separators result in an empty component in the output. eg.
766766--
767767-- > splitWith (=='a') "aabbaca" == ["","","bb","c",""]
768−-- > splitWith (=='a') [] == []
768+-- > splitWith (=='a') [] == [""]
769769splitWith :: (Char -> Bool) -> Text -> [Text]
770−splitWith _ Empty = []
770+splitWith _ Empty = [Empty]
771771splitWith p (Chunk t0 ts0) = comb [] (T.splitWith p t0) ts0
772772 where comb acc (s:[]) Empty = revChunks (s:acc) : []
773773 comb acc (s:[]) (Chunk t ts) = comb (s:acc) (T.splitWith p t) ts