
29 Dec
2005
29 Dec
'05
3:02 p.m.
test_Cubby = do tv <- newTVar 0
You've almost got it! But "newTVar 0" has type STM Tvar, and you're trying to use it in the IO monad. So just say "tv <- atomically (newTVar 0)" and you're set. Do notice that you'll see output like this: co"nisnusmeer t6 "6 " "c"oinnssuemret 61"" ""cionnsseurmte 95"" ""icnosnesrutm e2 "9 since the two threads are interleaved. -- Brian T. Sniffen bts@alum.mit.edu or brian.sniffen@gmail.com http://www.evenmere.org/~bts