
Christian Maeder wrote:
Malcolm Wallace schrieb:
I think the general objection to the "With" suffix is that it is non-standard naming. All the Haskell'98 libraries use "By" for this kind of meaning.
Looking at Data.List there is not a single function with suffix "By" that takes a predicate argument (filter, dropWhile, etc.).
All "...By" function (nubBy, ..., minimumBy) take binary comparison arguments.
Hmm... splitWhen ? However, by analogy with 'break' and 'span' it should be just 'split', and if you want to split on white space, you say so: 'split isSpace'. I also think, this version of 'split' (or whatever you want to call it) is all that's needed, because *> lines == split (== '\n') *> words == filter (not.null) . split isSpace and anyone who needs more than that is better served with alex, some sort of regexes or Manuel Chakravarty's lexer combinators. Udo.