
HI I will try and explain it better. I am meaning to write a function that takes a string, " apple" and eliminates the spaces at the start ONLY. called........ removeSpace :: String -> String I decided to use the function 'dropWhile' and another one 'isSpace' in the 'removeSpace' function. removeSpace:: String -> String removeSpace a = case dropWhile isSpace a of "" -> I get stuck here... I am not sure how to go about this function. Any ideas. Ryan _________________________________________________________________ The next generation of MSN Hotmail has arrived - Windows Live Hotmail http://www.newhotmail.co.uk

On Dec 4, 2007 1:29 PM, Ryan Bloor
HI
I will try and explain it better. I am meaning to write a function that takes a string, " apple" and eliminates the spaces at the start ONLY. called........ removeSpace :: String -> String
I decided to use the function 'dropWhile' and another one 'isSpace' in the 'removeSpace' function.
removeSpace:: String -> String removeSpace a = case dropWhile isSpace a of "" ->
I am not sure why you think you need to do a case analysis here. Think about what 'dropWhile isSpace' does. -Brent

look at the examples of dropWhile usage you got from the first result
when you get when you google on dropWhile.
t.
2007/12/4, Ryan Bloor
HI
I will try and explain it better. I am meaning to write a function that takes a string, " apple" and eliminates the spaces at the start ONLY. called........ removeSpace :: String -> String
I decided to use the function 'dropWhile' and another one 'isSpace' in the 'removeSpace' function.
removeSpace:: String -> String removeSpace a = case dropWhile isSpace a of "" ->
I get stuck here... I am not sure how to go about this function.
Any ideas.
Ryan
________________________________ Can you guess the film? Search Charades! _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Brent Yorgey
-
Ryan Bloor
-
Thomas Hartman