On 07/08/2009, at 6:04 PM, Simon Marlow wrote:
If, as I understand it, you are relying on the fact that seq's first
argument is evaluted before its second, then you really want pseq
rather than seq.
This is the sense in which I mean it's a dangerous use of seq and
unsafePerformIO - because the compiler is within its rights to
evaluate the second argument to seq "first".
In GHC we provide a way to do what you want (pseq), I'm just not
convinced it should be the required behaviour of seq.
OK, thanks for pointing that out. I would have thought that what I was
doing (or trying to do) was a reasonable use of the FFI and
unsafePerformIO - from the library user's POV the interface really is
pure, at least in a sequential setting. So should there be a mechanism
for guaranteeing left-to-right evaluation ala pseq in Haskell Prime?
cheers
peter
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime