26 Jan
2001
26 Jan
'01
12:31 p.m.
Shouldn't this instead be dupChan :: Chan a -> IO (Chan a) dupChan (Chan _read write) = do new_read <- newEmptyMVar hole <- readMVar write putMVar new_read hole ** putMVar write hole ** return (Chan new_read write) No: readMVar is defined to be take-followed-by-put. I think you mis-read the "readMVar write" as "takeMVar write". Nevertheless, there is a bug in dupChan, but it's in the code for readChan, where "takeMVar read_end" should be "readMVar read_end". As you'll have seen if you are on the Haskell mailing list. Shame on me! Simon
9295
Age (days ago)
9295
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Peyton-Jones