Why is there no splitBy in the list module?

Ketil Malde ketil+haskell at ii.uib.no
Mon Jul 10 03:54:20 EDT 2006


Marc Weber <marco-oweber at gmx.de> writes:

> 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'.

Indeed, and in e.g. ByteString and MissingH, there are more functions
of this kind. 

I find that I've needed split/break type functions of various kinds,
and the standard functions don't seem to be too consistently named.
I think it would be nice to have an orthogonal product of 
predicate types:  ()  a  a->Bool  [a]->Bool  (of increasing generality)
and result types: ([a],[a]) and [[a]]  (split one - split all).

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Glasgow-haskell-users mailing list