Prelude function suggestions

Christian Maeder maeder at
Thu Jul 29 06:44:07 EDT 2004

Simon Marlow wrote:
> How about:
> split :: (a -> Bool) -> [a] -> [[a]]

I would not mind if you put it into Data.List (although I would need to 
change some code that I've copied from elsewhere) It's the libraries's 
writer privilege to choose (short) names.

 > Unfortunately
 >  lines /= split (=='\n')
 > because lines strips off blank lines at the end.

Only the last newline is ignored:

      lines "\na\nb\n\n" = ["","a","b",""]

Thus, it behaves in the same way as splitPS (arguably this is maybe not 
a bug)


More information about the Libraries mailing list