chan-0.0.4.1: Some extra kit for Chans

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.Chan.Extra

Synopsis

Documentation

class ChanScoped (c :: Scope -> * -> *) where #

Class for changing the access of a typed channel

Methods

readOnly :: Readable scope => c scope a -> c Read a #

writeOnly :: Writable scope => c scope a -> c Write a #

allowReading :: Writable scope => c scope a -> c ReadWrite a #

allowWriting :: Readable scope => c scope a -> c ReadWrite a #

Instances
ChanScoped ChanRW # 
Instance details

Defined in Control.Concurrent.Chan.Extra

Methods

readOnly :: Readable scope => ChanRW scope a -> ChanRW Read a #

writeOnly :: Writable scope => ChanRW scope a -> ChanRW Write a #

allowReading :: Writable scope => ChanRW scope a -> ChanRW ReadWrite a #

allowWriting :: Readable scope => ChanRW scope a -> ChanRW ReadWrite a #

ChanScoped TChanRW # 
Instance details

Defined in Control.Concurrent.Chan.Extra

Methods

readOnly :: Readable scope => TChanRW scope a -> TChanRW Read a #

writeOnly :: Writable scope => TChanRW scope a -> TChanRW Write a #

allowReading :: Writable scope => TChanRW scope a -> TChanRW ReadWrite a #

allowWriting :: Readable scope => TChanRW scope a -> TChanRW ReadWrite a #

class ChanExtra (inputC :: * -> *) (outputC :: * -> *) | inputC -> outputC, outputC -> inputC where #

Class for extra channel techniques

Methods

debounceStatic #

Arguments

:: DiffNanosec

Time to wait before attempting to send the message

-> outputC a 
-> IO (inputC a, Async ()) 

Throw away messages that meet the threshold

throttleStatic #

Arguments

:: DiffNanosec

Time to wait before sending the message, for every message

-> outputC a 
-> IO (inputC a, Async ()) 

Refrain from relaying messages that meet the threshold

intersperseStatic #

Arguments

:: DiffNanosec

Time to at-least wait to intersperse messages

-> IO a

Get a message to intersperse

-> outputC a 
-> IO (inputC a, Async (), Async ()) 

Intercalate messages while threshold is met