-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | TMVars, TVars and TChans with distinguished input and output side
--   
--   Transactional MVars, Vars and Channels with distinguished input and
--   output side. When threads communicate via a TMVar, a TVar or a TChan
--   there are often clearly defined roles, which thread is the sender and
--   which one is receiver. We provide wrappers around the standard
--   concurrency communication channels that make the distinction clear and
--   type safe.
--   
--   For example, if a function has a parameter of type <tt>TChan.In</tt>
--   then it is sure that it will only write to that channel. Additionally
--   if the compiler warns about an unused <tt>TChan.Out</tt> that was
--   created by <tt>TChan.new</tt> then you know that the receiver part of
--   your communication is missing.
--   
--   See also package <tt>concurrent-split</tt> for non-transactional
--   communication. This package follows the same idea as
--   <tt>chan-split</tt> but is strictly Haskell 98.
@package stm-split
@version 0.0.2

module Control.Concurrent.STM.Split.Class
data In
data Out
class C chan
newIO :: C chan => IO (chan In a, chan Out a)
new :: C chan => STM (chan In a, chan Out a)
read :: C chan => chan Out a -> STM a
write :: C chan => chan In a -> a -> STM ()

module Control.Concurrent.STM.Split.Chan
data T dir a
type In = T In
type Out = T Out
newIO :: IO (In a, Out a)
new :: STM (In a, Out a)
read :: Out a -> STM a
write :: In a -> a -> STM ()
writeIO :: In a -> a -> IO ()
instance Control.Concurrent.STM.Split.Class.C Control.Concurrent.STM.Split.Chan.T

module Control.Concurrent.STM.Split.MVar
data T dir a
type In = T In
type Out = T Out
newEmptyIO :: IO (In a, Out a)
newEmpty :: STM (In a, Out a)
newIO :: a -> IO (In a, Out a)
new :: a -> STM (In a, Out a)
take :: Out a -> STM a
tryTake :: Out a -> STM (Maybe a)
put :: In a -> a -> STM ()
tryPut :: In a -> a -> STM Bool

-- | Write value to <a>TMVar</a> and overwrite existing content. It never
--   blocks. Please note, that this function is different from the generic
--   <a>write</a>, which blocks on <a>TMVar</a>s.
write :: In a -> a -> STM ()
instance Control.Concurrent.STM.Split.Class.C Control.Concurrent.STM.Split.MVar.T
