split 10 "a\nb\nd\ne" == ["a","b","d","e"] -- fromEnum '\n' == 10 split 97 "aXaXaXa" == ["","X","X","X",""] -- fromEnum 'a' == 97 split 120 "x" == ["",""] -- fromEnum 'x' == 120 split undefined "" == [] -- and not [""]and
intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"] split 'a' "aXaXaXa" == ["","X","X","X",""] split 'x' "x" == ["",""] split undefined "" == [] -- and not [""]and
intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"] split 'a' "aXaXaXa" == ["","X","X","X"] split 'x' "x" == ["",""] split undefined "" == [] -- and not [""]and
intercalate [c] . split c == id split == splitWith . (==)As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split 10 "a\nb\nd\ne" == ["a","b","d","e"] -- fromEnum '\n' == 10 split 97 "aXaXaXa" == ["","X","X","X",""] -- fromEnum 'a' == 97 split 120 "x" == ["",""] -- fromEnum 'x' == 120 split undefined "" == [] -- and not [""]and
intercalate [c] . split c == id split == splitWith . (==)Note: copies the substrings
splitWith (==97) "aabbaca" == ["","","bb","c",""] -- fromEnum 'a' == 97 splitWith undefined "" == [] -- and not [""]
splitWith (=='a') "aabbaca" == ["","","bb","c",""] splitWith undefined "" == [] -- and not [""]
splitWith (==97) "aabbaca" == ["","","bb","c",""] -- fromEnum 'a' == 97 splitWith undefined "" == [] -- and not [""]