Alastair Reid wrote:

Another question with a trivial answer, what is the result of:

 main :: IO (IO ())
 main = return (putStr "Hello World!")


It is a computation which, if executed, will print "Hello World"


Clearly it also shows the relation between IO and chosen evaluation
strategy.


This isn't clear to me at all - can you explain further?
Is it even type correct with
  main :: IO (IO ())
If it is, it shouldn't be.  It makes no sense.
The value computed by the top level IO action should
have some consumer.  Sensible types for the consumer
(which in some sense is the OS) are () or some exit code.

-- Lennart

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to