
22 Oct
2007
22 Oct
'07
9:59 a.m.
Maxime Henrion wrote:
Hello all,
What do you think about having a wordsBy function in the standard libraries? It often comes in handy.
I speculate (but don't know) that the reason we don't have one is that there are quite a few choices to make: * delimiter as function (Char -> Bool) or Char * delimit by single chars only or multiple (String -> Bool) * multiple adjacent delimiters cause empty items, or not? * exact delimiter which occured returned as part of the result? ... my anecdotal experience is that in practice for slightly different applications you need different permutations of these choices. A single function which encompassed all the options would have a cumbersome type. Jules