[Haskell-cafe] How to show a variable with "show"?

Mads Lindstrøm mads_lindstroem at yahoo.dk
Thu May 5 07:41:04 EDT 2005


Hi

Here is a program which shows the return value of a function:

module Main where
main = putStr (show (foo 3))
foo x = x + 2

Here is a little bigger program:

module Main where

main = do putStr (show (foo 3))
          putStr "\n"
          putStr (show (foo 7))
          putStr "\n"

foo x = x + 2

/Mads Lindstrøm

> Hi!
> In my program I would like to see an result of
> function or an variable.
> Wenn I use "show myfunction" or "show variable", I'm
> getting errors like "ERROR - Improperly terminated
> character constant" or " Syntax error in declaration
> (unexpected `;', possibly due to bad layout)"
> 
> Any help would be appreciated!
> 
> 
> 
> 		
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
-- 
Mads Lindstrøm <mads_lindstroem at yahoo.dk>



More information about the Haskell-Cafe mailing list