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


-- | Some extra kit for Chans
--   
--   Please see the README on Github at
--   <a>https://github.com/athanclark/chan#readme</a>
@package chan
@version 0.0.4.1

module Control.Concurrent.Chan.Scope
data Scope
Read :: Scope
Write :: Scope
ReadWrite :: Scope
class Readable (a :: Scope)
class Writable (a :: Scope)
instance Control.Concurrent.Chan.Scope.Writable 'Control.Concurrent.Chan.Scope.Write
instance Control.Concurrent.Chan.Scope.Writable 'Control.Concurrent.Chan.Scope.ReadWrite
instance Control.Concurrent.Chan.Scope.Readable 'Control.Concurrent.Chan.Scope.Read
instance Control.Concurrent.Chan.Scope.Readable 'Control.Concurrent.Chan.Scope.ReadWrite

module Control.Concurrent.Chan.Typed
newtype ChanRW (scope :: Scope) a
ChanRW :: (Chan a) -> ChanRW a
newChanRW :: IO (ChanRW  'ReadWrite a)
writeChanRW :: Writable scope => ChanRW scope a -> a -> IO ()
readChanRW :: Readable scope => ChanRW scope a -> IO a
dupChanRW :: Writable scopeIn => Readable scopeOut => ChanRW scopeIn a -> IO (ChanRW scopeOut a)

module Control.Concurrent.STM.TChan.Typed
newtype TChanRW (scope :: Scope) a
TChanRW :: (TChan a) -> TChanRW a
newTChanRW :: STM (TChanRW  'ReadWrite a)
writeTChanRW :: Writable scope => TChanRW scope a -> a -> STM ()
unGetTChanRW :: Writable scope => TChanRW scope a -> a -> STM ()
isEmptyTChanRW :: Readable scope => TChanRW scope a -> STM Bool
readTChanRW :: Readable scope => TChanRW scope a -> STM a
tryReadTChanRW :: Readable scope => TChanRW scope a -> STM (Maybe a)
peekTChanRW :: Readable scope => TChanRW scope a -> STM a
tryPeekTChanRW :: Readable scope => TChanRW scope a -> STM (Maybe a)
newBroadcastTChanRW :: STM (TChanRW  'Write a)
dupTChanRW :: Writable scopeIn => Readable scopeOut => TChanRW scopeIn a -> STM (TChanRW scopeOut a)
cloneTChanRW :: Writable scopeIn => Readable scopeOut => TChanRW scopeIn a -> STM (TChanRW scopeOut a)

module Control.Concurrent.Chan.Extra

-- | Class for changing the access of a typed channel
class ChanScoped (c :: Scope -> * -> *)
readOnly :: (ChanScoped c, Readable scope) => c scope a -> c  'Read a
writeOnly :: (ChanScoped c, Writable scope) => c scope a -> c  'Write a
allowReading :: (ChanScoped c, Writable scope) => c scope a -> c  'ReadWrite a
allowWriting :: (ChanScoped c, Readable scope) => c scope a -> c  'ReadWrite a
type DiffNanosec = Int

-- | Class for extra channel techniques
class ChanExtra (inputC :: * -> *) (outputC :: * -> *) | inputC -> outputC, outputC -> inputC

-- | Throw away messages that meet the threshold
debounceStatic :: ChanExtra inputC outputC => DiffNanosec -> outputC a -> IO (inputC a, Async ())

-- | Refrain from relaying messages that meet the threshold
throttleStatic :: ChanExtra inputC outputC => DiffNanosec -> outputC a -> IO (inputC a, Async ())

-- | Intercalate messages while threshold is met
intersperseStatic :: ChanExtra inputC outputC => DiffNanosec -> IO a -> outputC a -> IO (inputC a, Async (), Async ())
instance Control.Concurrent.Chan.Extra.ChanExtra Control.Concurrent.Chan.Chan Control.Concurrent.Chan.Chan
instance Control.Concurrent.Chan.Extra.ChanExtra Control.Concurrent.STM.TChan.TChan Control.Concurrent.STM.TChan.TChan
instance Control.Concurrent.Chan.Extra.ChanExtra (Control.Concurrent.STM.TChan.Typed.TChanRW 'Control.Concurrent.Chan.Scope.Write) (Control.Concurrent.STM.TChan.Typed.TChanRW 'Control.Concurrent.Chan.Scope.Read)
instance Control.Concurrent.Chan.Extra.ChanExtra (Control.Concurrent.Chan.Typed.ChanRW 'Control.Concurrent.Chan.Scope.Write) (Control.Concurrent.Chan.Typed.ChanRW 'Control.Concurrent.Chan.Scope.Read)
instance Control.Concurrent.Chan.Extra.ChanScoped Control.Concurrent.STM.TChan.Typed.TChanRW
instance Control.Concurrent.Chan.Extra.ChanScoped Control.Concurrent.Chan.Typed.ChanRW
