Prelude function suggestions

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Wed Jul 28 05:44:16 EDT 2004


> > >> {- | Split the list at the occurrences of a separator into sub-list.
> > >>      This is a generalization of 'words'. -}

There should be two versions of this, one which treats repeated delimiters the same as single ones and ignores initial and final delimiters, and one which treats repeated delimiters as creating an empty field.  Thus

split  isSpace " foo  bar baz " = ["foo","bar","baz"]
split' isSpace " foo  bar baz " = ["","foo","","bar","baz",""]

--KW 8-)
-- 
Keith Wansbrough <kw217 at cl.cam.ac.uk>
http://www.cl.cam.ac.uk/users/kw217/
University of Cambridge Computer Laboratory.



More information about the Libraries mailing list