Revision 748d5d50
ID | 748d5d502fc71f6db1ca437ede6ea49ba304555f |
Parent | aec636b9 |
Child | a604456d |
Generalise the sepSplit function
Currently it works on splitting strings by individual chars, but we
can generalise it to split lists by list elements, which means we can
reuse it later in the Text module for splitting both lists of chars by
'|' or lists of lines by empty newlines. The change also makes the
code cleaner (uses “null xs” instead of string-specific “xs == ""”).
Note: I tried to rewrite this in a nicer, functional style using
unfolds, but I failed to account for the final terminator case
(e.g. ab|cd|) resulting in a valid but empty element.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
Files
- added
- modified
- copied
- renamed
- deleted