[GHC] #7986: make newBroadcastTChanIO match newBroadcastTChan
GHC
ghc-devs at haskell.org
Sun Jun 16 09:40:23 CEST 2013
#7986: make newBroadcastTChanIO match newBroadcastTChan
-----------------------------+----------------------------------------------
Reporter: WrenThornton | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.6.3 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-----------------------------+----------------------------------------------
While looking through the pull requests for stm-chans I came across a
discrepancy in the new stm. Namely, we have the following definitions:
* stm == 2.4
{{{
newBroadcastTChan :: STM (TChan a)
newBroadcastTChan = do
dummy_hole <- newTVar TNil
write_hole <- newTVar TNil
read <- newTVar dummy_hole
write <- newTVar write_hole
return (TChan read write)
newBroadcastTChanIO :: IO (TChan a)
newBroadcastTChanIO = do
dummy_hole <- newTVarIO TNil
write_hole <- newTVarIO TNil
read <- newTVarIO dummy_hole
write <- newTVarIO write_hole
return (TChan read write)
}}}
* stm == 2.4.2
{{{
newBroadcastTChan :: STM (TChan a)
newBroadcastTChan = do
write_hole <- newTVar TNil
read <- newTVar (error ...)
write <- newTVar write_hole
return (TChan read write)
newBroadcastTChanIO :: IO (TChan a)
newBroadcastTChanIO = do
dummy_hole <- newTVarIO TNil
write_hole <- newTVarIO TNil
read <- newTVarIO dummy_hole
write <- newTVarIO write_hole
return (TChan read write)
}}}
Thus, whoever changed the definition of newBroadcastTChan in 2.4.2 forgot
to change newBroadcastTChanIO to keep it in sync.
PROPOSAL: I propose changing newBroadcastTChanIO to match
newBroadcastTChan.
ACCEPTED: +1: wren ng thornton, Edward Kmett, John Wiegley; -1: noone.
http://www.haskell.org/pipermail/libraries/2013-May/019808.html
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7986>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list