Re: Why is there no splitBy in the list module?

I personally use split :: Eq a => [a] -> [a] -> [[a]] all the time, much more often than splitBy :: (a -> Bool) -> [a] -> [[a]] But I don't call it "split". By analogy with concatMap, the Haskell analogue of Perl/Python "join" is concatIntersperse. Then, by analogy with lines/unlines, the Haskell analogue of "split" is... unconcatIntersperse. Hmm...

"split" is... unconcatIntersperse.
How about "separate"? ("split" or "splitBy" is better but it is used all over the place in many libs) And for strings I definitely would use split :: [a] -> [a] -> [[a]] a lot, just like Python's split function. And "words" works great for breaking on multiple spaces, so I would avoid trying to fill that need... Jared.
Hmm... _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- http://www.updike.org/~jared/ reverse ")-:"
participants (2)
-
Jared Updike
-
Yitzchak Gale