
4 Dec
2007
4 Dec
'07
4:57 p.m.
On Tue, Dec 04, 2007 at 05:13:19PM +0000, Ryan Bloor wrote:
hi
I am having trouble with a function that is supposed to eliminate spaces from the start of a String and return the resulting string. I reckon a dropWhile could be used but the isSpace bit is causing me problems...
words :: String -> String words a = case dropWhile isSpace a of "" -> s:ss -> (s:word) : words rest where (word,rest) = break isSpace ss
You might want to write the code for the first case; an expression is mandatory after ->. Stefan