Hello Chad,

Friday, January 5, 2007, 6:15:34 PM, you wrote:

> Thanks, you make some interesting points to consider. This leads me to
> wonder how these arguments might be extended to

> (1) IORef (a,b)     vs.     (IORef a, IORef b)

depends on whether you need to read/write both variables at the same or
different moments. also, "IORef a" may be optimized to "IOURef a" which
works faster

> (2) TVar (a,b)     vs.     (TVar a, TVar b)

i never worked with STM, but guess that TVar usage pattern is just the smae
as for MVar

btw, you can use type synonym to make switching from IORef to MVar easier:

type MyVar a = IORef a


-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to