[Haskell-cafe] isSpace

Ryan Bloor ryanbloor at hotmail.com
Tue Dec 4 12:13:19 EST 2007

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
The next generation of MSN Hotmail has arrived - Windows Live Hotmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071204/3d26c231/attachment.htm

More information about the Haskell-Cafe mailing list