« Previous | Next » 

Revision 748d5d50

ID748d5d502fc71f6db1ca437ede6ea49ba304555f
Parent aec636b9
Child a604456d

Added by Iustin Pop over 13 years ago

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 <>
Reviewed-by: Balazs Lecz <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences