[Haskell-cafe] Why is there no "splitSeperator" function in Data.List
Evan Laforge
qdunkan at gmail.com
Mon Feb 14 06:52:39 CET 2011
>> The reason it's not in Data.List is because there are a bazillion
>> different splits one might want (when I was pondering the issue before
>> Brent released it, I had collected something like 8 different proposed
>> splits), so no agreement could ever be reached.
>
> It is curious though that the Python community managed to agree on a
> single implementation and include that in the standard library… So it is
> possible :)
This is sometimes cited as the advantage of a benevolent
dictator-for-life. I remember there was lots of argument when 'join'
was added as a string method (vs. should it be a list method). In the
end, Guido decided on one and that's what went in. Fortunately that
particular dilemma is one forced by single-dispatch OO and doesn't
apply to haskell :)
I also wrote simple 'split' and 'join' functions that behave like the
python ones. I use them all the time. It doesn't bother me that
there are lots of other possible implementations, the simple 'join ::
String -> [String] -> String' and 'split :: String -> String ->
[String]' versions work in enough cases.
More information about the Haskell-Cafe
mailing list