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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to