[PATCH] Add deprecations status of unGetChan and isEmptyChan to Haddock comment

Simon Hengel simon.hengel at wiktory.org
Tue Aug 9 16:12:26 CEST 2011


---
 Control/Concurrent/Chan.hs |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Control/Concurrent/Chan.hs b/Control/Concurrent/Chan.hs
index 23b21bb..2906367 100644
--- a/Control/Concurrent/Chan.hs
+++ b/Control/Concurrent/Chan.hs
@@ -109,7 +109,11 @@ dupChan (Chan _ writeVar) = do
    newReadVar <- newMVar hole
    return (Chan newReadVar writeVar)
 
--- |Put a data item back onto a channel, where it will be the next item read.
+-- |Note: This operation is deprecated.
+-- If you need this operation, use "Control.Concurrent.STM.TChan" instead.  See
+-- <http://hackage.haskell.org/trac/ghc/ticket/4154> for details.
+--
+-- Put a data item back onto a channel, where it will be the next item read.
 unGetChan :: Chan a -> a -> IO ()
 unGetChan (Chan readVar _) val = do
    new_read_end <- newEmptyMVar
@@ -118,7 +122,11 @@ unGetChan (Chan readVar _) val = do
      return new_read_end
 {-# DEPRECATED unGetChan "if you need this operation, use Control.Concurrent.STM.TChan instead.  See http://hackage.haskell.org/trac/ghc/ticket/4154 for details" #-}
 
--- |Returns 'True' if the supplied 'Chan' is empty.
+-- |Note: This operation is deprecated.
+-- If you need this operation, use "Control.Concurrent.STM.TChan" instead.  See
+-- <http://hackage.haskell.org/trac/ghc/ticket/4154> for details.
+--
+-- Returns 'True' if the supplied 'Chan' is empty.
 isEmptyChan :: Chan a -> IO Bool
 isEmptyChan (Chan readVar writeVar) = do
    withMVar readVar $ \r -> do
-- 
1.7.4.1




More information about the Libraries mailing list