[Haskell-cafe] Re: Why is there no splitBy in the list module?

Donald Bruce Stewart dons at cse.unsw.edu.au
Mon Jul 10 03:48:48 EDT 2006


marco-oweber:
> There is already lines.
> Why not generalise it to take an additional parameter '\n' and call it
> split or splitBy?
> There are some cases where you want to split a list not on '\n'.

This comes up a lot. 

I thought at some time last year there'd been a long discussion about
all the various flavours of 'split' that we could come up with. But
then, what happened to the code? Did we not agree on a version to go
into Data.List?

Hacking up your own custom split (or a tokens/splitOnGlue) must be one
of the most common questions from beginners on the irc channel.

Even fps has a split/splitBy:
    http://www.cse.unsw.edu.au/~dons/fps/Data-ByteString.html#v%3Asplit
    http://www.cse.unsw.edu.au/~dons/fps/Data-ByteString.html#v%3AsplitWith
    http://www.cse.unsw.edu.au/~dons/fps/Data-ByteString.html#v%3Ajoin

Anyone rememeber what the result of the "let's get split into the base
library" movement's work was?

-- Don

(Moved to haskell-cafe@)


More information about the Haskell-Cafe mailing list