On 8/14/08, Roman Leshchinskiy <[EMAIL PROTECTED]> wrote:
>
>  IIUC, the practical difference is this. If you have
>
>   f :: Int -> (# Int #)
>
>  then
>
>   case f m of (# n #) -> bar n
>
>  will call f before calling bar but will not evaluate n.

I fear I'm still not enlightened. I see how your example works, but in
the particular context where GHC introduces these singleton tuples,
the tuple will contain an unboxed value (the result of a foreign
function call.) So if n is unboxed, isn't
case f m of (# n #) -> bar n
exactly equivalent to
bar $! (f m)
?

(Or are the singleton tuples a way to avoid using seq and its friends?)

Cheers,
Tim

-- 
Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt
"I wish people weren't so set on being themselves, when that means
being a bastard." -- Robertson Davies

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to