[Haskell-cafe] wordsBy in the base libraries?

Jules Bean jules at jellybean.co.uk
Mon Oct 22 05:59:35 EDT 2007

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.


More information about the Haskell-Cafe mailing list