RE: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Bayley, Alistair
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Bulat Ziganshin To: Peter Verswyvelen But how does GHC implement the RealWorld internally? I guess look the base library sources for RealWorld

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Peter Verswyvelen
IO also seems to use unboxed (hence strict?) tuples newtype IO a = IO (State# RealWorld - (# State# RealWorld, a #)) Not sure if this is just for performance, but if the strictness is required, here we have the horrible hack again then (would behave different without it?). I guess it works

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Lennart Augustsson
You need a lot of magic to make the IO monad efficient. You don't really want to pass around (and pattern match on) a RealWorld token, that would be inefficient. On Fri, Aug 21, 2009 at 11:04 AM, Peter Verswyvelenbugf...@gmail.com wrote: IO also seems to use unboxed (hence strict?) tuples

RE: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Simon Peyton-Jones
...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On | Behalf Of Lennart Augustsson | Sent: 21 August 2009 11:04 | To: Peter Verswyvelen | Cc: Bayley, Alistair; The Haskell Cafe | Subject: Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq? | | You need a lot of magic to make the IO monad

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Derek Elkins
On Fri, Aug 21, 2009 at 5:04 AM, Lennart Augustssonlenn...@augustsson.net wrote: On Fri, Aug 21, 2009 at 10:52 AM, Bayley, Alistair alistair.bay...@invesco.com wrote: From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Bulat Ziganshin To: Peter

Re: Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-21 Thread Lennart Augustsson
The IO in hbc was (is) the old request-response model, on top of which there was also a continuation layer, as well as the monadic IO (once that was invented). It involved a lot more C code handling the requests than I really liked. BTW, unsafePerformIO is pretty ugly to implement in the

Re[2]: [Haskell-cafe] Re: Where do I put the seq?

2009-08-20 Thread Bulat Ziganshin
Hello Peter, Friday, August 21, 2009, 12:41:35 AM, you wrote: But how does GHC implement the RealWorld internally? I guess look the base library sources for RealWorld -- Best regards, Bulatmailto:bulat.zigans...@gmail.com