Andrew wrote:
> 
> To whom it may concern,
> 
> 'putStr' does not seem to work.
> I keep getting this:
> ERROR: Cannot find "show" function for:
> *** Expression : putChar
> *** Of type    : Char -> IO ()
> 
> Please help,
> 
> Andrew Golightly

Top level expression need to be Show-able or of type IO a.
* If the top level expression is showable, then Hugs shows
  it, using the show function.
* If the top level expression is of type IO, then Hugs
  runs the IO action.

Example:

Prelude> putStr
ERROR: Cannot find "show" function for:
*** Expression : putStr
*** Of type    : String -> IO ()


This is because putStr is now of a show-able type.

Prelude> putStr "Hello"
Hello

putStr with its argument is of type IO (), so hugs
runs the putStr action.

You also might want to try try the :s -u command;
it turns off the use of show.

There are many more examples in the documentation.

Hope this helps,

Andy
--
Principal Project Scientist, Pacific Software Research Center
Department of Computer Science and Engineering
Oregon Graduate Institute of Science & Technology
phone +1 503 748 7451       http://www.cse.ogi.edu/~andy

Reply via email to