Re: [Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-21 Thread David House
On 20/09/06, John Ky <[EMAIL PROTECTED]> wrote: So Monads don't actually eliminate laziness? Monads and laziness are completely orthagonal issues; they have nothing to do with one another. I think you're getting confused with purity. Monads can be used to encapsulate effects, to allow you to wr

Re: [Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-20 Thread Tomasz Zielonka
On Thu, Sep 21, 2006 at 12:26:03AM +1000, John Ky wrote: > Given that putStrLn contents did manage to print out the HTTP header > before blocking, am I correct in coming to the conlusion that > 'contents' is evaluated lazily? hGetContents breaks the rules of the IO monad - it returns a value (the

Re: [Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-20 Thread John Ky
Hi again, Given that putStrLn contents did manage to print out the HTTP header before blocking, am I correct in coming to the conlusion that 'contents' is evaluated lazily? So Monads don't actually eliminate laziness? -John On 9/20/06, Philippa Cowderoy <[EMAIL PROTECTED]> wrote: On Wed, 20 S

Re: [Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-20 Thread Philippa Cowderoy
On Wed, 20 Sep 2006, John Ky wrote: > Actually, it blocks on: > > >putStrLn contents > > It even blocks if I replace it with: > > >print $ length contents > > Is there some kind of magic happening here? > No, but you're trying to do magic - it can't get all of contents until the con

[Haskell-cafe] Re: Trying to write a TCP proxy

2006-09-20 Thread John Ky
Actually, it blocks on: putStrLn contents It even blocks if I replace it with: print $ length contents Is there some kind of magic happening here? -John On 9/20/06, John Ky <[EMAIL PROTECTED]> wrote: Hello, I'm trying to use haskell to put together a TCP proxy I can put between m