[Haskell-beginners] Hint on exercise from Real World Haskell

Daniel Fischer daniel.is.fischer at web.de
Mon Jun 28 23:02:43 EDT 2010

On Tuesday 29 June 2010 04:45:23, Chris Saunders wrote:
> I have been working on the exercises from chapter 1 of Real World
> Haskell. I seem to be stuck on a solution to:
> 4.Modify the WC.hs example again, to print the number of characters in a
> file.
> I'm hoping to get a hint for this one.  I may request a solution later
> but for now I would prefer just a hint.

Have you done ex. 3: The words function counts the number of words in a 
string. Modify the WC.hs example to count the number of words in a file. ?

Originally, WC uses lines to break a String into a list of lines.
Then you use words to break a String into a list of words.
Now you want to make a list of characters out of the String.
How do you do that again?

> Regards
> Chris Saunders

More information about the Beginners mailing list