Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-14 Thread Peter Simons
Hi Evan, 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

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Iustin Pop
On Sat, Feb 12, 2011 at 11:21:37AM -0500, Gwern Branwen wrote: On Sat, Feb 12, 2011 at 11:00 AM, Robert Clausecker fuz...@gmail.com wrote: Is there any reason, that one can't find a function that splits a list at a seperator in the standard library? I imagined something like this:    

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Lyndon Maydwell
Does the Python implementation operate on Strings, or all lists? I think this could be quite important as many split implementations take regular expressions as arguments. This could be quite challenging for general lists. That said, I would like to see some of these features in the split

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Henning Thielemann
On Sun, 13 Feb 2011, Iustin Pop wrote: On Sat, Feb 12, 2011 at 11:21:37AM -0500, Gwern Branwen wrote: See http://hackage.haskell.org/package/split 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

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Iustin Pop
On Sun, Feb 13, 2011 at 06:01:01PM +0800, Lyndon Maydwell wrote: Does the Python implementation operate on Strings, or all lists? Of course, just on strings. I think this could be quite important as many split implementations take regular expressions as arguments. This could be quite

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Iustin Pop
On Sun, Feb 13, 2011 at 11:21:42AM +0100, Henning Thielemann wrote: On Sun, 13 Feb 2011, Iustin Pop wrote: On Sat, Feb 12, 2011 at 11:21:37AM -0500, Gwern Branwen wrote: See http://hackage.haskell.org/package/split The reason it's not in Data.List is because there are a bazillion

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Evan Laforge
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

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-13 Thread Max Rabkin
On Mon, Feb 14, 2011 at 07:52, Evan Laforge qdun...@gmail.com wrote: the simple 'join :: String - [String] - String' and 'split :: String - String - [String]' versions work in enough cases. BTW, this join is Data.List.intercalate. --Max ___

[Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-12 Thread Robert Clausecker
Is there any reason, that one can't find a function that splits a list at a seperator in the standard library? I imagined something like this: splitSeperator :: Eq a = a - [a] - [[a]] splitSeperator ',' foo,bar,baz -- [foo,bar,baz] Or something similar? This is needed so often,

Re: [Haskell-cafe] Why is there no splitSeperator function in Data.List

2011-02-12 Thread Gwern Branwen
On Sat, Feb 12, 2011 at 11:00 AM, Robert Clausecker fuz...@gmail.com wrote: Is there any reason, that one can't find a function that splits a list at a seperator in the standard library? I imagined something like this:    splitSeperator :: Eq a = a - [a] - [[a]]    splitSeperator ','