Shah Namrata Abhaykumar <[EMAIL PROTECTED]> is trying to
understand I/O in haskell:

>Consider a request list, [req1,req2,req3,req4].  This means before
>evaluating req3, I should have evaluated req1 and req2.
...
>The sequencing is due to the fact that req3 may depend on req1 and
>req2.

Your requests may or may not depend on the responses to previous
requests.  Each response definitely depends on all previous requests
and responses.

>Consider that main is,
>
>        main resps = [req1,req2,req3,req4]
...
>when req2 is evaluated,
>resps = [response_to_request1] and when req3 is evaluated,
>resps = [response_to_request1, response_to_request2].

Wrong.  resps is a lazy list containing _all_ the responses to _all_
the requests the program will ever make.  However, if you make req2
depend on resp3 (the response to req3), you will have problems!

resp3 depends on resp2 which depends on req2 so you have a loop (a
black hole).  Why does resp3 depend on resp2?  Because resp3 depends
on the state of the world after resp2 which depends on resp2 (eg. the
program might have modified a file or the program may have exited).

I hope this helps (I hope it's right too :-).

Denis Howe <[EMAIL PROTECTED]>
Never start a sentence with because because because is a conjunction.

Reply via email to